Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export library path for library interfaces #135

Merged
merged 2 commits into from May 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -19,6 +19,9 @@
# ``install(TARGETS ... EXPORT name ...)``.
# The ``install(EXPORT ...)`` invocation is handled by this macros.
#
# :param HAS_LIBRARY_TARGET: if set, an environment variable will be defined
# so that the library can be found at runtime
# :type HAS_LIBRARY_TARGET: option
# :param ARGN: a list of export names
# :type ARGN: list of strings
#
Expand All @@ -29,11 +32,19 @@ macro(ament_export_interfaces)
message(FATAL_ERROR
"ament_export_interfaces() must be called before ament_package()")
endif()
cmake_parse_arguments(_ARG "HAS_LIBRARY_TARGET" "" "" ${ARGN})

if(${ARGC} GREATER 0)
_ament_cmake_export_interfaces_register_package_hook()
foreach(_arg ${ARGN})
foreach(_arg ${_ARG_UNPARSED_ARGUMENTS})
list(APPEND _AMENT_CMAKE_EXPORT_INTERFACES "${_arg}")
endforeach()

# if the export name contains is a library target
# make sure to register an environment hook
if(${_ARG_HAS_LIBRARY_TARGET})
find_package(ament_cmake_export_libraries QUIET REQUIRED)
_ament_cmake_export_libraries_register_environment_hook()
endif()
endif()
endmacro()
1 change: 1 addition & 0 deletions ament_cmake_export_interfaces/package.xml
Expand Up @@ -10,6 +10,7 @@
<buildtool_depend>ament_cmake_core</buildtool_depend>

<buildtool_export_depend>ament_cmake_core</buildtool_export_depend>
<buildtool_export_depend>ament_cmake_export_libraries</buildtool_export_depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down