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

catkin lib variable for catkin_make and catkin_make_isolated

asked 2016-07-19 17:18:32 -0500

blueberry gravatar image

Hi, I have two catkin packages, one generating a library and the other makes use of it. In the cmake file of the dependent project, I have "link_directories( ${CATKIN_DEVEL_PREFIX}/lib/ )". This works fine with catkin_make, as the libxxx.so gets generated in devel/lib/. However when using catkin_make_isolated, the libxxx.so gets generated in devel_isolated/project_xxx/lib/ instead. And ${CATKIN_DEVEL_PREFIX} does not seem to dynamically substitute with the correct path according to the catkin command used. What cmake or catkin variable should I use for the link_directories to work in both cases?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-07-20 03:30:25 -0500

mgruhler gravatar image

You should not use link_directories at all.

In the package where you create the library:

  • export the library and the headers in the catkin_package call
  • install the library and the headers

in the package where you use it:

  • find_pacakge the pacakge above
  • use target_link_libraries(TARGET ${catkin_LIBRARIES}) andinclude_directores(${catkin_INCLUDE_DIRS})`
edit flag offensive delete link more

Comments

anonymous userAnonymous ( 2018-09-07 11:12:26 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-19 17:18:32 -0500

Seen: 212 times

Last updated: Jul 20 '16