ROSEnv
The ROSEnv generator is an environment generator that, in conjunction 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 packages 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.
IMPORTANT: This generator should be used together with CMakeDeps and CMakeToolchain generators.
- 參數:
conanfile –
< ConanFile object >目前的配方物件。一律使用self。
- generate()
Creates a
conanrosenv.shwith the environment variables that are needed to build and execute ROS packages with Conan dependencies.