summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-05-21 13:03:46 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2015-05-21 13:03:46 (GMT)
commite604bb1be9358f72b479b1710a3251b0cecca13c (patch)
tree7f18b930af13cad0c3689dad8ffc1f1ee002244f /Source
parentf05d9308c9c01949071a764acceb4bf88875f8a9 (diff)
parenta5b59fae15767be07fcc0c3750b706d3ed50f1f5 (diff)
downloadCMake-e604bb1be9358f72b479b1710a3251b0cecca13c.zip
CMake-e604bb1be9358f72b479b1710a3251b0cecca13c.tar.gz
CMake-e604bb1be9358f72b479b1710a3251b0cecca13c.tar.bz2
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.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmQtAutoGenerators.cxx37
1 files changed, 11 insertions, 26 deletions
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 3e7989f..d963f99 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -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);
+
+ cmLocalGenerator* lg = gg.MakeLocalGenerator();
+ lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
+ lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
+ gg.SetCurrentLocalGenerator(lg);
- this->ReadAutogenInfoFile(makefile, targetDirectory, config);
- this->ReadOldMocDefinitionsFile(makefile, targetDirectory);
+ 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;
}