mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 14:01:21 +00:00
cmLocalGenerator: Add abstraction to check if top-level.
Move from the cmLocalNinjaGenerator. Fix the case of the name.
This commit is contained in:
parent
b17686d2bb
commit
c5059c9000
@ -77,6 +77,11 @@ cmLocalGenerator::~cmLocalGenerator()
|
||||
delete this->Makefile;
|
||||
}
|
||||
|
||||
bool cmLocalGenerator::IsRootMakefile() const
|
||||
{
|
||||
return !this->GetParent();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
class cmLocalGeneratorCurrent
|
||||
{
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user