diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index bd6af8c117..9aae5bc822 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 47c0877744..3459c2a0c2 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 ded4c25485..f1f1202a37 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 0b8742687d..3a6e030c04 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