-
Notifications
You must be signed in to change notification settings - Fork 996
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] CMakeToolchain now requires double configure to set cache variables #7832
Comments
Related to #7831. Does this mean that all variables set by the toolchain should be cache variables? Does this apply for generator expressions variables as well? Variables conditioned to the configuration Debug/Release were never cache variables. It would be weird to have regular variables as cache variables, and very similar variables per-configuration not cache-variables. |
I think that probably all variables should be cache variables. Right now conan primarily uses toolchain files to pass a bunch of configuration info onto CMake. A user doing the same thing by hand would either pass that to CMake via the command line with the |
The Tribe 2.0 is almost ready for launch. This will be probably be the first question, which is the minimum cmake version (there is already some issue here, but we will ask for feedback and take a final decision, then implement testing in our CI with that minimum cmake version (we are already doing changes to our test suite, moving to pytest, to be able to do this with more control). |
#8124 added back CACHE, this will be released in 1.32 |
a77b978 switched from using cached variables to normal cmake variables. This means that cmake configuration has to be run twice to override standard configurable settings. This is because on the first processing, the cache variable does not exist in the cache, so when the
set
function call that initializes the cache variable is reached, it overrides the variable that is set by toolchain. On a second configuration, the sameset
function call is a no-op, since the cache variable has already been initialized.Environment Details (include every applicable attribute)
Steps to reproduce (Include if Applicable)
CMakeLists.txt
conanfile.py
The text was updated successfully, but these errors were encountered: