1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #23963 from opencv-pushbot:gitee/alalek/fixup_23842

This commit is contained in:
Alexander Alekhin
2023-07-11 12:17:39 +00:00
+7 -1
View File
@@ -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()