Ver código fonte

CMP0014: Remove support for OLD behavior

Brad King 1 ano atrás
pai
commit
35282387ea
3 arquivos alterados com 10 adições e 28 exclusões
  1. 5 4
      Help/policy/CMP0014.rst
  2. 4 23
      Source/cmMakefile.cxx
  3. 1 1
      Source/cmPolicies.h

+ 5 - 4
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

+ 4 - 23
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

+ 1 - 1
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)                                                             \