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

How to handle OS Dependant manifest.xml ?

asked 2011-11-08 02:03:55 -0600

Willy Lambert gravatar image

Hi all,

I am working with a double gnulinux/xenomai system. The switch from one to the other is done like Orocos does with the "OROCOS_TARGET" env variable. But When I have a package depending of another, I need to define 2 different manifest, for exemple :

    <cpp cflags="-L${prefix}/lib -larp_core-gnulinux"/>


    <cpp cflags="-L${prefix}/lib -larp_core-xenomai"/>

How could I handle this ?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-11-08 05:50:04 -0600

joq gravatar image

You can restrict a specific set of flags using the os parameter of the <cpp> tag, like this:

<cpp os="osx" cflags="-I${prefix}/include" lflags="-L${prefix}/lib -Wl,-rpath,${prefix}/lib -lrosthread -framework CoreServices"/>

For more details, see the Manifest XML tags reference.

edit flag offensive delete link more


thans for this usefull link. I tagged it preferred because it is the ROS way. But I'll be use the orocos one as my package is an orocos one :)
Willy Lambert gravatar image Willy Lambert  ( 2011-11-08 18:13:29 -0600 )edit

do you know how ROS detects the current OS ? more precisely, how does he knows between gnulinux and xenomai the one to choose ?

Willy Lambert gravatar image Willy Lambert  ( 2012-04-16 02:30:39 -0600 )edit

answered 2011-11-08 07:00:44 -0600

psoetens gravatar image

Orocos has a special mechanism such that you don't have to put any <export> statement in the manifest.xml file, but can use a generated pkg-config file instead.

In your CMakeLists.txt file:

orocos_library( arp_core apr_core.cpp )
orocos_generate_package() # last line in your CMakeLists.txt file

it will generate a .pc file alongside your manifest.xml file with the correct -L and -l flags.

This .pc file will be automatically used by depending on the arp_core package, as usual in another manifest.xml file:

<depend package="arp_core" />

For the documentation of CMake macros, see the Orocos Toolchain CMake wiki

edit flag offensive delete link more


oh yes, this orocos_generate_package is not in all my packages (including arp_core). This must happened when migrating from different orocos versions.
Willy Lambert gravatar image Willy Lambert  ( 2011-11-08 18:15:54 -0600 )edit

Question Tools


Asked: 2011-11-08 02:03:55 -0600

Seen: 333 times

Last updated: Nov 08 '11