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

Using catkin to install pre-made libraries

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

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:

+-- 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

install( FILES lib/ 

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:

    + 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

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

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 for an example.

edit flag offensive delete link more

Question Tools

1 follower


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

Seen: 536 times

Last updated: Apr 06 '16