From a7c1838c695b48ff5ac2fe8dd50f95360984f197 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Fri, 19 Feb 2021 16:23:33 +0000 Subject: [PATCH] cmake(plugins): build without opencv_*.so on OSX --- cmake/OpenCVPluginStandalone.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/OpenCVPluginStandalone.cmake b/cmake/OpenCVPluginStandalone.cmake index bf4569d..b83a2a8 100644 --- a/cmake/OpenCVPluginStandalone.cmake +++ b/cmake/OpenCVPluginStandalone.cmake @@ -78,8 +78,10 @@ function(ocv_create_plugin module default_name dependency_target dependency_targ set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES PREFIX "${OPENCV_PLUGIN_MODULE_PREFIX}") endif() - # Hack for Windows only, Linux/MacOS uses global symbol table (without exact .so binding) - if(WIN32) + if(APPLE) + set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup") + elseif(WIN32) + # Hack for Windows only, Linux/MacOS uses global symbol table (without exact .so binding) find_package(OpenCV REQUIRED ${module} ${OPENCV_PLUGIN_DEPS}) target_link_libraries(${OPENCV_PLUGIN_NAME} PRIVATE ${OpenCV_LIBRARIES}) endif() -- 2.7.4