ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Each package is a separate CMake project. For each a separate CMake invocation is being used. So variables set in one are not available in the other.
The ament_cmake
function ament_package
has an argument CONFIG_EXTRAS
(see https://github.com/ament/ament_cmake/blob/2d65d41e047e203cd0531df9b0987d8aaea7d6ca/ament_cmake_core/cmake/core/ament_package.cmake#L24-L32). You can provide you own CMake file which will be included when other packages find your package with find_package()
.
You will find examples how to use the argument in various packages (e.g. in rclcpp).