Skip to content

Extending the rock cmake macro "rock_library" to create and install a -config.cmake file #69

@bkocev

Description

@bkocev

Hi everyone,

the motivation for this feature request is to allow porting existing Rock C++ libraries to ROS.

The initiative started together with the need to port https://github.com/rock-slam/slam-uwv_kalman_filters to a ROS catkin workspace. Despite the facts that slam-uwv_kalman_filters seems to be a plain C++ library and should be possible to port it to a ROS catkin workspace and that @saarnold removed the base types (including base-lib and base-logging) dependencies of this libary, I managed only, after adding a few package.xml files, to build it in a ROS catkin workspace successfully but it is not possible to include headers (e.g., uwv_kalman_filters/PoseUKF.hpp) of this library in a ROS node, for example.

@planthaber pointed out that Rock is using pgkconfig to find packages, while catkin uses cmake itself. In this regard, he suggested that the best option would be to extend the rock cmake macro "rock_library", defined in https://github.com/rock-core/base-cmake/blob/master/modules/Rock.cmake, to create and install a -config.cmake file. On a side note, he said that it might be required to make this optional by using a cmake flag (e.g., set(ROCK_CREATE_CMAKE_CONFIG ON)). Regarding possible conflicts between cmake configs and package configs, @2maz pointed out to just make sure that using CMake and using pkg-config provides the same information / flags.

In my understanding, if we extend the rock cmake macro "rock_library" then we would have a solution for porting any library (initially intended for Rock) to ROS right? I.e., for example "find_package(uwv_kalman_filters REQUIRED)" should work in in any ROS node CMakeLists.txt right? But then, I am confused why it was necessary @saarnold to remove the base types dependencies, i.e., aren't these base types part of another plain C++ library that would be automatically ported to ROS after extending the cmake macro "rock_library"?

Any hints on how to properly extend the rock cmake macro "rock_library" and whether that would be sufficient for porting any initially intended for Rock C++ library (e.g., https://github.com/rock-slam/slam-uwv_kalman_filters) to ROS would be very much welcome and appreciated.

Thank you in advance and kind regards,
Bojan Kocev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions