summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-06-06 12:07:15 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-06-21 19:14:05 (GMT)
commit8bfaadfa394c9b462259ea13df6b2df7c4544ab4 (patch)
tree1a845ae755348b3fa2962758b05abf5570acccfc
parent217c243db04a21763848ac048edf153cd93bd883 (diff)
downloadCMake-8bfaadfa394c9b462259ea13df6b2df7c4544ab4.zip
CMake-8bfaadfa394c9b462259ea13df6b2df7c4544ab4.tar.gz
CMake-8bfaadfa394c9b462259ea13df6b2df7c4544ab4.tar.bz2
cmMakefile: Move IsRoot API from cmLocalGenerator.
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalGenerator.h3
-rw-r--r--Source/cmLocalNinjaGenerator.cxx4
-rw-r--r--Source/cmMakefile.cxx5
-rw-r--r--Source/cmMakefile.h3
-rw-r--r--Source/cmProjectCommand.cxx2
7 files changed, 13 insertions, 13 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 4fe52dd..0f61225 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -529,7 +529,7 @@ cmGlobalUnixMakefileGenerator3
cmLocalUnixMakefileGenerator3* lg)
{
// Only subdirectories need these rules.
- if(lg->IsRootMakefile())
+ if(lg->GetMakefile()->IsRootMakefile())
{
return;
}
@@ -1034,7 +1034,7 @@ void cmGlobalUnixMakefileGenerator3::WriteHelpRule
static_cast<cmLocalUnixMakefileGenerator3 *>(this->LocalGenerators[i]);
// for the passed in makefile or if this is the top Makefile wripte out
// the targets
- if (lg2 == lg || lg->IsRootMakefile())
+ if (lg2 == lg || lg->GetMakefile()->IsRootMakefile())
{
// for each target Generate the rule files for each target.
cmTargets& targets = lg2->GetMakefile()->GetTargets();
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index a42d5a7..119cba9 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -68,11 +68,6 @@ cmLocalGenerator::~cmLocalGenerator()
delete this->Makefile;
}
-bool cmLocalGenerator::IsRootMakefile() const
-{
- return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
-}
-
void cmLocalGenerator::IssueMessage(cmake::MessageType t,
std::string const& text) const
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 4452eef..a3f9588 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -40,9 +40,6 @@ public:
cmState::Snapshot snapshot);
virtual ~cmLocalGenerator();
- /// @return whether we are processing the top CMakeLists.txt file.
- bool IsRootMakefile() const;
-
/**
* Generate the makefile for this directory.
*/
diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx
index 427ae10..4db36fc 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -58,7 +58,7 @@ void cmLocalNinjaGenerator::Generate()
#endif
// We do that only once for the top CMakeLists.txt file.
- if(this->IsRootMakefile())
+ if(this->Makefile->IsRootMakefile())
{
this->WriteBuildFileTop();
@@ -298,7 +298,7 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
<< "# Write statements declared in CMakeLists.txt:" << std::endl
<< "# "
<< this->Makefile->GetDefinition("CMAKE_CURRENT_LIST_FILE") << std::endl;
- if(this->IsRootMakefile())
+ if(this->Makefile->IsRootMakefile())
os << "# Which is the root file." << std::endl;
cmGlobalNinjaGenerator::WriteDivider(os);
os << std::endl;
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0338062..cf7897e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1608,6 +1608,11 @@ void cmMakefile::PopMacroScope(bool reportError)
this->PopFunctionBlockerBarrier(reportError);
}
+bool cmMakefile::IsRootMakefile() const
+{
+ return !this->StateSnapshot.GetBuildsystemDirectoryParent().IsValid();
+}
+
//----------------------------------------------------------------------------
class cmMakefileCurrent
{
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 86bde0c..44bd8c6 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -90,6 +90,9 @@ public:
*/
void AddFunctionBlocker(cmFunctionBlocker* fb);
+ /// @return whether we are processing the top CMakeLists.txt file.
+ bool IsRootMakefile() const;
+
/**
* Remove the function blocker whose scope ends with the given command.
* This returns ownership of the function blocker object.
diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx
index 90bc111..46d7e01 100644
--- a/Source/cmProjectCommand.cxx
+++ b/Source/cmProjectCommand.cxx
@@ -53,7 +53,7 @@ bool cmProjectCommand
// CMAKE_PROJECT_NAME will match PROJECT_NAME, and cmake --build
// will work.
if(!this->Makefile->GetDefinition("CMAKE_PROJECT_NAME")
- || (this->Makefile->GetLocalGenerator()->IsRootMakefile()))
+ || (this->Makefile->IsRootMakefile()))
{
this->Makefile->AddDefinition("CMAKE_PROJECT_NAME", args[0].c_str());
this->Makefile->AddCacheDefinition