This commit is contained in:
Ken Martin 2002-09-04 15:24:49 -04:00
parent 49aebe6c99
commit 5b0611d709
5 changed files with 28 additions and 4 deletions

View File

@ -19,6 +19,11 @@
#include "cmake.h"
#include "cmMakefile.h"
cmGlobalGenerator::cmGlobalGenerator()
{
m_LanguagesEnabled = false;
}
cmGlobalGenerator::~cmGlobalGenerator()
{
// Delete any existing cmLocalGenerators
@ -62,6 +67,7 @@ void cmGlobalGenerator::Configure()
// set the Start directories
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetHomeDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetHomeOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
// now do it
this->RecursiveConfigure(lg);
@ -94,6 +100,7 @@ void cmGlobalGenerator::RecursiveConfigure(cmLocalGenerator *lg)
currentDir += "/";
currentDir += subdirs[i];
lg2->GetMakefile()->SetStartDirectory(currentDir.c_str());
lg2->GetMakefile()->MakeStartDirectoriesCurrent();
this->RecursiveConfigure(lg2);
}
@ -119,6 +126,7 @@ void cmGlobalGenerator::LocalGenerate()
// set the Start directories
lg->GetMakefile()->SetStartDirectory(m_CMakeInstance->GetHomeDirectory());
lg->GetMakefile()->SetStartOutputDirectory(m_CMakeInstance->GetHomeOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent();
// now do trhe configure
lg->Configure();

View File

@ -34,6 +34,7 @@ class cmGlobalGenerator
{
public:
///! Free any memory allocated with the GlobalGenerator
cmGlobalGenerator();
virtual ~cmGlobalGenerator();
///! Create a local generator appropriate to this Global Generator

View File

@ -41,5 +41,7 @@ void cmGlobalNMakeMakefileGenerator::EnableLanguage(const char* lang,
///! Create a local generator appropriate to this Global Generator
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
{
return new cmLocalNMakeMakefileGenerator;
cmLocalGenerator *lg = new cmLocalNMakeMakefileGenerator;
lg->SetGlobalGenerator(this);
return lg;
}

View File

@ -15,11 +15,14 @@
=========================================================================*/
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmake.h"
#include "cmMakefile.h"
cmLocalGenerator::cmLocalGenerator()
{
m_Makefile = new cmMakefile;
m_Makefile->SetLocalGenerator(this);
}
cmLocalGenerator::~cmLocalGenerator()
@ -34,3 +37,14 @@ void cmLocalGenerator::Configure()
currentStart += "/CMakeLists.txt";
m_Makefile->ReadListFile(currentStart.c_str());
}
void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
{
m_GlobalGenerator = gg;
// setup the home directories
m_Makefile->SetHomeDirectory(
gg->GetCMakeInstance()->GetHomeDirectory());
m_Makefile->SetHomeOutputDirectory(
gg->GetCMakeInstance()->GetHomeOutputDirectory());
};

View File

@ -42,7 +42,7 @@ public:
* some steps to save time, such as dependency generation for the
* makefiles. This is done by a direct invocation from make.
*/
virtual void Generate(bool fromTheTop);
virtual void Generate(bool fromTheTop) {};
/**
* Process the CMakeLists files for this directory to fill in the
@ -59,8 +59,7 @@ public:
return m_GlobalGenerator; };
///! Set the Global Generator, done on creation by the GlobalGenerator
void SetGlobalGenerator(cmGlobalGenerator *gg) {
m_GlobalGenerator = gg; };
void SetGlobalGenerator(cmGlobalGenerator *gg);
protected:
bool m_FromTheTop;