summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2017-11-18 14:08:08 (GMT)
committerSebastian Holtermann <sebholt@xwmw.org>2017-11-19 11:51:31 (GMT)
commit2a85b5ac768cde4a9bbe98551528c8bae1e268a8 (patch)
tree2bb1ba0c521f353dd5c2fb1b8fd8a7b9a5c3ba85 /Source/cmGlobalGenerator.cxx
parent75819b8626abf0e64895ef19acd27dbd0fa9255b (diff)
downloadCMake-2a85b5ac768cde4a9bbe98551528c8bae1e268a8.zip
CMake-2a85b5ac768cde4a9bbe98551528c8bae1e268a8.tar.gz
CMake-2a85b5ac768cde4a9bbe98551528c8bae1e268a8.tar.bz2
Autogen: Make cmQtAutoGeneratorInitializer an instantiable class
Remove the cmQtAutoGenDigest classes and make cmQtAutoGeneratorInitializer instantiable instead.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx36
1 files changed, 14 insertions, 22 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index eba95f5..6e903fb 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1314,7 +1314,10 @@ bool cmGlobalGenerator::Compute()
#ifdef CMAKE_BUILD_WITH_CMAKE
// Iterate through all targets and set up automoc for those which have
// the AUTOMOC, AUTOUIC or AUTORCC property set
- cmQtAutoGenDigestUPV autogenDigests = this->CreateQtAutoGeneratorsTargets();
+ auto autogenInits = this->CreateQtAutoGenInitializers();
+ for (auto& autoGen : autogenInits) {
+ autoGen->InitCustomTargets();
+ }
#endif
// Add generator specific helper commands
@@ -1335,10 +1338,11 @@ bool cmGlobalGenerator::Compute()
}
#ifdef CMAKE_BUILD_WITH_CMAKE
- for (cmQtAutoGenDigestUP const& digest : autogenDigests) {
- cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(*digest);
+ for (auto& autoGen : autogenInits) {
+ autoGen->SetupCustomTargets();
+ autoGen.reset(nullptr);
}
- autogenDigests.clear();
+ autogenInits.clear();
#endif
for (cmLocalGenerator* localGen : this->LocalGenerators) {
@@ -1469,9 +1473,10 @@ bool cmGlobalGenerator::ComputeTargetDepends()
return true;
}
-cmQtAutoGenDigestUPV cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
+std::vector<std::unique_ptr<cmQtAutoGeneratorInitializer>>
+cmGlobalGenerator::CreateQtAutoGenInitializers()
{
- cmQtAutoGenDigestUPV autogenDigests;
+ std::vector<std::unique_ptr<cmQtAutoGeneratorInitializer>> autogenInits;
#ifdef CMAKE_BUILD_WITH_CMAKE
for (cmLocalGenerator* localGen : this->LocalGenerators) {
@@ -1507,25 +1512,12 @@ cmQtAutoGenDigestUPV cmGlobalGenerator::CreateQtAutoGeneratorsTargets()
continue;
}
- {
- cmQtAutoGenDigestUP digest(new cmQtAutoGenDigest(target));
- digest->QtVersionMajor = std::move(qtVersionMajor);
- digest->QtVersionMinor =
- cmQtAutoGeneratorInitializer::GetQtMinorVersion(
- target, digest->QtVersionMajor);
- digest->MocEnabled = mocEnabled;
- digest->UicEnabled = uicEnabled;
- digest->RccEnabled = rccEnabled;
- autogenDigests.emplace_back(std::move(digest));
- }
+ autogenInits.emplace_back(new cmQtAutoGeneratorInitializer(
+ target, mocEnabled, uicEnabled, rccEnabled, qtVersionMajor));
}
}
- // Initialize autogen targets
- for (const cmQtAutoGenDigestUP& digest : autogenDigests) {
- cmQtAutoGeneratorInitializer::InitializeAutogenTarget(*digest);
- }
#endif
- return autogenDigests;
+ return autogenInits;
}
cmLinkLineComputer* cmGlobalGenerator::CreateLinkLineComputer(