Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
catch2 (2.x.x): support conan v2 #13794
catch2 (2.x.x): support conan v2 #13794
Changes from 3 commits
c22397f
d2502b3
6fe08f1
3083bfd
0e8effe
c67dd63
a5170e5
44f0fe6
e92d878
88f6eb0
bf7d67e
cf11063
332eb40
506f373
a0227c3
8e4afe4
16532b8
a0a5794
bf47652
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of doubt: conan-io/conan#11937 (comment)
Plus:
There are two main cases to use
cache_variables
:project()
CACHE
. Need to check project's CMakeLists.txtThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs currently focus on the difference that CACHE is for "single config" compare to "multiple config",
and says
for the majority of cases cache_variables is what you probably want to use
... so this seems to be a complex topic...I see almost all recipes use variables, but it seems like if you really want the variable to be set, you should use cache_variables and there is less room for surprises?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CMake, cache variables are how CMake and projects expose options to be set by consumers. Cache variables are meant to be able to be preemptible by consumers. If a consumer sets it before a project does, the project won't change the value. I think you're right, @paulharris, that we should prefer setting cache variables instead when possible, as this is how projects should expose the options we are often setting.
There are of course, tons of CMake projects that don't respect cache variables and set normal variables with the same name which causes all sorts of problems.... ugh. And the issue with setting most variables before the first project command is quite problematic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully improvements for this are coming with a future CMake?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#13971 not the best but it's a start