summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-05-14 18:40:40 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-05-14 18:44:55 (GMT)
commitc5059c900036fd9500d64fbd7f9d2d3631152295 (patch)
tree2553a768f322c2841d6c378a409d9f7c00c5664d /Source
parentb17686d2bbc193f19c60cdf44a228e49b4ffe386 (diff)
downloadCMake-c5059c900036fd9500d64fbd7f9d2d3631152295.zip
CMake-c5059c900036fd9500d64fbd7f9d2d3631152295.tar.gz
CMake-c5059c900036fd9500d64fbd7f9d2d3631152295.tar.bz2
cmLocalGenerator: Add abstraction to check if top-level.
Move from the cmLocalNinjaGenerator. Fix the case of the name.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmLocalGenerator.cxx5
-rw-r--r--Source/cmLocalGenerator.h3
-rw-r--r--Source/cmLocalNinjaGenerator.cxx9
-rw-r--r--Source/cmLocalNinjaGenerator.h3
4 files changed, 10 insertions, 10 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index bd6af8c..9aae5bc 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -77,6 +77,11 @@ cmLocalGenerator::~cmLocalGenerator()
delete this->Makefile;
}
+bool cmLocalGenerator::IsRootMakefile() const
+{
+ return !this->GetParent();
+}
+
//----------------------------------------------------------------------------
class cmLocalGeneratorCurrent
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 47c0877..3459c2a 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -37,6 +37,9 @@ public:
cmLocalGenerator(cmGlobalGenerator* gg, cmLocalGenerator* parent);
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 ded4c25..f1f1202 100644
--- a/Source/cmLocalNinjaGenerator.cxx
+++ b/Source/cmLocalNinjaGenerator.cxx
@@ -48,7 +48,7 @@ void cmLocalNinjaGenerator::Generate()
#endif
// We do that only once for the top CMakeLists.txt file.
- if(this->isRootMakefile())
+ if(this->IsRootMakefile())
{
this->WriteBuildFileTop();
@@ -179,11 +179,6 @@ cmake* cmLocalNinjaGenerator::GetCMakeInstance()
return this->GetGlobalGenerator()->GetCMakeInstance();
}
-bool cmLocalNinjaGenerator::isRootMakefile() const
-{
- return !this->GetParent();
-}
-
void cmLocalNinjaGenerator::WriteBuildFileTop()
{
// For the build file.
@@ -312,7 +307,7 @@ void cmLocalNinjaGenerator::WriteProcessedMakefile(std::ostream& os)
<< "# Write statements declared in CMakeLists.txt:" << std::endl
<< "# " << this->Makefile->GetCurrentListFile() << std::endl
;
- if(this->isRootMakefile())
+ if(this->IsRootMakefile())
os << "# Which is the root file." << std::endl;
cmGlobalNinjaGenerator::WriteDivider(os);
os << std::endl;
diff --git a/Source/cmLocalNinjaGenerator.h b/Source/cmLocalNinjaGenerator.h
index 0b87426..3a6e030 100644
--- a/Source/cmLocalNinjaGenerator.h
+++ b/Source/cmLocalNinjaGenerator.h
@@ -59,9 +59,6 @@ public:
std::string const& GetConfigName() const
{ return this->ConfigName; }
- /// @return whether we are processing the top CMakeLists.txt file.
- bool isRootMakefile() const;
-
/// @returns the relative path between the HomeOutputDirectory and this
/// local generators StartOutputDirectory.
std::string GetHomeRelativeOutputPath() const