summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-14 19:18:06 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-14 19:26:13 (GMT)
commitce167b546d078d9f699248688ff5f16c7ecf15c7 (patch)
tree91e0c8cea98cb4a18e5c99eab254302ab870fbd5 /Source/cmMakefile.cxx
parent7baef756493caaabc226c39c4a8dad669b883d4d (diff)
downloadCMake-ce167b546d078d9f699248688ff5f16c7ecf15c7.zip
CMake-ce167b546d078d9f699248688ff5f16c7ecf15c7.tar.gz
CMake-ce167b546d078d9f699248688ff5f16c7ecf15c7.tar.bz2
cmMakefile: Handle CMP0014 before configuring the generator.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx37
1 files changed, 36 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 61ada2d..7b8d3af 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1642,12 +1642,47 @@ void cmMakefile::InitializeFromParent()
void cmMakefile::ConfigureSubDirectory(cmLocalGenerator *lg2)
{
lg2->GetMakefile()->InitializeFromParent();
+ std::string currentStart = lg2->GetMakefile()->GetCurrentSourceDirectory();
if (this->GetCMakeInstance()->GetDebugOutput())
{
std::string msg=" Entering ";
- msg += lg2->GetMakefile()->GetCurrentSourceDirectory();
+ msg += currentStart;
cmSystemTools::Message(msg.c_str());
}
+
+ currentStart += "/CMakeLists.txt";
+ if(!cmSystemTools::FileExists(currentStart.c_str(), true))
+ {
+ // The file is missing. Check policy CMP0014.
+ std::ostringstream e;
+ e << "The source directory\n"
+ << " " << currentStart << "\n"
+ << "does not contain a CMakeLists.txt file.";
+ switch (this->GetPolicyStatus(cmPolicies::CMP0014))
+ {
+ case cmPolicies::WARN:
+ // Print the warning.
+ e << "\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(cmake::AUTHOR_WARNING, e.str());
+ case cmPolicies::OLD:
+ // OLD behavior does not warn.
+ break;
+ case cmPolicies::REQUIRED_IF_USED:
+ case cmPolicies::REQUIRED_ALWAYS:
+ e << "\n"
+ << cmPolicies::GetRequiredPolicyError(cmPolicies::CMP0014);
+ case cmPolicies::NEW:
+ // NEW behavior prints the error.
+ this->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
+ lg2->SetConfiguredCMP0014(true);
+ return;
+ }
// finally configure the subdir
lg2->Configure();
if (this->GetCMakeInstance()->GetDebugOutput())