Skip to content

Commit 07c2920

Browse files
authored
Skip rosidl_generate_interfaces dependency export on SKIP_INSTALL. (#708)
* Skip rosidl_generate_interfaces dependency export on SKIP_INSTALL. When a dependency is declared in rosidl_generate_interfaces(), ament_export_dependencies() for that dependency is automatically called. That is the correct default behavior, but it isn't always the behavior that is wanted. In particular, if a package has messages that are only used for tests, we don't want to export those dependencies downstream. If SKIP_INSTALL is specified, skip exporting the dependencies downstream. Signed-off-by: Chris Lalancette <[email protected]>
1 parent 9348ce9 commit 07c2920

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

rosidl_cmake/cmake/rosidl_generate_interfaces.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
# :type LIBRARY_NAME: string
4242
# :param SKIP_INSTALL: if set skip installing the interface files
4343
# :type SKIP_INSTALL: option
44-
# :param SKIP_GROUP_MEMBERSHIP_CHECK: if set, skip enforcing the appartenance
45-
# to the rosidl_interface_packages group
44+
# :param SKIP_GROUP_MEMBERSHIP_CHECK: if set, skip enforcing membership in the
45+
# rosidl_interface_packages group
4646
# :type SKIP_GROUP_MEMBERSHIP_CHECK: option
4747
# :param ADD_LINTER_TESTS: if set lint the interface files using
4848
# the ``ament_lint`` package
@@ -66,7 +66,9 @@ macro(rosidl_generate_interfaces target)
6666
endif()
6767

6868
_rosidl_cmake_register_package_hook()
69-
ament_export_dependencies(${_ARG_DEPENDENCIES})
69+
if(NOT _ARG_SKIP_INSTALL)
70+
ament_export_dependencies(${_ARG_DEPENDENCIES})
71+
endif()
7072

7173
# check that passed interface files exist
7274
# a tuple with an absolute base and a relative path is returned as is

0 commit comments

Comments
 (0)