-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
470 lines (422 loc) · 19.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
# 3.11 because of imported target "OpenMP::OpenMP_C"
cmake_minimum_required(VERSION 3.11)
project(fmdt)
set(CMAKE_WARN_DEPRECATED OFF CACHE BOOL "" FORCE)
# CMake options ---------------------------------------------------------------
# -----------------------------------------------------------------------------
option(FMDT_DETECT_EXE "compile the detection chain executable." ON)
option(FMDT_ELLIPSE_EXE "compile the ellipse chain executable." ON)
option(FMDT_VISU_EXE "compile the visualization executable." ON)
option(FMDT_CHECK_EXE "compile the checking executable." ON)
option(FMDT_MAXRED_EXE "compile the max reduction executable." ON)
option(FMDT_DEBUG "build the project using debugging code" OFF)
option(FMDT_OPENCV_LINK "link with OpenCV library." OFF)
option(FMDT_SPU_RUNTIME "link with StreamPU for execution runtime." OFF)
option(FMDT_LSL_LINK "link with external LSL library." OFF)
option(FMDT_LSL_NEW_INTERFACE "enable new LSL library interface." OFF)
option(FMDT_USE_VCIO "load video sequences using vcodecs-io library rather than ffmpeg-io" OFF)
if (FMDT_OPENCV_LINK OR FMDT_SPU_RUNTIME)
set(FMDT_CPP ON)
else()
set(FMDT_CPP OFF)
endif()
# Print CMake options values --------------------------------------------------
# -----------------------------------------------------------------------------
message(STATUS "FMDT options: ")
message(STATUS " * FMDT_DETECT_EXE: '${FMDT_DETECT_EXE}'")
message(STATUS " * FMDT_ELLIPSE_EXE: '${FMDT_ELLIPSE_EXE}'")
message(STATUS " * FMDT_VISU_EXE: '${FMDT_VISU_EXE}'")
message(STATUS " * FMDT_CHECK_EXE: '${FMDT_CHECK_EXE}'")
message(STATUS " * FMDT_MAXRED_EXE: '${FMDT_MAXRED_EXE}'")
message(STATUS " * FMDT_DEBUG: '${FMDT_DEBUG}'")
message(STATUS " * FMDT_OPENCV_LINK: '${FMDT_OPENCV_LINK}'")
message(STATUS " * FMDT_SPU_RUNTIME: '${FMDT_SPU_RUNTIME}'")
message(STATUS " * FMDT_LSL_LINK: '${FMDT_LSL_LINK}'")
message(STATUS " * FMDT_LSL_NEW_INTERFACE: '${FMDT_LSL_NEW_INTERFACE}'")
message(STATUS " * FMDT_USE_VCIO: '${FMDT_USE_VCIO}'")
message(STATUS "FMDT info: ")
message(STATUS " * FMDT_CPP: '${FMDT_CPP}'")
message(STATUS " * CMAKE_BUILD_TYPE: '${CMAKE_BUILD_TYPE}'")
# Check CMake options ---------------------------------------------------------
# -----------------------------------------------------------------------------
# empty...
# Define CMake variables ------------------------------------------------------
# -----------------------------------------------------------------------------
set(src_dir src)
set(inc_dir include)
set(exe_dir bin)
set(lib_dir lib)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
# Get version from Git --------------------------------------------------------
# -----------------------------------------------------------------------------
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
git_describe(GIT_VERSION "--tags" "--abbrev=8")
if(GIT_VERSION MATCHES "NOTFOUND")
set(GIT_VERSION "")
set(GIT_SHA1 "")
set(FMDT_VERSION_FULL "")
set(FMDT_VERSION "")
set(FMDT_BUILD "0")
set(FMDT_HASH "")
set(FMDT_VERSION_MAJOR "0")
set(FMDT_VERSION_MINOR "0")
set(FMDT_VERSION_PATCH "0")
else()
string(REGEX REPLACE "^v" "" FMDT_VERSION_FULL ${GIT_VERSION})
string(REGEX REPLACE "-.*" "" FMDT_VERSION ${FMDT_VERSION_FULL})
string(REGEX REPLACE "^.*-" "" FMDT_HASH ${FMDT_VERSION_FULL})
string( REPLACE "-" "" FMDT_BUILD ${FMDT_VERSION_FULL})
string( REPLACE "${FMDT_VERSION}" "" FMDT_BUILD ${FMDT_BUILD})
string(REGEX REPLACE "(.*)\\..*\\..*" "\\1" FMDT_VERSION_MAJOR ${FMDT_VERSION})
string(REGEX REPLACE ".*\\.(.*)\\..*" "\\1" FMDT_VERSION_MINOR ${FMDT_VERSION})
string(REGEX REPLACE ".*\\..*\\.(.*)" "\\1" FMDT_VERSION_PATCH ${FMDT_VERSION})
if(NOT "${FMDT_BUILD}" STREQUAL "")
string(REPLACE "${FMDT_HASH}" "" FMDT_BUILD ${FMDT_BUILD})
else()
set(FMDT_BUILD "0")
endif()
message(STATUS " * FMDT_VERSION: ${FMDT_VERSION}")
if(NOT "${FMDT_BUILD}" STREQUAL "")
message(STATUS " * FMDT_BUILD: ${FMDT_BUILD}")
endif()
string(SUBSTRING ${GIT_SHA1} 0 8 FMDT_HASH)
if(NOT "${FMDT_HASH}" STREQUAL "")
message(STATUS " * FMDT_HASH: ${FMDT_HASH}")
endif()
if(("${FMDT_BUILD}" STREQUAL "") OR ("${FMDT_HASH}" STREQUAL ""))
set(FMDT_VERSION_EXTRA "")
else()
set(FMDT_VERSION_EXTRA "-${FMDT_BUILD}-${FMDT_HASH}")
endif()
endif()
# Compiler generic options ----------------------------------------------------
# -----------------------------------------------------------------------------
# enable C11
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
if (FMDT_CPP)
# enable C++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
endif()
# Specify the executable and lib output path ----------------------------------
# -----------------------------------------------------------------------------
set(EXECUTABLE_OUTPUT_PATH ${exe_dir})
# Check c-vector mandatory dependency -----------------------------------------
# -----------------------------------------------------------------------------
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/c-vector/vec.h")
message(FATAL_ERROR "'c-vector' can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init -- ../lib/c-vector/")
endif()
# Declare source files to compile ---------------------------------------------
# -----------------------------------------------------------------------------
set(src_common_files
${src_dir}/common/args.c
${src_dir}/common/tools.c
${src_dir}/common/CCL/CCL_compute.c
${src_dir}/common/CCL/CCL_struct.c
${src_dir}/common/features/features_compute.c
${src_dir}/common/features/features_io.c
${src_dir}/common/image/image_compute.c
${src_dir}/common/image/image_io.c
${src_dir}/common/image/image_struct.c
${src_dir}/common/kNN/kNN_compute.c
${src_dir}/common/kNN/kNN_io.c
${src_dir}/common/motion/motion_compute.c
${src_dir}/common/motion/motion_io.c
${src_dir}/common/threshold/threshold_compute.c
${src_dir}/common/tracking/tracking_compute.c
${src_dir}/common/tracking/tracking_global.c
${src_dir}/common/tracking/tracking_io.c
${src_dir}/common/tracking/tracking_struct.c
${src_dir}/common/validation/validation_compute.c
${src_dir}/common/validation/validation_global.c
${src_dir}/common/validation/validation_io.c
${src_dir}/common/video/video_io.c
${src_dir}/common/video/video_struct.c
${src_dir}/common/visu/visu_io.c
${lib_dir}/c-vector/vec.c)
list(APPEND fmdt_src_list ${src_common_files})
# Generate version file -------------------------------------------------------
# -----------------------------------------------------------------------------
# Auto generate a header containing the last Git SHA1
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/common/version.c.in"
"${CMAKE_CURRENT_SOURCE_DIR}/src/common/version.c" @ONLY)
list(APPEND src_common_files "${CMAKE_CURRENT_SOURCE_DIR}/src/common/version.c")
list(APPEND fmdt_src_list "${CMAKE_CURRENT_SOURCE_DIR}/src/common/version.c")
# Create binaries -------------------------------------------------------------
# -----------------------------------------------------------------------------
# objects
add_library(fmdt-common-obj OBJECT ${src_common_files})
list(APPEND fmdt_targets_list fmdt-common-obj)
# executables
if(FMDT_DETECT_EXE)
set(src_detect_files
${src_dir}/mains/detect.c)
list(APPEND fmdt_src_list ${src_detect_files})
add_executable(fmdt-detect-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_detect_files})
list(APPEND fmdt_targets_list fmdt-detect-exe)
set_target_properties(fmdt-detect-exe PROPERTIES OUTPUT_NAME fmdt-detect)
set(src_detectopt_files
${src_dir}/mains/detect_opt.c)
list(APPEND fmdt_src_list ${src_detectopt_files})
add_executable(fmdt-detect-opt-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_detectopt_files})
list(APPEND fmdt_targets_list fmdt-detect-opt-exe)
set_target_properties(fmdt-detect-opt-exe PROPERTIES OUTPUT_NAME fmdt-detect-opt)
set(src_detectnofail_files
${src_dir}/mains/detect_no_fail.c)
list(APPEND fmdt_src_list ${src_detectnofail_files})
add_executable(fmdt-detect-no-fail-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_detectnofail_files})
list(APPEND fmdt_targets_list fmdt-detect-no-fail-exe)
set_target_properties(fmdt-detect-no-fail-exe PROPERTIES OUTPUT_NAME fmdt-detect-no-fail)
set(src_detectoptnofail_files
${src_dir}/mains/detect_opt_no_fail.c)
list(APPEND fmdt_src_list ${src_detectoptnofail_files})
add_executable(fmdt-detect-opt-no-fail-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_detectoptnofail_files})
list(APPEND fmdt_targets_list fmdt-detect-opt-no-fail-exe)
set_target_properties(fmdt-detect-opt-no-fail-exe PROPERTIES OUTPUT_NAME fmdt-detect-opt-no-fail)
if (FMDT_SPU_RUNTIME)
set(src_detectrt_common_files
${src_dir}/spu/Video/Video.cpp
${src_dir}/spu/Video/Video2.cpp
${src_dir}/spu/CCL/CCL.cpp
${src_dir}/spu/CCL/CCL_threshold_features.cpp
${src_dir}/spu/Features/Features_extractor.cpp
${src_dir}/spu/Features/Features_labels_zero_init.cpp
${src_dir}/spu/Features/Features_merger_CCL_HI_v2.cpp
${src_dir}/spu/Features/Features_merger_CCL_HI_v3.cpp
${src_dir}/spu/Features/Features_magnitude.cpp
${src_dir}/spu/Features/Features_ellipse.cpp
${src_dir}/spu/kNN_matcher/kNN_matcher.cpp
${src_dir}/spu/Motion/Motion.cpp
${src_dir}/spu/Logger/Logger_frame.cpp
${src_dir}/spu/Logger/Logger_kNN.cpp
${src_dir}/spu/Logger/Logger_motion.cpp
${src_dir}/spu/Logger/Logger_RoIs.cpp
${src_dir}/spu/Logger/Logger_tracks.cpp
${src_dir}/spu/Threshold/Threshold.cpp
${src_dir}/spu/Tracking/Tracking.cpp
${src_dir}/spu/Visu/Visu.cpp
${src_dir}/common/args.cpp
${src_dir}/common/tools.cpp)
list(APPEND fmdt_src_list ${src_detectrt_common_files})
add_library(fmdt-detect-rt-common-obj OBJECT ${src_detectrt_common_files})
list(APPEND fmdt_targets_list fmdt-detect-rt-common-obj)
set(src_detectrt1_files
${src_dir}/mains/detect_rt.cpp)
list(APPEND fmdt_src_list ${src_detectrt1_files})
add_executable(fmdt-detect-rt-seq-exe
$<TARGET_OBJECTS:fmdt-common-obj>
$<TARGET_OBJECTS:fmdt-detect-rt-common-obj>
${src_detectrt1_files})
list(APPEND fmdt_targets_list fmdt-detect-rt-seq-exe)
set_target_properties(fmdt-detect-rt-seq-exe PROPERTIES OUTPUT_NAME fmdt-detect-rt-seq)
add_executable(fmdt-detect-rt-pip-exe
$<TARGET_OBJECTS:fmdt-common-obj>
$<TARGET_OBJECTS:fmdt-detect-rt-common-obj>
${src_detectrt1_files})
list(APPEND fmdt_targets_list fmdt-detect-rt-pip-exe)
set_target_properties(fmdt-detect-rt-pip-exe PROPERTIES OUTPUT_NAME fmdt-detect-rt-pip)
target_compile_definitions(fmdt-detect-rt-pip-exe PUBLIC FMDT_ENABLE_PIPELINE)
set(src_detectrt2_files
${src_dir}/mains/detect_rt2.cpp)
list(APPEND fmdt_src_list ${src_detectrt2_files})
add_executable(fmdt-detect-rt2-seq-exe
$<TARGET_OBJECTS:fmdt-common-obj>
$<TARGET_OBJECTS:fmdt-detect-rt-common-obj>
${src_detectrt2_files})
list(APPEND fmdt_targets_list fmdt-detect-rt2-seq-exe)
set_target_properties(fmdt-detect-rt2-seq-exe PROPERTIES OUTPUT_NAME fmdt-detect-rt2-seq)
add_executable(fmdt-detect-rt2-pip-exe
$<TARGET_OBJECTS:fmdt-common-obj>
$<TARGET_OBJECTS:fmdt-detect-rt-common-obj>
${src_detectrt2_files})
list(APPEND fmdt_targets_list fmdt-detect-rt2-pip-exe)
set_target_properties(fmdt-detect-rt2-pip-exe PROPERTIES OUTPUT_NAME fmdt-detect-rt2-pip)
target_compile_definitions(fmdt-detect-rt2-pip-exe PUBLIC FMDT_ENABLE_PIPELINE)
set(src_detectrt1opt_files
${src_dir}/mains/detect_rt_opt.cpp)
list(APPEND fmdt_src_list ${src_detectrt1opt_files})
add_executable(fmdt-detect-rt-opt-seq-exe
$<TARGET_OBJECTS:fmdt-common-obj>
$<TARGET_OBJECTS:fmdt-detect-rt-common-obj>
${src_detectrt1opt_files})
list(APPEND fmdt_targets_list fmdt-detect-rt-opt-seq-exe)
set_target_properties(fmdt-detect-rt-opt-seq-exe PROPERTIES OUTPUT_NAME fmdt-detect-rt-opt-seq)
add_executable(fmdt-detect-rt-opt-pip-exe
$<TARGET_OBJECTS:fmdt-common-obj>
$<TARGET_OBJECTS:fmdt-detect-rt-common-obj>
${src_detectrt1opt_files})
list(APPEND fmdt_targets_list fmdt-detect-rt-opt-pip-exe)
set_target_properties(fmdt-detect-rt-opt-pip-exe PROPERTIES OUTPUT_NAME fmdt-detect-rt-opt-pip)
target_compile_definitions(fmdt-detect-rt-opt-pip-exe PUBLIC FMDT_ENABLE_PIPELINE)
endif()
endif()
if(FMDT_ELLIPSE_EXE)
set(src_ellipse_files
${src_dir}/mains/ellipse.c)
list(APPEND fmdt_src_list ${src_ellipse_files})
add_executable(fmdt-ellipse-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_ellipse_files})
list(APPEND fmdt_targets_list fmdt-ellipse-exe)
set_target_properties(fmdt-ellipse-exe PROPERTIES OUTPUT_NAME fmdt-ellipse)
endif()
if(FMDT_VISU_EXE)
set(src_visu_files
${src_dir}/mains/visu.c)
list(APPEND fmdt_src_list ${src_visu_files})
add_executable(fmdt-visu-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_visu_files})
list(APPEND fmdt_targets_list fmdt-visu-exe)
set_target_properties(fmdt-visu-exe PROPERTIES OUTPUT_NAME fmdt-visu)
endif()
if(FMDT_CHECK_EXE)
set(src_check_files
${src_dir}/mains/check.c)
list(APPEND fmdt_src_list ${src_check_files})
add_executable(fmdt-check-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_check_files})
list(APPEND fmdt_targets_list fmdt-check-exe)
set_target_properties(fmdt-check-exe PROPERTIES OUTPUT_NAME fmdt-check)
endif()
if(FMDT_MAXRED_EXE)
set(src_maxred_files
${src_dir}/mains/maxred.c)
list(APPEND fmdt_src_list ${src_maxred_files})
add_executable(fmdt-maxred-exe $<TARGET_OBJECTS:fmdt-common-obj> ${src_maxred_files})
list(APPEND fmdt_targets_list fmdt-maxred-exe)
set_target_properties(fmdt-maxred-exe PROPERTIES OUTPUT_NAME fmdt-maxred)
endif()
# create symlink from Python script to bin/ folder
set(FMDT_LOG_PARSER_TARGET ${CMAKE_CURRENT_SOURCE_DIR}/scripts/log_parser/log_parser.py)
set(FMDT_LOG_PARSER_SYMLINK ${exe_dir}/fmdt-log-parser)
add_custom_target(fmdt-log-parser ALL
COMMAND ${CMAKE_COMMAND} -E create_symlink ${FMDT_LOG_PARSER_TARGET} ${FMDT_LOG_PARSER_SYMLINK})
macro(fmdt_set_source_files_properties files key value)
foreach(_file IN ITEMS ${files})
set_source_files_properties(${_file} PROPERTIES ${key} ${value})
endforeach()
endmacro()
# force C++ language when linking with OpenCV and/or StreamPU
if (FMDT_CPP)
fmdt_set_source_files_properties("${fmdt_src_list}" LANGUAGE CXX)
endif()
# Add and compile sub-projects ------------------------------------------------
# -----------------------------------------------------------------------------
# ffmpeg-io
if (NOT TARGET ffmpeg-io-slib)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/ffmpeg-io/include/constants.h")
option(FFMPEG-IO_EXE "Forced option from '${CMAKE_PROJECT_NAME}'." OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/ffmpeg-io/)
else()
message(FATAL_ERROR "'ffmpeg-io' can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init -- ../lib/ffmpeg-io/")
endif()
endif()
# nrc
if (NOT TARGET nrc-slib)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/nrc2/include/nrc.h")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/nrc2/)
else()
message(FATAL_ERROR "'nrc2' can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init -- ../lib/nrc2/")
endif()
endif()
# StreamPU
if (FMDT_SPU_RUNTIME)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/streampu/include/streampu.hpp")
option(SPU_COMPILE_STATIC_LIB "" ON)
option(SPU_COMPILE_SHARED_LIB "" OFF)
option(SPU_TESTS "" OFF)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/streampu/)
else()
message(FATAL_ERROR "'StreamPU' can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init --recursive -- ../lib/streampu/")
endif()
endif()
if (FMDT_OPENCV_LINK)
find_package(OpenCV REQUIRED)
endif()
# LSL
if (FMDT_LSL_LINK)
if (NOT TARGET lsl-slib)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/lib/lsl/include/flsl.h")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/lsl/)
else()
message(FATAL_ERROR "'lsl' can't be found, try to init the submodule with the following cmd:\n"
"$ git submodule update --init -- ../lib/lsl/")
endif()
endif()
endif()
# vcodecs-io
if (FMDT_USE_VCIO)
add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/lib/vcodecs-io/")
endif()
# Add definitions -------------------------------------------------------------
# -----------------------------------------------------------------------------
macro(fmdt_target_compile_definitions targets privacy dir)
foreach(_target IN ITEMS ${targets})
target_compile_definitions(${_target} ${privacy} ${dir})
endforeach()
endmacro()
if (FMDT_DEBUG)
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_ENABLE_DEBUG)
endif()
if (FMDT_OPENCV_LINK)
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_OPENCV_LINK)
endif()
if (FMDT_SPU_RUNTIME)
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_SPU_LINK)
endif()
if (FMDT_LSL_LINK)
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_LSL_LINK)
endif()
if (FMDT_LSL_NEW_INTERFACE)
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_LSL_NEW_INTERFACE)
endif()
if (FMDT_USE_VCIO)
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_USE_VCODECS_IO)
endif()
# Keep ffmpeg-io enabled
fmdt_target_compile_definitions("${fmdt_targets_list}" PUBLIC FMDT_USE_FFMPEG_IO)
# Set include directory -------------------------------------------------------
# -----------------------------------------------------------------------------
macro(fmdt_target_include_directories targets privacy dir)
foreach(_target IN ITEMS ${targets})
target_include_directories(${_target} ${privacy} ${dir})
endforeach()
endmacro()
fmdt_target_include_directories("${fmdt_targets_list}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${inc_dir}/c)
fmdt_target_include_directories("${fmdt_targets_list}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${lib_dir}/c-vector)
if (FMDT_OPENCV_LINK)
fmdt_target_include_directories("${fmdt_targets_list}" PUBLIC ${OpenCV_INCLUDE_DIRS})
endif()
if (FMDT_SPU_RUNTIME)
fmdt_target_include_directories("${fmdt_targets_list}" PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${inc_dir}/cpp)
endif()
# Link with dependencies ------------------------------------------------------
# -----------------------------------------------------------------------------
macro(fmdt_target_link_libraries targets privacy lib)
foreach(_target IN ITEMS ${targets})
target_link_libraries(${_target} ${privacy} ${lib})
endforeach()
endmacro()
fmdt_target_link_libraries("${fmdt_targets_list}" PUBLIC ffmpeg-io-slib)
fmdt_target_link_libraries("${fmdt_targets_list}" PUBLIC m)
fmdt_target_link_libraries("${fmdt_targets_list}" PUBLIC nrc-slib)
if (FMDT_OPENCV_LINK)
fmdt_target_link_libraries("${fmdt_targets_list}" PUBLIC "${OpenCV_LIBS}")
endif()
if (FMDT_SPU_RUNTIME)
fmdt_target_link_libraries("${fmdt_targets_list}" PUBLIC spu-static-lib)
endif()
if (FMDT_LSL_LINK)
if (TARGET lsl-simd-slib)
fmdt_target_link_libraries("${fmdt_targets_list}" PRIVATE lsl-simd-slib)
else()
fmdt_target_link_libraries("${fmdt_targets_list}" PRIVATE lsl-slib)
endif()
endif()
if (FMDT_USE_VCIO)
if (TARGET vcodecs-io-slib)
fmdt_target_link_libraries("${fmdt_targets_list}" PRIVATE vcodecs-io-slib)
endif()
endif()