mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 22:44:02 +08:00
cmake: don't export external target twice
This commit is contained in:
parent
bb61cc0dba
commit
f89b705049
@ -1632,13 +1632,19 @@ function(ocv_add_external_target name inc link def)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
set(__OPENCV_EXPORTED_EXTERNAL_TARGETS "" CACHE INTERNAL "")
|
||||
function(ocv_install_used_external_targets)
|
||||
if(NOT BUILD_SHARED_LIBS
|
||||
AND NOT (CMAKE_VERSION VERSION_LESS "3.13.0") # upgrade CMake: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/2152
|
||||
)
|
||||
foreach(tgt in ${ARGN})
|
||||
if(tgt MATCHES "^ocv\.3rdparty\.")
|
||||
install(TARGETS ${tgt} EXPORT OpenCVModules)
|
||||
list(FIND __OPENCV_EXPORTED_EXTERNAL_TARGETS "${tgt}" _found)
|
||||
if(_found EQUAL -1) # don't export target twice
|
||||
install(TARGETS ${tgt} EXPORT OpenCVModules)
|
||||
list(APPEND __OPENCV_EXPORTED_EXTERNAL_TARGETS "${tgt}")
|
||||
set(__OPENCV_EXPORTED_EXTERNAL_TARGETS "${__OPENCV_EXPORTED_EXTERNAL_TARGETS}" CACHE INTERNAL "")
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user