[Ros-release] Exporting headers of non-catkin package depend…

Top Page
Attachments:
Message as email
+ (text/plain)
+ (text/html)
Delete this message
Reply to this message
Author: Daniel Stonier
Date:  
To: ros-release
Subject: [Ros-release] Exporting headers of non-catkin package dependencies
Hi all,

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

*Problem*
*
*
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.

*Solution*
*
*
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.

*Issues*
*
*
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).

Cheers,
Daniel.