ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The build tool is not a valid criteria for concluding if a build is for ROS 1 or ROS 2 (e.g. you can use colcon to build a ROS 1 workspace).

Generally it is not a workflow we recommend - to keep ROS 1 and ROS 2 packages on the same branch - so it will likely not be supported in all cases.

You could check the ROS_VERSION environment variable and make a decision about "skipping" a package in it's CMake logic. But as I said that is more like a hack and you might run into problems going down that path.