Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is more a generic CMake question than really ROS specific (ie: setting up your include path is not something that is any different whether you do it for a ROS node or for a non-ROS application / build target).

In the general case, in your CMakeLists.txt:


For a ROS package, you probably want the include sub directory of your package to be on the include path, so:

# note: this path is relative to the current CMakeLists.txt

If you have used find_package(catkin COMPONENTS ..), you probably want something like:

include_directories(include ${catkin_INCLUDE_DIRS})

The x_INCLUDE_DIRS (where x is a package name) is a general pattern: most CMake Find scripts will set these variables for you, but do check the documentation.

See How to do common tasks » Package format 2 (recommended) » C++ system library dependencies for some more info on resolving and using system dependencies with Catkin (but again, really: CMake).