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

Location of non-exported header files?

asked 2014-02-20 15:50:35 -0500

updated 2016-10-24 09:00:42 -0500

ngrennan gravatar image

For a package which is only building a binary and not exporting libraries, should the headers still go in include/pkgname, or can/should they then go in src? The Packages page says:

include/package_name: C++ include headers (make sure to export in the CMakeLists.txt)

My um6 sensor driver has them split, while rosserial_server has them all together.

In both cases, there are templated classes in the headers, which means they contain a lot of actual function bodies. Should these headers be exported anyway, despite that they're not intended to be an API? Which approach is best?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-02-20 20:54:12 -0500

tfoote gravatar image

It's best to keep the headers in the include directory so that you always look in the same place. Just don't make the installation rule for the headers and don't add the include dir to the catkin_package call so they aren't exported. If things are not expected to be an API they shouldn't be exposed if possible.

edit flag offensive delete link more

Comments

Cool, sounds good. I'll reorganize rosserial_server when I get a chance.

mikepurvis gravatar image mikepurvis  ( 2014-02-21 02:14:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-02-20 15:50:35 -0500

Seen: 328 times

Last updated: Feb 20 '14