diff options
author | Brad King <brad.king@kitware.com> | 2020-06-12 12:41:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-06-18 13:52:05 (GMT) |
commit | 5845c218d771b517aa4294f0a90267e6f3f64891 (patch) | |
tree | 496f8fae5d48677d97df29b082771aa31fe76218 /Source/cmPolicies.h | |
parent | 7b07ccdd2b8d621211ee1642e8b62b005b0cd60f (diff) | |
download | CMake-5845c218d771b517aa4294f0a90267e6f3f64891.zip CMake-5845c218d771b517aa4294f0a90267e6f3f64891.tar.gz CMake-5845c218d771b517aa4294f0a90267e6f3f64891.tar.bz2 |
Deprecate compatibility with CMake versions older than 2.8.12
Issue a deprecation warning on calls to `cmake_minimum_required` or
`cmake_policy` that set policies based on versions older than 2.8.12.
Note that the effective policy version includes `...<max>` treatment.
This is important in combination with commit ca24b70d31 (Export: Specify
a policy range in exported files, 2020-05-16, v3.18.0-rc1~133^2).
Diffstat (limited to 'Source/cmPolicies.h')
-rw-r--r-- | Source/cmPolicies.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 49dadc7..bba8b03 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -399,12 +399,20 @@ public: //! Get the default status for a policy static cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id); + enum class WarnCompat + { + Off, + On + }; + //! Set a policy level for this listfile static bool ApplyPolicyVersion(cmMakefile* mf, std::string const& version_min, - std::string const& version_max); + std::string const& version_max, + WarnCompat warnCompat); static bool ApplyPolicyVersion(cmMakefile* mf, unsigned int majorVer, - unsigned int minorVer, unsigned int patchVer); + unsigned int minorVer, unsigned int patchVer, + WarnCompat warnCompat); //! return a warning string for a given policy static std::string GetPolicyWarning(cmPolicies::PolicyID id); |