The carma_package(...) and carma_check_ros_version(...) CMake macros are a bit vague and don't clearly represent what they do.
carma_package(...): I assume this command was named after the ament_package(...) function, but the two do different tasks. ament_package(...) adds CMake install targets and other packaging configurations for the ROS 2 package. carma_pacakge(...), however, sets the C and C++ standards and add some compiler flags. The ament_package(...) function does what it's name implies---packages up the code for installation---but carma_package(...) does not. I suggest we rename this macro to carma_apply_common_package_configuration(...) or something similar.
carma_check_ros_version(...): This macro name is more indicative of its purpose than carma_package(...), but it is still unclear what happens after the check. Does some flag get raised? Does a warning get issued? I suggest renaming this macro to carma_assert_ros_version(...) or something similar, which would better indicate that the CMake configuration stops here if the assertion fails. This is similar to assert and static_asssert in C and C++.
Summary
The
carma_package(...)
andcarma_check_ros_version(...)
CMake macros are a bit vague and don't clearly represent what they do.carma_package(...)
: I assume this command was named after theament_package(...)
function, but the two do different tasks.ament_package(...)
adds CMake install targets and other packaging configurations for the ROS 2 package.carma_pacakge(...)
, however, sets the C and C++ standards and add some compiler flags. Theament_package(...)
function does what it's name implies---packages up the code for installation---butcarma_package(...)
does not. I suggest we rename this macro tocarma_apply_common_package_configuration(...)
or something similar.carma_check_ros_version(...)
: This macro name is more indicative of its purpose thancarma_package(...)
, but it is still unclear what happens after the check. Does some flag get raised? Does a warning get issued? I suggest renaming this macro tocarma_assert_ros_version(...)
or something similar, which would better indicate that the CMake configuration stops here if the assertion fails. This is similar toassert
andstatic_asssert
in C and C++.Reasoning for new functionality
See above.