Skip to content

Commit

Permalink
Merge pull request #15 from ament/fix_message_dependencies
Browse files Browse the repository at this point in the history
export direct and recursive package dependencies
  • Loading branch information
dirk-thomas committed Jul 23, 2015
2 parents 0e79453 + d0aac4b commit 9f0b3ae
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ set(_exported_dependencies "@_AMENT_CMAKE_EXPORT_DEPENDENCIES@")
# find_package() all dependencies
# and append their DEFINITIONS INCLUDE_DIRS and LIBRARIES variables
# to @PROJECT_NAME@_DEFINITIONS , @PROJECT_NAME@_INCLUDE_DIRS and
# @PROJECT_NAME@_LIBRARIES
# @PROJECT_NAME@_LIBRARIES.
# Additionally collect the direct dependency names in
# @PROJECT_NAME@_DEPENDENCIES as well as the recursive dependency names
# in @PROJECT_NAME@_RECURSIVE_DEPENDENCIES.
if(NOT "${_exported_dependencies} " STREQUAL " ")
find_package(ament_cmake_core QUIET REQUIRED)
set(@PROJECT_NAME@_DEPENDENCIES ${_exported_dependencies})
set(@PROJECT_NAME@_RECURSIVE_DEPENDENCIES ${_exported_dependencies})
foreach(_dep ${_exported_dependencies})
if(NOT ${_dep}_FOUND)
find_package("${_dep}" QUIET REQUIRED)
Expand All @@ -20,5 +26,8 @@ if(NOT "${_exported_dependencies} " STREQUAL " ")
if(${_dep}_LIBRARIES)
list(APPEND @PROJECT_NAME@_LIBRARIES "${${_dep}_LIBRARIES}")
endif()
if(${_dep}_RECURSIVE_DEPENDENCIES)
list_append_unique(@PROJECT_NAME@_RECURSIVE_DEPENDENCIES "${${_dep}_RECURSIVE_DEPENDENCIES}")
endif()
endforeach()
endif()

0 comments on commit 9f0b3ae

Please sign in to comment.