Skip to content

Commit d8016ae

Browse files
Use common convention for EXPORT name (ros2#1797) (ros2#1888)
As @JafarAbdi pointed out in [this PR](moveit/srdfdom#96 (comment)) the _exports suffix is non-standard. `Targets` or `-targets` is used by gtest, fmt, and nlohmann_json. I copied the _exports suffix into the moveit2 repo and now regret it. It would be nice to use common conventions here so others don't make the same mistake. (cherry picked from commit 1c5fc42) Co-authored-by: Tyler Weaver <[email protected]>
1 parent 6be25e0 commit d8016ae

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/Guides/Ament-CMake-Documentation.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ When building a reusable library, some information needs to be exported for down
131131

132132
.. code-block:: cmake
133133
134-
ament_export_targets(export_my_library HAS_LIBRARY_TARGET)
134+
ament_export_targets(my_libraryTargets HAS_LIBRARY_TARGET)
135135
ament_export_dependencies(some_dependency)
136136
137137
install(
@@ -141,7 +141,7 @@ When building a reusable library, some information needs to be exported for down
141141
142142
install(
143143
TARGETS my_library
144-
EXPORT export_my_library
144+
EXPORT my_libraryTargets
145145
LIBRARY DESTINATION lib
146146
ARCHIVE DESTINATION lib
147147
RUNTIME DESTINATION bin
@@ -183,7 +183,7 @@ Here is what's happening in the snippet above:
183183
It installs the CMake files for the ``my_library`` target.
184184
It is named exactly like the argument in ``ament_export_targets`` and could be named like the library.
185185
However, this will then prohibit using the ``ament_target_dependencies`` way of including your library.
186-
To allow for full flexibility, it is advised to prepend the export target with something like ``export_<target>``.
186+
To allow for full flexibility, it is advised to prepend the export target with something like ``<target>Targets``.
187187

188188
- All install paths are relative to ``CMAKE_INSTALL_PREFIX``, which is already set correctly by colcon/ament
189189

0 commit comments

Comments
 (0)