ROSEnv

The ROSEnv generator is an environment generator that, in conjuction with CMakeDeps and CMakeToolchain, allows to consume Conan packages from a ROS package.

conanfile.txt
[requires]
fmt/11.0.2

[generators]
CMakeDeps
CMakeToolchain
ROSEnv

This generator will create a conanrosenv.sh script with the required environment variables that allow CMake and Colcon to locate the pacckages installed by Conan.

This script needs to be sourced before the colcon build command:

$ cd workspace
$ conan install ...
$ source conanrosenv.sh
$ colcon build

Reference

class ROSEnv(conanfile)

Generator to serve as integration for Robot Operating System 2 development workspaces. It generates a conanrosenv.sh file that when sources sets variables so the Conan dependencies are found by CMake and the run environment is also set.

IMPORTANT: This generator should be used together with CMakeDeps and CMakeToolchain generators.