From 460e8fb9ad4eb58e06cefa0fce0df6f14644af4e Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Wed, 20 May 2015 00:17:30 +0200 Subject: [PATCH] QtAutogen: Inline static factory method. --- Source/cmQtAutoGenerators.cxx | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 79e7f70579..853a7069e0 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -1203,20 +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); - - 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) { @@ -1224,7 +1210,14 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory, cmake cm; cm.SetHomeOutputDirectory(targetDirectory); cm.SetHomeDirectory(targetDirectory); - cmGlobalGenerator* gg = CreateGlobalGenerator(&cm, targetDirectory); + cmGlobalGenerator* gg = new cmGlobalGenerator(); + gg->SetCMakeInstance(&cm); + + cmLocalGenerator* lg = gg->MakeLocalGenerator(); + lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory); + lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory); + gg->SetCurrentLocalGenerator(lg); + cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile(); this->ReadAutogenInfoFile(makefile, targetDirectory, config);