fix(cmake): register package via ament_package() in ROS 2 builds#19
Conversation
The ament branch sets COMPILING_WITH_AMENT, finds ament_cmake/plotjuggler, and installs the .so, but never calls ament_package(). Without it, colcon doesn't emit local_setup.bash and the package never lands on AMENT_PREFIX_PATH after sourcing install/setup.bash. The catkin branch already calls catkin_package() on line 52; this restores parity.
|
The pattern looks familiar, although I don't know the ament workings by heart. |
|
Yes — built and sourced locally on a colcon workspace. Before the patch, Sourcing |
I do wonder though: You need to compile PlotJuggler first, in order to compile this AP plugin. What you're describing is fixing a dependency that goes the other way, no? If I read your linked PJ PR, what you're trying to do is to auto-discover plugins, so this is a runtime dependency, correct? |
|
Right on both counts:
It's really packaging hygiene that's independent of #1374 though — without |
Summary
Call
ament_package()at the end of the ament-cmake branch so the package registers itself onAMENT_PREFIX_PATHwhen sourcing the colcon workspace'sinstall/setup.bash.Problem
The ament branch sets
COMPILING_WITH_AMENT, findsament_cmake/plotjuggler, and installs the.so, but never callsament_package(). Without it, colcon doesn't emitlocal_setup.bashand the package never lands onAMENT_PREFIX_PATH. Downstream tools that walkAMENT_PREFIX_PATHto discover plugins (e.g. PlotJuggler #1374) can't find the.soeven though it's installed. The catkin branch already callscatkin_package()on line 52; this restores parity.Solution
Add
ament_package()after the install rule, gated onCOMPILING_WITH_AMENTso it's a no-op for catkin and bare-cmake builds.Sponsored by ARK Electronics