Commit 80bd67c3 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #4125 from ruslo:interface.include.dirs

parents 7bfd0708 f30bf39b
......@@ -7,7 +7,7 @@
# In your CMakeLists.txt, add these lines:
#
# find_package(OpenCV REQUIRED)
# include_directories(${OpenCV_INCLUDE_DIRS})
# include_directories(${OpenCV_INCLUDE_DIRS}) # Not needed for CMake >= 2.8.11
# target_link_libraries(MY_TARGET_NAME ${OpenCV_LIBS})
#
# Or you can search for specific OpenCV modules:
......@@ -177,6 +177,20 @@ if(OpenCV2_INCLUDE_DIRS)
endif()
endif()
if(NOT CMAKE_VERSION VERSION_LESS "2.8.11")
# Target property INTERFACE_INCLUDE_DIRECTORIES available since 2.8.11:
# * http://www.cmake.org/cmake/help/v2.8.11/cmake.html#prop_tgt:INTERFACE_INCLUDE_DIRECTORIES
foreach(__component ${OpenCV_LIB_COMPONENTS})
if(TARGET ${__component})
set_target_properties(
${__component}
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OpenCV_INCLUDE_DIRS}"
)
endif()
endforeach()
endif()
# ==============================================================
# Check OpenCV availability
# ==============================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment