the main role of ament_cmake
is to provide CMake macros that will make your job easier when developing multiple packages that depend on each other. None of it is required to build a CMake based ROS package.
An example of such macro is ament_target_dependencies
, it condenses the following cmake logic into a single call:
- target_compile_definitions()
- target_include_directories()
- target_link_libraries()
- setting link flags on the target
Another (the most?) important macro it provides is ament_package
.
This is what will handle the registration of your package in the ament index, generate the CMake config files for the project to be find_package'able, install the extra CMake config files you provide, install the package.xml of your package etc
You can find some information about ament_cmake
in the section "Build type: ament_cmake" of https://design.ros2.org/articles/amen...