Skip to content

Commit

Permalink
Merge pull request opencv#4125 from ruslo:interface.include.dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
alalek committed Jun 17, 2015
2 parents 7bfd070 + f30bf39 commit 80bd67c
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmake/templates/OpenCVConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
# ==============================================================
Expand Down

0 comments on commit 80bd67c

Please sign in to comment.