summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-04-18 12:50:31 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-04-18 13:29:17 (GMT)
commit68f791cd06983e8fd375edfba74a9d821231e269 (patch)
tree3735005251b63f52356415298a149c900bddbf88
parent5bb4248a807029053156dbf4a3cdba4427766306 (diff)
downloadCMake-68f791cd06983e8fd375edfba74a9d821231e269.zip
CMake-68f791cd06983e8fd375edfba74a9d821231e269.tar.gz
CMake-68f791cd06983e8fd375edfba74a9d821231e269.tar.bz2
cmMakefile: Add a method for processing buildsystem files.
These are different from other ListFiles in that a project() command is required if it is top-level.
-rw-r--r--Source/cmLocalGenerator.cxx2
-rw-r--r--Source/cmMakefile.cxx24
-rw-r--r--Source/cmMakefile.h5
3 files changed, 13 insertions, 18 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index c143bce..56e17ec 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -181,7 +181,7 @@ void cmLocalGenerator::ReadInputFile()
currentStart += "/CMakeLists.txt";
if(cmSystemTools::FileExists(currentStart.c_str(), true))
{
- this->Makefile->ReadListFile(currentStart.c_str());
+ this->Makefile->ProcessBuildsystemFile(currentStart.c_str());
return;
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8bc4ac8..b08725e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -522,12 +522,19 @@ void cmMakefile::IncludeScope::EnforceCMP0011()
}
}
+bool cmMakefile::ProcessBuildsystemFile(const char* listfile)
+{
+ return this->ReadListFile(listfile, 0, true,
+ this->cmStartDirectory == this->cmHomeDirectory);
+}
+
//----------------------------------------------------------------------------
// Parse the given CMakeLists.txt file executing all commands
//
bool cmMakefile::ReadListFile(const char* filename_in,
const char *external_in,
- bool noPolicyScope)
+ bool noPolicyScope,
+ bool requireProjectCommand)
{
std::string currentParentFile
= this->GetSafeDefinition("CMAKE_PARENT_LIST_FILE");
@@ -580,21 +587,6 @@ bool cmMakefile::ReadListFile(const char* filename_in,
cmSystemTools::GetFilenamePath(filenametoread).c_str());
this->MarkVariableAsUsed("CMAKE_CURRENT_LIST_DIR");
- // try to see if the list file is the top most
- // list file for a project, and if it is, then it
- // must have a project command. If there is not
- // one, then cmake will provide one via the
- // cmListFileCache class.
- bool requireProjectCommand = false;
- if(!external && this->cmStartDirectory == this->cmHomeDirectory)
- {
- if(cmSystemTools::LowerCase(
- cmSystemTools::GetFilenameName(filename)) == "cmakelists.txt")
- {
- requireProjectCommand = true;
- }
- }
-
// push the listfile onto the stack
this->ListFileStack.push_back(filenametoread);
cmListFile cacheFile;
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index ce21c60..33c4b20 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -87,7 +87,10 @@ public:
*/
bool ReadListFile(const char* listfile,
const char* external= 0,
- bool noPolicyScope = true);
+ bool noPolicyScope = true,
+ bool requireProjectCommand = false);
+
+ bool ProcessBuildsystemFile(const char* listfile);
/**
* Add a function blocker to this makefile