conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
7.96k stars 952 forks source link

[question] How to access a value defined in the `[conf]` section of a profile? #16571

Closed PauloCarvalhoRJ closed 5 days ago

PauloCarvalhoRJ commented 5 days ago

Greetings,

I have a profile file with this content:

include(default)
[conf]
tools.cmake.cmake_layout:test_folder=C:\conan_tmp

How do I access that value from within a recipe? Extrapolating the rationale described here (https://docs.conan.io/2/reference/config_files/profiles.html), I tried self.conf.tools.cmake.cmake_layout['test_folder'] and I get this error: AttributeError: 'Conf' object has no attribute 'tools'. Apparently, Conan loads the [conf] section but I don't know how to access the setting declared in it.

thanks,

PC

Have you read the CONTRIBUTING guide?

PauloCarvalhoRJ commented 5 days ago

No longer needed....