mirror of
https://github.com/opencv/opencv.git
synced 2025-08-06 14:36:36 +08:00
Merge pull request #18658 from JackBoosY:master
* Fix cmake configure error * judge the cmake version * Add comments
This commit is contained in:
parent
d9a62c42e5
commit
56d2b7137c
@ -12,8 +12,16 @@ function(ocv_add_external_target name inc link def)
|
||||
set_target_properties(ocv.3rdparty.${name} PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${inc}"
|
||||
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${inc}"
|
||||
INTERFACE_LINK_LIBRARIES "${link}"
|
||||
INTERFACE_COMPILE_DEFINITIONS "${def}")
|
||||
# When cmake version is greater than or equal to 3.11, INTERFACE_LINK_LIBRARIES no longer applies to interface library
|
||||
# See https://github.com/opencv/opencv/pull/18658
|
||||
if (CMAKE_VERSION VERSION_LESS 3.11)
|
||||
set_target_properties(ocv.3rdparty.${name} PROPERTIES
|
||||
INTERFACE_LINK_LIBRARIES "${link}")
|
||||
else()
|
||||
target_link_libraries(ocv.3rdparty.${name} INTERFACE ${link})
|
||||
endif()
|
||||
#
|
||||
if(NOT BUILD_SHARED_LIBS)
|
||||
install(TARGETS ocv.3rdparty.${name} EXPORT OpenCVModules)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user