mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 12:16:40 +08:00
CMP0000: Remove support for OLD behavior
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
CMP0000
|
CMP0000
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||||
|
.. include:: REMOVED_PROLOGUE.txt
|
||||||
|
|
||||||
A minimum required CMake version must be specified.
|
A minimum required CMake version must be specified.
|
||||||
|
|
||||||
CMake requires that projects specify the version of CMake to which
|
CMake requires that projects specify the version of CMake to which
|
||||||
@@ -26,7 +29,5 @@ behavior was to silently ignore the missing invocation. The ``NEW``
|
|||||||
behavior is to issue an error instead of a warning.
|
behavior is to issue an error instead of a warning.
|
||||||
|
|
||||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0
|
||||||
.. |WARNS_OR_DOES_NOT_WARN| replace:: warns
|
.. |WARNED_OR_DID_NOT_WARN| replace:: warned
|
||||||
.. include:: STANDARD_ADVICE.txt
|
.. include:: REMOVED_EPILOGUE.txt
|
||||||
|
|
||||||
.. include:: DEPRECATED.txt
|
|
||||||
|
@@ -131,7 +131,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator,
|
|||||||
this->PushLoopBlockBarrier();
|
this->PushLoopBlockBarrier();
|
||||||
|
|
||||||
// By default the check is not done. It is enabled by
|
// By default the check is not done. It is enabled by
|
||||||
// cmListFileCache in the top level if necessary.
|
// cmMakefile::Configure in the top level if necessary.
|
||||||
this->CheckCMP0000 = false;
|
this->CheckCMP0000 = false;
|
||||||
|
|
||||||
#if !defined(CMAKE_BOOTSTRAP)
|
#if !defined(CMAKE_BOOTSTRAP)
|
||||||
@@ -986,24 +986,9 @@ void cmMakefile::EnforceDirectoryLevelRules() const
|
|||||||
"support older CMake versions for this project. "
|
"support older CMake versions for this project. "
|
||||||
"For more information run "
|
"For more information run "
|
||||||
"\"cmake --help-policy CMP0000\".");
|
"\"cmake --help-policy CMP0000\".");
|
||||||
switch (this->GetPolicyStatus(cmPolicies::CMP0000)) {
|
|
||||||
case cmPolicies::WARN:
|
|
||||||
// Warn because the user did not provide a minimum required
|
|
||||||
// version.
|
|
||||||
this->GetCMakeInstance()->IssueMessage(MessageType::AUTHOR_WARNING, e,
|
|
||||||
this->Backtrace);
|
|
||||||
CM_FALLTHROUGH;
|
|
||||||
case cmPolicies::OLD:
|
|
||||||
// OLD behavior is to use policy version 2.4 set in
|
|
||||||
// cmListFileCache.
|
|
||||||
break;
|
|
||||||
case cmPolicies::NEW:
|
|
||||||
// NEW behavior is to issue an error.
|
|
||||||
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
|
this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e,
|
||||||
this->Backtrace);
|
this->Backtrace);
|
||||||
cmSystemTools::SetFatalErrorOccurred();
|
cmSystemTools::SetFatalErrorOccurred();
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -15,8 +15,7 @@ class cmMakefile;
|
|||||||
|
|
||||||
#define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT) \
|
#define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT) \
|
||||||
SELECT(POLICY, CMP0000, \
|
SELECT(POLICY, CMP0000, \
|
||||||
"A minimum required CMake version must be specified.", 2, 6, 0, \
|
"A minimum required CMake version must be specified.", 2, 6, 0, NEW) \
|
||||||
WARN) \
|
|
||||||
SELECT(POLICY, CMP0001, \
|
SELECT(POLICY, CMP0001, \
|
||||||
"CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", 2, 6, 0, \
|
"CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", 2, 6, 0, \
|
||||||
WARN) \
|
WARN) \
|
||||||
|
@@ -3,6 +3,3 @@ cmake_minimum_required(VERSION 3.31)
|
|||||||
# Make sure a policy set differently by our includer is now correct.
|
# Make sure a policy set differently by our includer is now correct.
|
||||||
cmake_policy(GET CMP0180 cmp)
|
cmake_policy(GET CMP0180 cmp)
|
||||||
check(CMP0180 "NEW" "${cmp}")
|
check(CMP0180 "NEW" "${cmp}")
|
||||||
|
|
||||||
# Test allowing the top-level file to not have cmake_minimum_required.
|
|
||||||
cmake_policy(SET CMP0000 OLD)
|
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.30)
|
||||||
project(PolicyScope C)
|
project(PolicyScope C)
|
||||||
# No cmake_minimum_required(VERSION), it's in FindFoo.
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Helper function to report results.
|
# Helper function to report results.
|
||||||
|
Reference in New Issue
Block a user