[Ros-release] Exporting headers of non-catkin package dependencies

Daniel Stonier d.stonier at gmail.com
Sat Nov 24 06:09:40 UTC 2012

Hi all,

I had to bang my head around this for a while today.

My catkin package foo depends on Eigen, which of course, has headers
installed in a non-standard location. I can do a find_package(Eigen) in foo
and foo is happy.

Next problem, my new catkin package bar depends on foo, so indirectly
requires those eigen headers. Now bar shouldn't have to do a
find-package(Eigen), so the question was how to get catkin to export that
eigen include directory.

I hunted around all the other core ros packages which depended on eigen,
but they didn't do anything special.

Finally, checking out the catkin_package.cmake code, there is a variable
DEPENDS (not CATKIN_DEPENDS) you can set that will export the appropriate
include directory without repeating the find_package lookup for a non-ros
package. That seems to be a nice solution.

Firstly, is this the right approach? If it is, it's probably a really key
point to document somewhere (if I missed it, enlighten me please).
Secondly, all those core ros packages probably do the same, otherwise
packages depending on them and subsequently Eigen indirectly will have to
do additional find_package(Eigen) calls for no reason.

This probably is important for other external dependencies like log4cxx as
well (though being in ubuntu's system include directory, the problem hides
until someone compiles or cross-compiles on a slightly non-standard
platform - windows being one).

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ros.org/pipermail/ros-release/attachments/20121124/648d1951/attachment-0008.html>

More information about the Ros-release mailing list