mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-18 08:51:52 +08:00
CMP0014: Remove support for OLD behavior
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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) \
|
||||
|
Reference in New Issue
Block a user