Skip to content

Commit

Permalink
Do not use target_include_directories with CMake 2.8.11.
Browse files Browse the repository at this point in the history
This addresses warnings like:

CMake Error in contrib/prip/vdtop/CMakeLists.txt:
  Target "vdtop" INTERFACE_INCLUDE_DIRECTORIES property contains relative
  path:

    "include/vxl/contrib/prip/vdtop"

CMake Error in contrib/prip/vpyr/CMakeLists.txt:
  Target "vpyr" INTERFACE_INCLUDE_DIRECTORIES property contains relative
  path:

    "include/vxl/contrib/prip/vpyr"

Although current target_include_directories documentation recommends using a
relative path for the install interface.  The warning is not present with
CMake 2.8.12.
  • Loading branch information
thewtex committed Mar 23, 2016
1 parent f94d7a6 commit d7d6314
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/cmake/config/vxl_utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ macro( vxl_add_library )
## Identify the relative path for installing the header files and txx files
string(REPLACE ${VXL_ROOT_SOURCE_DIR} "${VXL_INSTALL_INCLUDE_DIR}" relative_install_path ${CMAKE_CURRENT_SOURCE_DIR})
## Added in 2.8.11 http://stackoverflow.com/questions/19460707/how-to-set-include-directories-from-a-cmakelists-txt-file
if(${CMAKE_VERSION} VERSION_GREATER 2.8.10)
if(${CMAKE_VERSION} VERSION_GREATER 2.8.11)
target_include_directories(${lib_name}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand All @@ -126,7 +126,7 @@ macro( vxl_add_library )
set(relative_install_path "${relative_install_path}/${header_install_dir}")
endif()
## Added in 2.8.11 http://stackoverflow.com/questions/19460707/how-to-set-include-directories-from-a-cmakelists-txt-file
if(${CMAKE_VERSION} VERSION_GREATER 2.8.10)
if(${CMAKE_VERSION} VERSION_GREATER 2.8.11)
target_include_directories(${lib_name}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand Down

0 comments on commit d7d6314

Please sign in to comment.