diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-24 09:31:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2015-05-27 13:18:31 (GMT) |
commit | c7b79aa16adc1117e62bf146c64f97c992ec2e2e (patch) | |
tree | 66fae23d85d71ff99d8ac1d131696707fcec34b1 /Source/cmake.cxx | |
parent | 01e1cd5c1fc5e2684ec69d4916dd31ed23746055 (diff) | |
download | CMake-c7b79aa16adc1117e62bf146c64f97c992ec2e2e.zip CMake-c7b79aa16adc1117e62bf146c64f97c992ec2e2e.tar.gz CMake-c7b79aa16adc1117e62bf146c64f97c992ec2e2e.tar.bz2 |
cmGlobalGenerator: Require a cmake instance in ctor.
It is required anyway, so this makes it explicit.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 3ef85b6..23803ef 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -363,8 +363,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args, // if a generator was not specified use a generic one if (!gg) { - gg = new cmGlobalGenerator; - gg->SetCMakeInstance(this); + gg = new cmGlobalGenerator(this); created = true; } @@ -412,8 +411,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args) (cmSystemTools::GetCurrentWorkingDirectory()); // if a generator was not yet created, temporarily create one - cmGlobalGenerator *gg = new cmGlobalGenerator; - gg->SetCMakeInstance(this); + cmGlobalGenerator *gg = new cmGlobalGenerator(this); this->SetGlobalGenerator(gg); // read in the list file to fill the cache @@ -952,7 +950,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname) for (RegisteredGeneratorsVector::const_iterator i = this->Generators.begin(); i != this->Generators.end(); ++i) { - generator = (*i)->CreateGlobalGenerator(name); + generator = (*i)->CreateGlobalGenerator(name, this); if (generator) { break; @@ -961,7 +959,6 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname) if (generator) { - generator->SetCMakeInstance(this); generator->SetExternalMakefileProjectGenerator(extraGenerator); } else @@ -1046,8 +1043,6 @@ void cmake::SetGlobalGenerator(cmGlobalGenerator *gg) { this->CCEnvironment = ""; } - // set the cmake instance just to be sure - gg->SetCMakeInstance(this); } int cmake::DoPreConfigureChecks() @@ -1300,12 +1295,12 @@ int cmake::ActualConfigure() = this->CreateGlobalGenerator(installedCompiler.c_str()); if(!gen) { - gen = new cmGlobalNMakeMakefileGenerator; + gen = new cmGlobalNMakeMakefileGenerator(this); } this->SetGlobalGenerator(gen); std::cout << "-- Building for: " << gen->GetName() << "\n"; #else - this->SetGlobalGenerator(new cmGlobalUnixMakefileGenerator3); + this->SetGlobalGenerator(new cmGlobalUnixMakefileGenerator3(this)); #endif } if(!this->GlobalGenerator) @@ -1918,8 +1913,7 @@ int cmake::CheckBuildSystem() cmake cm; cm.SetHomeDirectory(""); cm.SetHomeOutputDirectory(""); - cmGlobalGenerator gg; - gg.SetCMakeInstance(&cm); + cmGlobalGenerator gg(&cm); cmsys::auto_ptr<cmLocalGenerator> lg(gg.MakeLocalGenerator()); cmMakefile* mf = lg->GetMakefile(); if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || |