|
|
|
@ -787,15 +787,12 @@ macro(_ocv_create_module) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
set(sub_objs "") |
|
|
|
|
set(sub_links "") |
|
|
|
|
set(cuda_objs "") |
|
|
|
|
if (OPENCV_MODULE_${the_module}_CHILDREN) |
|
|
|
|
message(STATUS "Complex module ${the_module}") |
|
|
|
|
foreach (m ${OPENCV_MODULE_${the_module}_CHILDREN}) |
|
|
|
|
if (BUILD_${m} AND TARGET ${m}_object) |
|
|
|
|
get_target_property(_sub_links ${m} LINK_LIBRARIES) |
|
|
|
|
list(APPEND sub_objs $<TARGET_OBJECTS:${m}_object>) |
|
|
|
|
list(APPEND sub_links ${_sub_links}) |
|
|
|
|
message(STATUS " + ${m}") |
|
|
|
|
else() |
|
|
|
|
message(STATUS " - ${m}") |
|
|
|
@ -837,38 +834,21 @@ macro(_ocv_create_module) |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
if (cuda_objs) |
|
|
|
|
target_link_libraries(${the_module} ${cuda_objs}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
# TODO: is it needed? |
|
|
|
|
if (sub_links) |
|
|
|
|
ocv_list_filterout(sub_links "^opencv_") |
|
|
|
|
ocv_list_unique(sub_links) |
|
|
|
|
target_link_libraries(${the_module} ${sub_links}) |
|
|
|
|
target_link_libraries(${the_module} LINK_PRIVATE ${cuda_objs}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
unset(sub_objs) |
|
|
|
|
unset(sub_links) |
|
|
|
|
unset(cuda_objs) |
|
|
|
|
|
|
|
|
|
set_target_properties(${the_module} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module") |
|
|
|
|
set_source_files_properties(${OPENCV_MODULE_${the_module}_HEADERS} ${OPENCV_MODULE_${the_module}_SOURCES} ${${the_module}_pch} |
|
|
|
|
PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Module") |
|
|
|
|
|
|
|
|
|
if(NOT BUILD_SHARED_LIBS OR NOT INSTALL_CREATE_DISTRIB) |
|
|
|
|
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) |
|
|
|
|
ocv_target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN}) |
|
|
|
|
if (HAVE_CUDA) |
|
|
|
|
ocv_target_link_libraries(${the_module} ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
else() |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN}) |
|
|
|
|
if (HAVE_CUDA) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PUBLIC ${OPENCV_MODULE_${the_module}_DEPS_TO_LINK}) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PUBLIC ${OPENCV_MODULE_${the_module}_DEPS_EXT}) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${OPENCV_LINKER_LIBS} ${OPENCV_HAL_LINKER_LIBS} ${IPP_LIBS} ${ARGN}) |
|
|
|
|
if (HAVE_CUDA) |
|
|
|
|
ocv_target_link_libraries(${the_module} LINK_PRIVATE ${CUDA_LIBRARIES} ${CUDA_npp_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
add_dependencies(opencv_modules ${the_module}) |
|
|
|
@ -1074,7 +1054,7 @@ function(ocv_add_perf_tests) |
|
|
|
|
source_group("Src" FILES "${${the_target}_pch}") |
|
|
|
|
ocv_add_executable(${the_target} ${OPENCV_PERF_${the_module}_SOURCES} ${${the_target}_pch}) |
|
|
|
|
ocv_target_include_modules(${the_target} ${perf_deps} "${perf_path}") |
|
|
|
|
ocv_target_link_libraries(${the_target} ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) |
|
|
|
|
ocv_target_link_libraries(${the_target} LINK_PRIVATE ${perf_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) |
|
|
|
|
add_dependencies(opencv_perf_tests ${the_target}) |
|
|
|
|
|
|
|
|
|
set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};PerfTest") |
|
|
|
@ -1151,7 +1131,7 @@ function(ocv_add_accuracy_tests) |
|
|
|
|
source_group("Src" FILES "${${the_target}_pch}") |
|
|
|
|
ocv_add_executable(${the_target} ${OPENCV_TEST_${the_module}_SOURCES} ${${the_target}_pch}) |
|
|
|
|
ocv_target_include_modules(${the_target} ${test_deps} "${test_path}") |
|
|
|
|
ocv_target_link_libraries(${the_target} ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) |
|
|
|
|
ocv_target_link_libraries(${the_target} LINK_PRIVATE ${test_deps} ${OPENCV_MODULE_${the_module}_DEPS} ${OPENCV_LINKER_LIBS}) |
|
|
|
|
add_dependencies(opencv_tests ${the_target}) |
|
|
|
|
|
|
|
|
|
set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};AccuracyTest") |
|
|
|
@ -1208,7 +1188,7 @@ function(ocv_add_samples) |
|
|
|
|
|
|
|
|
|
ocv_add_executable(${the_target} "${source}") |
|
|
|
|
ocv_target_include_modules(${the_target} ${samples_deps}) |
|
|
|
|
ocv_target_link_libraries(${the_target} ${samples_deps}) |
|
|
|
|
ocv_target_link_libraries(${the_target} LINK_PRIVATE ${samples_deps}) |
|
|
|
|
set_target_properties(${the_target} PROPERTIES PROJECT_LABEL "(sample) ${name}") |
|
|
|
|
|
|
|
|
|
set_target_properties(${the_target} PROPERTIES LABELS "${OPENCV_MODULE_${the_module}_LABEL};Sample") |
|
|
|
|