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

You can access the environment variable ROS_DISTRO directly in CMake:

$ENV{ROS_DISTRO}

Regarding the greater check: your approach makes assumptions about future releases which might not be true. Therefore I would suggest a more defensive approach comparing the distro name against a list of known names and inverting the logic.