Skip to content

Commit

Permalink
Merge pull request opencv#18658 from JackBoosY:master
Browse files Browse the repository at this point in the history
* Fix cmake configure error

* judge the cmake version

* Add comments
  • Loading branch information
JackBoosY authored Oct 29, 2020
1 parent d9a62c4 commit 56d2b71
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion modules/videoio/cmake/init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 56d2b71

Please sign in to comment.