QtAutogen: Create global generator on the stack.
This commit is contained in:
parent
fe401ede2a
commit
a5b59fae15
|
@ -1210,13 +1210,13 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
|
||||||
cmake cm;
|
cmake cm;
|
||||||
cm.SetHomeOutputDirectory(targetDirectory);
|
cm.SetHomeOutputDirectory(targetDirectory);
|
||||||
cm.SetHomeDirectory(targetDirectory);
|
cm.SetHomeDirectory(targetDirectory);
|
||||||
cmGlobalGenerator* gg = new cmGlobalGenerator();
|
cmGlobalGenerator gg;
|
||||||
gg->SetCMakeInstance(&cm);
|
gg.SetCMakeInstance(&cm);
|
||||||
|
|
||||||
cmLocalGenerator* lg = gg->MakeLocalGenerator();
|
cmLocalGenerator* lg = gg.MakeLocalGenerator();
|
||||||
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
|
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
|
||||||
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
|
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
|
||||||
gg->SetCurrentLocalGenerator(lg);
|
gg.SetCurrentLocalGenerator(lg);
|
||||||
|
|
||||||
this->ReadAutogenInfoFile(lg->GetMakefile(), targetDirectory, config);
|
this->ReadAutogenInfoFile(lg->GetMakefile(), targetDirectory, config);
|
||||||
this->ReadOldMocDefinitionsFile(lg->GetMakefile(), targetDirectory);
|
this->ReadOldMocDefinitionsFile(lg->GetMakefile(), targetDirectory);
|
||||||
|
@ -1231,8 +1231,6 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
|
||||||
this->WriteOldMocDefinitionsFile(targetDirectory);
|
this->WriteOldMocDefinitionsFile(targetDirectory);
|
||||||
|
|
||||||
delete lg;
|
delete lg;
|
||||||
delete gg;
|
|
||||||
gg = NULL;
|
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue