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

Hello,

In this repo you will find some basic ROS 2 examples. For example you should have a look to this CMakeLists.txt.

You should find_package:

find_package(rclcpp REQUIRED)

And then if it's a ROS 2 dependency, you should link against it

ament_target_dependencies(<you target name> rclcpp )

If it's not a ROS 2 dependency, then you should use the CMake functions. Like target_link_libraries or target_include_directories.

Regards