How to include external automake/autoconf projects into ament_cmake?

asked 2019-09-16 07:55:41 -0500

Hi guys,

I'm porting a package from ROS1 to ROS2 that builds and exposes a 3rd-party project to the ROS world. That external library uses automake and autoconf, and I do not want to change that to stay compatible with upstream provider of the lib. In the past, I used the cmake macro ExternalProject_Add to do this. Now, I am having trouble porting this functionality to ament_cmake.

My initial questions are: 1) What is the preferred way to build, install, and export 3rd-party non-cmake source projects for ament_cmake? 2) Has anybody successfully compiled, installed, and exported such an library using ExternalProject_Add?

I will refine my questions, once the issue has become clearer. ;)

For reference, this is the catkin CMakeLists that I want to port to ROS2: CMakeLists

edit retag flag offensive close merge delete

Comments

2

In the past, I used the cmake macro ExternalProject_Add to do this. Now, I am having trouble porting this functionality to ament_cmake.

I would actually expect this to still be the preferred way to do this in ROS 2 (as essentially 'nothing' has changed afaik).

At least on github.com/ros2, the *_vendor packages use ExternalProject_Add(..) quite a bit. See ros2/yaml_cpp_vendor/CMakeLists.txt for instance.

It would be good if you could describe the issues you encountered with ExternalProject_Add in your ROS 2 port.

gvdhoorn gravatar imagegvdhoorn ( 2019-09-16 08:31:05 -0500 )edit

@gvdhoorn Thank you for the fast response and the link to yamlccp. That looks great! I will provide a more detailed description of my issues. For the moment, we continued work by making our own debian for the upstream library, and installing that on the system.

Georg Bartels gravatar imageGeorg Bartels ( 2019-09-17 05:40:13 -0500 )edit
1

Another possible option would be to implement a colcon-automake/autoconf extension which invokes these tools directly. That would avoid the need to use CMake / ExternalProject. It would require more effort for the first package but any following packages would work out-of-the-box. Feel free to ask questions if you want to go that route. E.g. colcon-cmake is also just an extension to support CMake based packages in colcon.

Dirk Thomas gravatar imageDirk Thomas ( 2019-09-17 10:38:35 -0500 )edit