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

How to specify library flags for a catkin package

asked 2013-01-25 17:40:32 -0600

arebgun gravatar image

I am trying to migrate one of my rosbuild packages to catkin. I am trying to specify the CFLags and LFlags that used to be hardcoded in the manifest.xml, but have to be specified in catkin_package cmake macro.

As far as I understand it, the default Lflags are set to {PROJECT_NAME}/lib, how would I go about changing this to, say, {PROJECT_NAME}/lib64?

I know I can specify an include directory which works fine and I can specify which libraries to link against, but how do I specify where to look for those libraries, i.e. the path after the -L flag?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2013-02-05 09:07:08 -0600

WilliamWoodall gravatar image

Rather than explicitly exposing the CFLAGS directly, you should use catkin_package() to export from within CMake any libraries or headers to packages which depend on you.

Can you post a link to your package or put your old manifest/CMakeLists.txt up on a gist.github.com? With some more specifics I can show you exactly how this would work.

edit flag offensive delete link more

Comments

@WilliamWoodall: basically, I am trying to write a wrapper package that downloads 3rd party code and builds it, like we used to be able to from plain Makefiles with the help of download/unpack/patch/build scripts. Not sure if it possible or recommended with catkin.

arebgun gravatar image arebgun  ( 2013-02-05 11:59:17 -0600 )edit

I have a CMake equivalent to the old Makefile but I have trouble combining my current CMakelists contents with catkin stuff. Package in question is here: https://github.com/arebgun/dynamixel_motor_experimental/tree/master/gearbox.

arebgun gravatar image arebgun  ( 2013-02-05 12:01:37 -0600 )edit

@arebgun That is not recommended with catkin anymore. You can continue to use rosbuild to accomplish this, but if you intend to release this package or depend on it with other catkin packages, then you'll need to follow our forthcoming 3rd-party recommendation. (recommendation will be a REP soon)

WilliamWoodall gravatar image WilliamWoodall  ( 2013-02-05 12:07:37 -0600 )edit

Yes, I wanted to release the package and have the ability for other catkin packages to depend on it. Will wait for the REP to be published. Thanks!

arebgun gravatar image arebgun  ( 2013-02-05 12:10:30 -0600 )edit

Did anything come of this arebgun? I'm trying to fix gearbox linking for dynamixel_motor_experiemental as well, but my only hack is to use: sudo ln -s /home/dave/ros/ws_clam/devel/lib/libflexiport.so /usr/lib/libflexiport.so

Dave Coleman gravatar image Dave Coleman  ( 2014-06-08 23:44:31 -0600 )edit
0

answered 2014-06-08 23:57:21 -0600

Dave Coleman gravatar image

This is kind of an answer, and kind of a question. I have the project that arebgun is asking about already catkinized: https://github.com/arebgun/dynamixel_...

I just need help avoiding: sudo ln -s /home/dave/ros/ws_clam/devel/lib/libflexiport.so /usr/lib/libflexiport.so

Thanks so much!

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-01-25 17:40:32 -0600

Seen: 1,576 times

Last updated: Jun 08 '14