summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalGenerator.cxx6
-rw-r--r--Source/cmGlobalGenerator.h12
-rw-r--r--Source/cmLocalGenerator.cxx17
-rw-r--r--Source/cmQtAutoGenerators.cxx2
-rw-r--r--Source/cmakemain.cxx7
5 files changed, 21 insertions, 23 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index d1842c1..1ee5500 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -70,7 +70,7 @@ cmGlobalGenerator::cmGlobalGenerator(cmake* cm)
this->TryCompileTimeout = 0;
this->ExtraGenerator = 0;
- this->CurrentLocalGenerator = 0;
+ this->CurrentMakefile = 0;
this->TryCompileOuterMakefile = 0;
}
@@ -1281,7 +1281,7 @@ void cmGlobalGenerator::Generate()
// Generate project files
for (i = 0; i < this->LocalGenerators.size(); ++i)
{
- this->SetCurrentLocalGenerator(this->LocalGenerators[i]);
+ this->SetCurrentMakefile(this->LocalGenerators[i]->GetMakefile());
this->LocalGenerators[i]->Generate();
if(!this->LocalGenerators[i]->GetMakefile()->IsOn(
"CMAKE_SKIP_INSTALL_RULES"))
@@ -1293,7 +1293,7 @@ void cmGlobalGenerator::Generate()
(static_cast<float>(i)+1.0f)/
static_cast<float>(this->LocalGenerators.size()));
}
- this->SetCurrentLocalGenerator(0);
+ this->SetCurrentMakefile(0);
if(!this->GenerateCPackPropertiesFile())
{
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 979e971..d2b8504 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -168,11 +168,13 @@ public:
const std::vector<cmLocalGenerator *>& GetLocalGenerators() const {
return this->LocalGenerators;}
- cmLocalGenerator* GetCurrentLocalGenerator()
- {return this->CurrentLocalGenerator;}
+ cmMakefile* GetCurrentMakefile() const
+ {
+ return this->CurrentMakefile;
+ }
- void SetCurrentLocalGenerator(cmLocalGenerator* lg)
- {this->CurrentLocalGenerator = lg;}
+ void SetCurrentMakefile(cmMakefile* mf)
+ {this->CurrentMakefile = mf;}
void AddLocalGenerator(cmLocalGenerator *lg);
@@ -406,7 +408,7 @@ protected:
std::string ConfiguredFilesPath;
cmake *CMakeInstance;
std::vector<cmLocalGenerator *> LocalGenerators;
- cmLocalGenerator* CurrentLocalGenerator;
+ cmMakefile* CurrentMakefile;
// map from project name to vector of local generators in that project
std::map<std::string, std::vector<cmLocalGenerator*> > ProjectMap;
std::map<cmLocalGenerator*, std::set<cmTarget const*> >
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 58366d1..4b9415b 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -78,16 +78,17 @@ bool cmLocalGenerator::IsRootMakefile() const
class cmLocalGeneratorCurrent
{
cmGlobalGenerator* GG;
- cmLocalGenerator* LG;
+ cmMakefile* MF;
cmState::Snapshot Snapshot;
public:
- cmLocalGeneratorCurrent(cmLocalGenerator* lg)
+ cmLocalGeneratorCurrent(cmMakefile* mf)
{
- this->GG = lg->GetGlobalGenerator();
- this->LG = this->GG->GetCurrentLocalGenerator();
+ this->GG = mf->GetGlobalGenerator();
+ this->MF = this->GG->GetCurrentMakefile();
this->Snapshot = this->GG->GetCMakeInstance()->GetCurrentSnapshot();
- this->GG->GetCMakeInstance()->SetCurrentSnapshot(lg->GetStateSnapshot());
- this->GG->SetCurrentLocalGenerator(lg);
+ this->GG->GetCMakeInstance()->SetCurrentSnapshot(
+ this->GG->GetCMakeInstance()->GetCurrentSnapshot());
+ this->GG->SetCurrentMakefile(mf);
#if defined(CMAKE_BUILD_WITH_CMAKE)
this->GG->GetFileLockPool().PushFileScope();
#endif
@@ -97,7 +98,7 @@ public:
#if defined(CMAKE_BUILD_WITH_CMAKE)
this->GG->GetFileLockPool().PopFileScope();
#endif
- this->GG->SetCurrentLocalGenerator(this->LG);
+ this->GG->SetCurrentMakefile(this->MF);
this->GG->GetCMakeInstance()->SetCurrentSnapshot(this->Snapshot);
}
};
@@ -106,7 +107,7 @@ public:
void cmLocalGenerator::Configure()
{
// Manage the global generator's current local generator.
- cmLocalGeneratorCurrent clg(this);
+ cmLocalGeneratorCurrent clg(this->GetMakefile());
static_cast<void>(clg);
// make sure the CMakeFiles dir is there
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index cbb06cd..fbd2946 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -1215,7 +1215,7 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
cmLocalGenerator* lg = gg.MakeLocalGenerator();
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
- gg.SetCurrentLocalGenerator(lg);
+ gg.SetCurrentMakefile(lg->GetMakefile());
this->ReadAutogenInfoFile(lg->GetMakefile(), targetDirectory, config);
this->ReadOldMocDefinitionsFile(lg->GetMakefile(), targetDirectory);
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index e5f4700..cc30732 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -113,12 +113,7 @@ static cmMakefile* cmakemainGetMakefile(void *clientdata)
cmGlobalGenerator* gg=cm->GetGlobalGenerator();
if (gg)
{
- cmLocalGenerator* lg=gg->GetCurrentLocalGenerator();
- if (lg)
- {
- cmMakefile* mf = lg->GetMakefile();
- return mf;
- }
+ return gg->GetCurrentMakefile();
}
}
return 0;