Skip to content

Commit

Permalink
Merge pull request #600 from ros/allow_passing_absolute_include_dirs_…
Browse files Browse the repository at this point in the history
…into_install_space

allow passing absolute INCLUDE_DIRS via catkin_package() into CMake config file in install space
  • Loading branch information
dirk-thomas committed Feb 28, 2014
2 parents a98c55b + 811cc59 commit 0521bee
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions cmake/catkin_package.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ function(_catkin_package)
else()
message(FATAL_ERROR "catkin_package() include dir '${idir}' is neither an absolute directory nor exists relative to '${CMAKE_CURRENT_SOURCE_DIR}'")
endif()
list(APPEND PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${include})
list(APPEND PROJECT_PKG_CONFIG_INCLUDE_DIRS ${include})
list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${include})
list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS ${include})
endforeach()
if(PROJECT_DEPENDENCIES_INCLUDE_DIRS)
list(APPEND PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
list(APPEND PROJECT_PKG_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
endif()

# prepend library path of this workspace
Expand Down Expand Up @@ -390,13 +390,18 @@ function(_catkin_package)
# absolute path to include dir under install prefix if any include dir is set
set(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "")
set(PROJECT_PKG_CONFIG_INCLUDE_DIRS "")
if(NOT "${PROJECT_INCLUDE_DIRS}" STREQUAL "")
set(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "${CATKIN_GLOBAL_INCLUDE_DESTINATION}")
set(PROJECT_PKG_CONFIG_INCLUDE_DIRS "${PKG_INCLUDE_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}")
endif()
foreach(idir ${PROJECT_INCLUDE_DIRS})
if(IS_ABSOLUTE ${idir})
list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "${idir}")
list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS "${idir}")
else()
list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS "${CATKIN_GLOBAL_INCLUDE_DESTINATION}")
list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS "${PKG_INCLUDE_PREFIX}/${CATKIN_GLOBAL_INCLUDE_DESTINATION}")
endif()
endforeach()
if(PROJECT_DEPENDENCIES_INCLUDE_DIRS)
list(APPEND PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
list(APPEND PROJECT_PKG_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
list_append_unique(PROJECT_CMAKE_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
list_append_unique(PROJECT_PKG_CONFIG_INCLUDE_DIRS ${PROJECT_DEPENDENCIES_INCLUDE_DIRS})
endif()

# prepend library path of this workspace
Expand Down

0 comments on commit 0521bee

Please sign in to comment.