summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalGenerator.cxx8
-rw-r--r--Source/cmGlobalGenerator.h1
-rw-r--r--Source/cmGlobalNMakeMakefileGenerator.cxx4
-rw-r--r--Source/cmLocalGenerator.cxx14
-rw-r--r--Source/cmLocalGenerator.h5
5 files changed, 28 insertions, 4 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 90d7c96..19f4f9a 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -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();
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 6c660e4..7f07b19 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -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
diff --git a/Source/cmGlobalNMakeMakefileGenerator.cxx b/Source/cmGlobalNMakeMakefileGenerator.cxx
index 3f75f43..5aa7314 100644
--- a/Source/cmGlobalNMakeMakefileGenerator.cxx
+++ b/Source/cmGlobalNMakeMakefileGenerator.cxx
@@ -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;
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 258debd..96057f4 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -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());
+};
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 24bcfa5..eb06265 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -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;