Ask Your Question

How to find_package of a external ros-wrapped library (g2o)

asked 2013-02-25 22:29:00 -0500

Oier gravatar image

updated 2014-01-28 17:15:24 -0500

ngrennan gravatar image


I have written a ros-wrapper for g2o [0] and wish to do a find_package(G2O REQUIRED) and include_directories(${G2O_INCLUDE_DIRS}) in my packages CMakeLists.txt

The library includes a FindG2O.cmake file which I also copied to my projects CMakeModules folder(not sure where the file should be), but still the find_package does't work. So, how are you supposed to find_package of external libraries you have written a ros-wrapper for? I am using Ubuntu 12.04 and Fuerte.

Another question would be, if the external library you wrapped in ROS, doesn't have a Find.cmake file, do you have to write one yourself in order to use find_package?




edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2013-02-26 21:57:42 -0500

Oier gravatar image

I'll answer myself. You don't to write a FindFoo.cmake file nor use a find_package in you CMakeLists. The bug was, that my g2o wrapper didn't export the lflags correctly in it Manifest file. For my needs, it had to look like this:

<cpp cflags="-I${prefix}/include" lflags="-L${prefix}/lib -lg2o_stuff -lg2o_core -lg2o_solver_csparse -lg2o_csparse_extension"/>

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2013-02-25 22:29:00 -0500

Seen: 1,038 times

Last updated: Feb 26 '13