Merge topic 'clean-up-cmQtAutoGenerators'
a5b59fae
QtAutogen: Create global generator on the stack.fe401ede
QtAutogen: Use a more-obvious delete-target.c95a55ad
QtAutogen: Remove the need for a local makefile variable.460e8fb9
QtAutogen: Inline static factory method.58f41c78
QtAutogen: Remove repeated setters.
This commit is contained in:
commit
e604bb1be9
|
@ -1203,23 +1203,6 @@ std::string cmQtAutoGenerators::GetRccExecutable(cmTarget const* target)
|
|||
return std::string();
|
||||
}
|
||||
|
||||
static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
|
||||
const std::string& targetDirectory)
|
||||
{
|
||||
cmGlobalGenerator* gg = new cmGlobalGenerator();
|
||||
gg->SetCMakeInstance(cm);
|
||||
|
||||
cm->SetHomeOutputDirectory(targetDirectory);
|
||||
cm->SetHomeDirectory(targetDirectory);
|
||||
|
||||
cmLocalGenerator* lg = gg->MakeLocalGenerator();
|
||||
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
|
||||
gg->SetCurrentLocalGenerator(lg);
|
||||
|
||||
return gg;
|
||||
}
|
||||
|
||||
bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
|
||||
const std::string& config)
|
||||
{
|
||||
|
@ -1227,25 +1210,27 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
|
|||
cmake cm;
|
||||
cm.SetHomeOutputDirectory(targetDirectory);
|
||||
cm.SetHomeDirectory(targetDirectory);
|
||||
cmGlobalGenerator* gg = CreateGlobalGenerator(&cm, targetDirectory);
|
||||
cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile();
|
||||
cmGlobalGenerator gg;
|
||||
gg.SetCMakeInstance(&cm);
|
||||
|
||||
this->ReadAutogenInfoFile(makefile, targetDirectory, config);
|
||||
this->ReadOldMocDefinitionsFile(makefile, targetDirectory);
|
||||
cmLocalGenerator* lg = gg.MakeLocalGenerator();
|
||||
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
|
||||
gg.SetCurrentLocalGenerator(lg);
|
||||
|
||||
this->ReadAutogenInfoFile(lg->GetMakefile(), targetDirectory, config);
|
||||
this->ReadOldMocDefinitionsFile(lg->GetMakefile(), targetDirectory);
|
||||
|
||||
this->Init();
|
||||
|
||||
if (this->QtMajorVersion == "4" || this->QtMajorVersion == "5")
|
||||
{
|
||||
success = this->RunAutogen(makefile);
|
||||
success = this->RunAutogen(lg->GetMakefile());
|
||||
}
|
||||
|
||||
this->WriteOldMocDefinitionsFile(targetDirectory);
|
||||
|
||||
delete gg->GetCurrentLocalGenerator();
|
||||
delete gg;
|
||||
gg = NULL;
|
||||
makefile = NULL;
|
||||
delete lg;
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue