[opencv] 18/19: export simple libs from OPENCV_LINKER_LIBS (fix #5541)
Mattia Rizzolo
mattia at debian.org
Tue Oct 4 17:51:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
mattia pushed a commit to annotated tag 2.4.12.3
in repository opencv.
commit 60eda6f25c93b37f620b9e12d7a95d753d30ef46
Author: Alexander Alekhin <alexander.alekhin at itseez.com>
Date: Mon Oct 19 13:36:44 2015 +0300
export simple libs from OPENCV_LINKER_LIBS (fix #5541)
(cherry picked from commit 937a096bf10bedd2d10803f67716393f9065abe8)
---
cmake/OpenCVModule.cmake | 5 ++++-
cmake/OpenCVUtils.cmake | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/cmake/OpenCVModule.cmake b/cmake/OpenCVModule.cmake
index cae2a39..88ebe54 100644
--- a/cmake/OpenCVModule.cmake
+++ b/cmake/OpenCVModule.cmake
@@ -576,7 +576,10 @@ macro(ocv_create_module)
if(NOT "${ARGN}" STREQUAL "SKIP_LINK")
target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS})
target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${OPENCV_MODULE_${the_module}_DEPS})
- target_link_libraries(${the_module} ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
+ set(extra_deps ${OPENCV_MODULE_${the_module}_DEPS_EXT} ${OPENCV_LINKER_LIBS} ${IPP_LIBS} ${ARGN})
+ ocv_extract_simple_libs(extra_deps _simple_deps _other_deps)
+ target_link_libraries(${the_module} LINK_INTERFACE_LIBRARIES ${_simple_deps}) # this list goes to "export"
+ target_link_libraries(${the_module} ${extra_deps})
endif()
add_dependencies(opencv_modules ${the_module})
diff --git a/cmake/OpenCVUtils.cmake b/cmake/OpenCVUtils.cmake
index c23ddcc..0692b76 100644
--- a/cmake/OpenCVUtils.cmake
+++ b/cmake/OpenCVUtils.cmake
@@ -630,3 +630,21 @@ function(ocv_source_group group)
file(GLOB srcs ${OCV_SOURCE_GROUP_GLOB})
source_group(${group} FILES ${srcs})
endfunction()
+
+# build the list of simple dependencies, that links via "-l"
+# _all_libs - name of variable with input list
+# _simple - name of variable with output list of simple libs
+# _other - name of variable with _all_libs - _simple
+macro(ocv_extract_simple_libs _all_libs _simple _other)
+ set(${_simple} "")
+ set(${_other} "")
+ foreach(_l ${${_all_libs}})
+ if(TARGET ${_l})
+ list(APPEND ${_other} ${_l})
+ elseif(EXISTS "${_l}")
+ list(APPEND ${_other} ${_l})
+ else()
+ list(APPEND ${_simple} ${_l})
+ endif()
+ endforeach()
+endmacro()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list