mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-19 02:17:27 +08:00
CMP0014: Remove support for OLD behavior
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
CMP0014
|
CMP0014
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
.. |REMOVED_IN_CMAKE_VERSION| replace:: 4.0
|
||||||
|
.. include:: REMOVED_PROLOGUE.txt
|
||||||
|
|
||||||
Input directories must have ``CMakeLists.txt``.
|
Input directories must have ``CMakeLists.txt``.
|
||||||
|
|
||||||
CMake versions before 2.8 silently ignored missing ``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.
|
The ``NEW`` behavior for this policy is to report an error.
|
||||||
|
|
||||||
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.0
|
.. |INTRODUCED_IN_CMAKE_VERSION| replace:: 2.8.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
|
|
||||||
|
@@ -1811,29 +1811,10 @@ void cmMakefile::ConfigureSubDirectory(cmMakefile* mf)
|
|||||||
std::string currentStartFile =
|
std::string currentStartFile =
|
||||||
this->GetCMakeInstance()->GetCMakeListFile(currentStart);
|
this->GetCMakeInstance()->GetCMakeListFile(currentStart);
|
||||||
if (!cmSystemTools::FileExists(currentStartFile, true)) {
|
if (!cmSystemTools::FileExists(currentStartFile, true)) {
|
||||||
// The file is missing. Check policy CMP0014.
|
this->IssueMessage(MessageType::FATAL_ERROR,
|
||||||
auto e = cmStrCat("The source directory\n ", currentStart,
|
cmStrCat("The source directory\n ", currentStart,
|
||||||
"\n"
|
"\n"
|
||||||
"does not contain a CMakeLists.txt file.");
|
"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;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// finally configure the subdir
|
// finally configure the subdir
|
||||||
|
@@ -53,7 +53,7 @@ class cmMakefile;
|
|||||||
SELECT(POLICY, CMP0013, "Duplicate binary directories are not allowed.", 2, \
|
SELECT(POLICY, CMP0013, "Duplicate binary directories are not allowed.", 2, \
|
||||||
8, 0, NEW) \
|
8, 0, NEW) \
|
||||||
SELECT(POLICY, CMP0014, "Input directories must have CMakeLists.txt.", 2, \
|
SELECT(POLICY, CMP0014, "Input directories must have CMakeLists.txt.", 2, \
|
||||||
8, 0, WARN) \
|
8, 0, NEW) \
|
||||||
SELECT(POLICY, CMP0015, \
|
SELECT(POLICY, CMP0015, \
|
||||||
"link_directories() treats paths relative to the source dir.", 2, 8, \
|
"link_directories() treats paths relative to the source dir.", 2, 8, \
|
||||||
1, WARN) \
|
1, WARN) \
|
||||||
|
Reference in New Issue
Block a user