Skip to content

Question about how to handle options from conan to CMake and from CMake to conan #721

Description

@strattist

I have a project that I want to be able to build and package with conan. In my conanfile.py I have made the work to have options passed to CMake using the CMakeToolchain generator. It works fine in a context where conan runs CMake.

I also want to be able to have the CMake runs conan for different reason, the most important being imo it'll ease adoption of conan and CMake is usually a more familiar tool. For that I would like to keep my predefined presets hence I'm disabling the CMakeToolchain.user_presets_path generation.

My question is about a case where my an option is shared accross the conanfile.py and CMake. I feel I have duplications where I need to map this option from conan to CMake and from CMake to conan (I haven't tries but I guess this is where CONAN_INSTALL_ARGS can be used in my case?). Do you guys have a tool that would mutualize options between conan and CMake?

Metadata

Metadata

Assignees

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