diff --git a/Help/policy/CMP0000.rst b/Help/policy/CMP0000.rst index 5f146bc47a..2667f3c0f0 100644 --- a/Help/policy/CMP0000.rst +++ b/Help/policy/CMP0000.rst @@ -1,6 +1,9 @@ CMP0000 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + A minimum required CMake version must be specified. 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. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.6.0 -.. |WARNS_OR_DOES_NOT_WARN| replace:: warns -.. include:: STANDARD_ADVICE.txt - -.. include:: DEPRECATED.txt +.. |WARNED_OR_DID_NOT_WARN| replace:: warned +.. include:: REMOVED_EPILOGUE.txt diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 8450f75487..0179d8ea04 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -131,7 +131,7 @@ cmMakefile::cmMakefile(cmGlobalGenerator* globalGenerator, this->PushLoopBlockBarrier(); // 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; #if !defined(CMAKE_BOOTSTRAP) @@ -986,24 +986,9 @@ void cmMakefile::EnforceDirectoryLevelRules() const "support older CMake versions for this project. " "For more information run " "\"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->Backtrace); - cmSystemTools::SetFatalErrorOccurred(); - break; - } + this->GetCMakeInstance()->IssueMessage(MessageType::FATAL_ERROR, e, + this->Backtrace); + cmSystemTools::SetFatalErrorOccurred(); } } diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 67d3d11c66..c1294ff978 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -15,8 +15,7 @@ class cmMakefile; #define CM_FOR_EACH_POLICY_TABLE(POLICY, SELECT) \ SELECT(POLICY, CMP0000, \ - "A minimum required CMake version must be specified.", 2, 6, 0, \ - WARN) \ + "A minimum required CMake version must be specified.", 2, 6, 0, NEW) \ SELECT(POLICY, CMP0001, \ "CMAKE_BACKWARDS_COMPATIBILITY should no longer be used.", 2, 6, 0, \ WARN) \ diff --git a/Tests/PolicyScope/Bar.cmake b/Tests/PolicyScope/Bar.cmake index f15124f78a..fb5ef60f5e 100644 --- a/Tests/PolicyScope/Bar.cmake +++ b/Tests/PolicyScope/Bar.cmake @@ -3,6 +3,3 @@ cmake_minimum_required(VERSION 3.31) # Make sure a policy set differently by our includer is now correct. cmake_policy(GET CMP0180 cmp) check(CMP0180 "NEW" "${cmp}") - -# Test allowing the top-level file to not have cmake_minimum_required. -cmake_policy(SET CMP0000 OLD) diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt index 36ba01a7fb..fbcfe937b2 100644 --- a/Tests/PolicyScope/CMakeLists.txt +++ b/Tests/PolicyScope/CMakeLists.txt @@ -1,5 +1,5 @@ +cmake_minimum_required(VERSION 3.30) project(PolicyScope C) -# No cmake_minimum_required(VERSION), it's in FindFoo. #----------------------------------------------------------------------------- # Helper function to report results.