From 35282387eac1a04eed593d94bac664cff9764241 Mon Sep 17 00:00:00 2001 From: Brad King Date: Sun, 17 Nov 2024 10:26:50 -0500 Subject: [PATCH] CMP0014: Remove support for OLD behavior --- Help/policy/CMP0014.rst | 9 +++++---- Source/cmMakefile.cxx | 27 ++++----------------------- Source/cmPolicies.h | 2 +- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/Help/policy/CMP0014.rst b/Help/policy/CMP0014.rst index 1487bc4e16..e147705bab 100644 --- a/Help/policy/CMP0014.rst +++ b/Help/policy/CMP0014.rst @@ -1,6 +1,9 @@ CMP0014 ------- +.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0 +.. include:: REMOVED_PROLOGUE.txt + Input directories must have ``CMakeLists.txt``. CMake versions before 2.8 silently ignored missing ``CMakeLists.txt`` @@ -11,7 +14,5 @@ The ``OLD`` behavior for this policy is to silently ignore the problem. The ``NEW`` behavior for this policy is to report an error. .. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.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 0cd8f2cb54..00ff634c9d 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -1811,29 +1811,10 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf) std::string currentStartFile = this->GetCMakeInstance()->GetCMakeListFile(currentStart); if (!cmSystemTools::FileExists(currentStartFile, true)) { - // The file is missing. Check policy CMP0014. - auto e = cmStrCat("The source directory\n ", currentStart, - "\n" - "does not contain a CMakeLists.txt file."); - /* clang-format on */ - switch (this->GetPolicyStatus(cmPolicies::CMP0014)) { - case cmPolicies::WARN: - // Print the warning. - e += cmStrCat("\n" - "CMake does not support this case but it used " - "to work accidentally and is being allowed for " - "compatibility.\n", - cmPolicies::GetPolicyWarning(cmPolicies::CMP0014)); - this->IssueMessage(MessageType::AUTHOR_WARNING, e); - CM_FALLTHROUGH; - case cmPolicies::OLD: - // OLD behavior does not warn. - break; - case cmPolicies::NEW: - // NEW behavior prints the error. - this->IssueMessage(MessageType::FATAL_ERROR, e); - break; - } + this->IssueMessage(MessageType::FATAL_ERROR, + cmStrCat("The source directory\n ", currentStart, + "\n" + "does not contain a CMakeLists.txt file.")); return; } // finally configure the subdir diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 9c5c88f3b7..13e09c3a48 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -53,7 +53,7 @@ class cmMakefile; SELECT(POLICY, CMP0013, "Duplicate binary directories are not allowed.", 2, \ 8, 0, NEW) \ SELECT(POLICY, CMP0014, "Input directories must have CMakeLists.txt.", 2, \ - 8, 0, WARN) \ + 8, 0, NEW) \ SELECT(POLICY, CMP0015, \ "link_directories() treats paths relative to the source dir.", 2, 8, \ 1, WARN) \