Skip to content

Commit a7c1838

Browse files
committed
cmake(plugins): build without opencv_*.so on OSX
1 parent 54d80d9 commit a7c1838

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmake/OpenCVPluginStandalone.cmake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ function(ocv_create_plugin module default_name dependency_target dependency_targ
7878
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES PREFIX "${OPENCV_PLUGIN_MODULE_PREFIX}")
7979
endif()
8080

81-
# Hack for Windows only, Linux/MacOS uses global symbol table (without exact .so binding)
82-
if(WIN32)
81+
if(APPLE)
82+
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
83+
elseif(WIN32)
84+
# Hack for Windows only, Linux/MacOS uses global symbol table (without exact .so binding)
8385
find_package(OpenCV REQUIRED ${module} ${OPENCV_PLUGIN_DEPS})
8486
target_link_libraries(${OPENCV_PLUGIN_NAME} PRIVATE ${OpenCV_LIBRARIES})
8587
endif()

0 commit comments

Comments
 (0)