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

How can I tell Colcon about another CMake-based framework?

asked 2019-08-31 13:07:24 -0600

rnvandemark gravatar image

I'm playing around with ros2arduino and want to have it be a part of the build process like any other node, so I'm trying to set up Arduino-CMake to work with the Colcon build process. Looking through the documentation, it looks like I have to use a colcon.pkg with something like this:

  "CMAKE_TOOLCHAIN_FILE": "/my/path/to/Arduino-CMake-Framework/Arduino-Toolchain.cmake"

because I want to pass an argument like -DCMAKE_TOOLCHAIN_FILE=/my/path/to/Development/Arduino-CMake-Framework/Arduino-Toolchain.cmake if I was simply calling the equivalent cmake command. But, there's no reference to the cmake variable CMAKE_TOOLCHAIN_FILE when I use this colcon.pkg setup. Unless I have to explicitly tell Colcon about the colcon.pkg? The documentation made it seem like it should detect its presence.

Thanks in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-09-01 11:25:08 -0600

Dirk Thomas gravatar image

Please see the colcon documentation about colcon.pkgfiles:

If you would pass the argument on the command line you would involve it with --cmake-args -DCMAKE_TOOLCHAIN_FILE=.... therefore your yaml file must look like this:

  "cmake-args": ["-DCMAKE_TOOLCHAIN_FILE=..."]
edit flag offensive delete link more


Since a toolchain file usually applies to multiple packages it is commonly passed on the command line though.

Dirk Thomas gravatar image Dirk Thomas  ( 2019-09-01 11:27:05 -0600 )edit

Question Tools

1 follower


Asked: 2019-08-31 13:04:45 -0600

Seen: 560 times

Last updated: Sep 01 '19