Ask Your Question
0

Using catkin to install pre-made libraries

asked 2016-04-06 10:15:24 -0500

badrobit gravatar image

I am looking to use catkin to hep package some libraries that a project needs. The idea was to have them structured in the following manner:

catkin_library
|
+-- lib (contains .so files )
+-- include ( contains header files )
+-- CMakeLists.txt (has catkin_package() and install() )
+-- package.xml ( list all dependencies )

I am able to get the header files installed thanks to an answer provided here: ROS Question the problem is that it cannot find the libraries I want to link against. Here is an example of a CMakeLists.txt that I am currently using:

cmake_minimum_required( VERSION 2.8.3 )

project( project_lib )

catkin_package( INCLUDE_DIRS include
                DEPENDS      ProjectLib )

install( DIRECTORY include
         DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} )

install( FILES lib/ProjectLib.so 
         DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} )

I am not sure how to get the catkin_make process to find and link against the libraries or if this is even a smart way of doing this. I want to provide a workspace that allows the user just to run catkin_make and have it build and install based on the the provided catkin_package and catkin library packages. The idea for how the workspace would look is like this:

project_ws 
    + devel
    + build
    + install
    + src
        + project                   (metapakcage)
        + project_exe               (catkin ros package)
        + project_msgs              ( ros msgs and services )
        + project_libraries         (metapackage)
            + project_libraries     (metapackage)
            + project_lib_1         ( external pre-built library )
            + project_lib_2         ( external pre-built library )
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-04-06 12:30:34 -0500

ahendrix gravatar image

Yes, it's possible but it's rather complicated, particularly if your package needs to support multiple architectures such as 32-bit Intel, 64-bit intel and ARM.

Have a look at https://github.com/ros-drivers/prosil... for an example.

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

Stats

Asked: 2016-04-06 10:15:24 -0500

Seen: 301 times

Last updated: Apr 06 '16