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

Creating a ROS optional Library

asked 2011-03-13 09:58:08 -0600

William gravatar image

updated 2014-01-28 17:09:20 -0600

ngrennan gravatar image

I want to write a library (in this case a boost based cross platform serial C++ library) that when in a ROS environment is built with rosbuild and easily depended upon by other ROS packages, but in the event that ROS is not present the package will build using cmake and make only. The only thing I am looking for is a best practice for checking for ROS environment and tips for righting a graceful cmake file to accommodate this type of setup.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2012-02-11 18:34:34 -0600

tfoote gravatar image

With the new cmake/catkin based system coming out in fuerte you can use cmake's find_package and if package_FOUND variables to do this logic.

edit flag offensive delete link more

answered 2011-03-14 23:26:36 -0600

dornhege gravatar image

I guess the best way would be to make the library standalone and create an additional ros interface for it like mylib and mylib_ros.

I am not sure, but for the library's cmake file it might even be OK to use a plain (without ros_...) commands even in a ros package as you don't have an ros dependencies.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2011-03-13 09:58:08 -0600

Seen: 651 times

Last updated: Feb 11 '12