diff options
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 22 | ||||
-rw-r--r-- | Source/cmGlobalGenerator.h | 6 |
2 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index eb3f433..3563a1a 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1544,8 +1544,9 @@ bool cmGlobalGenerator::Compute() } #ifndef CMAKE_BOOTSTRAP - cmQtAutoGenGlobalInitializer qtAutoGen(this->LocalGenerators); - if (!qtAutoGen.InitializeCustomTargets()) { + this->QtAutoGen = + cm::make_unique<cmQtAutoGenGlobalInitializer>(this->LocalGenerators); + if (!this->QtAutoGen->InitializeCustomTargets()) { return false; } #endif @@ -1565,12 +1566,6 @@ bool cmGlobalGenerator::Compute() } } -#ifndef CMAKE_BOOTSTRAP - if (!qtAutoGen.SetupCustomTargets()) { - return false; - } -#endif - for (const auto& localGen : this->LocalGenerators) { cmMakefile* mf = localGen->GetMakefile(); for (const auto& g : mf->GetInstallGenerators()) { @@ -1635,6 +1630,17 @@ void cmGlobalGenerator::Generate() this->CMakeInstance->UpdateProgress("Generating", 0.1f); +#ifndef CMAKE_BOOTSTRAP + if (!this->QtAutoGen->SetupCustomTargets()) { + if (!cmSystemTools::GetErrorOccurredFlag()) { + this->GetCMakeInstance()->IssueMessage( + MessageType::FATAL_ERROR, + "Problem setting up custom targets for QtAutoGen"); + } + return; + } +#endif + // Generate project files for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) { this->SetCurrentMakefile(this->LocalGenerators[i]->GetMakefile()); diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 0e0624a..dde3648 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -50,6 +50,7 @@ class cmLinkLineComputer; class cmLocalGenerator; class cmMakefile; class cmOutputConverter; +class cmQtAutoGenGlobalInitializer; class cmSourceFile; class cmState; class cmStateDirectory; @@ -683,6 +684,11 @@ protected: cmake* CMakeInstance; std::vector<std::unique_ptr<cmMakefile>> Makefiles; LocalGeneratorVector LocalGenerators; + +#ifndef CMAKE_BOOTSTRAP + std::unique_ptr<cmQtAutoGenGlobalInitializer> QtAutoGen; +#endif + cmMakefile* CurrentConfigureMakefile; // map from project name to vector of local generators in that project std::map<std::string, std::vector<cmLocalGenerator*>> ProjectMap; |