Bump CMake minimum version to 3.13 #430
Merged
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.
What
This bumps the minimum CMake version from
3.8.2
to3.13.0
.Goal
Hiding this warning message:
Why
Different versions of CMake comes with different policies enabled by default.
As of 3.13.0, CMake introduced the policy CMP0077 which, because this project is on an older version, wants users vendoring
cglm
to specify whether they prefer theOLD
orNEW
behavior, resulting in eitherset(CMAKE_POLICY_DEFAULT_CMP0077 X)
beforeadd_subdirectory(vendor/cglm)
orcmake_policy(CMP0077 X)
for the whole project.Explanation
The
NEW
behavior (that version 3.13.0 introduced) is sane and desirable for everybody.Prior,
option()
was copying identically named variables into the cache and then ignoring any future mutations unless re-configuring the whole project. Now,option()
prefers to do nothing, not even caching, essentially honoring at all times what the early variable definition requested (that option() would've normally set).This allows for users to properly configure CGML's options even though it's a subdirectory and to not worry about possible overrides or left over cache headaches.
e.g.
Backwards compatibility
Users that explicitly want to keep the old behavior would've already needed the policy line and the version upgrade wont distrupt their choice. That's the whole point of configurable CMake policies.
Everybody else on newer CMake versions that didn't pick a policy accidently rely on the new behavior and therefore not impacted by the new version because the default maintains that behavior.
Notes
It seems 3.8.2 was in 2017 and 3.13.0 in 2018. Both are old enough that probably everyone and all the major distros are well beyond. Personally, I use MinGW a lot and am on 3.26.4, while officially the latest is 3.30.3.