summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorOrkun Tokdemir <ilhanorkuntokdemir@gmail.com>2023-04-03 14:52:13 (GMT)
committerBrad King <brad.king@kitware.com>2023-04-05 20:12:16 (GMT)
commit69cf9700e6873a86094fe66c5091c21b909e1969 (patch)
tree40b06b875c47853a8ac6ddde5b01ad88454e2cbc /Source/cmGlobalGenerator.cxx
parent7cecb6353e0018fc2b4d0de83c209c0465b585ce (diff)
downloadCMake-69cf9700e6873a86094fe66c5091c21b909e1969.zip
CMake-69cf9700e6873a86094fe66c5091c21b909e1969.tar.gz
CMake-69cf9700e6873a86094fe66c5091c21b909e1969.tar.bz2
Autogen: Defer setup until Generate step
It is better to set variables up once all target dependencies are known.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx22
1 files changed, 14 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());