ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to put headers into devel/include folder with catkin_make?

asked 2014-04-08 06:17:14 -0500

Mike Charikov gravatar image

Have a lib in my package and want to share its header.

According to "how-to" I use this command:

install(DIRECTORY include/${PROJECT_NAME}/

But after "catkin_make" command no headers are in devel/include folder. (Lib itself successfully appears in /devel/lib folder)

When I run "catkin_make install" command headers appear in install/include folder properly.

What am i doing wrong?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2014-04-08 07:00:43 -0500

Dirk Thomas gravatar image

That is fine as it is. The headers don't need to be copied from you package source folder to the devel/include folder. Just make sure that you export the include folder in your CMake file using:

catkin_package(INCLUDE_DIRS include)

And if you use your own headers add the folder to the include directories using:


Then any downstream package will find you package headers when adding the include directories with:

find_package(catkin REQUIRED COMPONENTS your_package)
edit flag offensive delete link more


Thanks. That's was my folly: missed that find_package thing.

Mike Charikov gravatar image Mike Charikov  ( 2014-04-08 20:43:55 -0500 )edit

This works fine for building, but some IDEs won't be able to find the include directory, as this method doesn't add it to the CPATH variable. The devel/include directory *does* get added to the CPATH variable, though, so generated messages can be found by the IDE, but not the package's own headers.

Tom Moore gravatar image Tom Moore  ( 2014-04-29 11:22:33 -0500 )edit

Is there a way of getting your headers into the devel/include folder? Other than installing them there. In my case, it's for an external project that needs to find things in a standard place.

Nap gravatar image Nap  ( 2014-11-07 08:23:24 -0500 )edit

Question Tools

1 follower


Asked: 2014-04-08 06:17:14 -0500

Seen: 5,888 times

Last updated: Apr 08 '14