mirror of
https://github.com/opencv/opencv.git
synced 2024-11-24 03:00:14 +08:00
Option to enable/disable plugin linking with OpenCV
This commit is contained in:
parent
f4a7754cc0
commit
5f7d922b10
@ -78,10 +78,17 @@ function(ocv_create_plugin module default_name dependency_target dependency_targ
|
|||||||
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES PREFIX "${OPENCV_PLUGIN_MODULE_PREFIX}")
|
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES PREFIX "${OPENCV_PLUGIN_MODULE_PREFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(APPLE)
|
if(WIN32 OR NOT APPLE)
|
||||||
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
set(OPENCV_PLUGIN_NO_LINK FALSE CACHE BOOL "")
|
||||||
elseif(WIN32)
|
else()
|
||||||
# Hack for Windows only, Linux/MacOS uses global symbol table (without exact .so binding)
|
set(OPENCV_PLUGIN_NO_LINK TRUE CACHE BOOL "")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(OPENCV_PLUGIN_NO_LINK)
|
||||||
|
if(APPLE)
|
||||||
|
set_target_properties(${OPENCV_PLUGIN_NAME} PROPERTIES LINK_FLAGS "-undefined dynamic_lookup")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
find_package(OpenCV REQUIRED ${module} ${OPENCV_PLUGIN_DEPS})
|
find_package(OpenCV REQUIRED ${module} ${OPENCV_PLUGIN_DEPS})
|
||||||
target_link_libraries(${OPENCV_PLUGIN_NAME} PRIVATE ${OpenCV_LIBRARIES})
|
target_link_libraries(${OPENCV_PLUGIN_NAME} PRIVATE ${OpenCV_LIBRARIES})
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user