summaryrefslogtreecommitdiffstats
path: root/Source/cmQtAutoGenGlobalInitializer.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2019-11-07 17:52:06 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2019-11-11 15:41:13 (GMT)
commitf93385283fc86639c0a13b920c66c3a8f42276bb (patch)
tree7fa219d170720581d6d8438d0be6a1162e0c3b51 /Source/cmQtAutoGenGlobalInitializer.cxx
parent101b5288ffa988b86fc1fe83f3ff65c9694b1484 (diff)
downloadCMake-f93385283fc86639c0a13b920c66c3a8f42276bb.zip
CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.gz
CMake-f93385283fc86639c0a13b920c66c3a8f42276bb.tar.bz2
cmLocalGenerator: modernize memory management
Diffstat (limited to 'Source/cmQtAutoGenGlobalInitializer.cxx')
-rw-r--r--Source/cmQtAutoGenGlobalInitializer.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx b/Source/cmQtAutoGenGlobalInitializer.cxx
index ef6b886..4792860 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -73,7 +73,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
}
// Find targets that require AUTOMOC/UIC/RCC processing
- for (cmGeneratorTarget* target : localGen->GetGeneratorTargets()) {
+ for (const auto& target : localGen->GetGeneratorTargets()) {
// Process only certain target types
switch (target->GetType()) {
case cmStateEnums::EXECUTABLE:
@@ -104,7 +104,7 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
target->GetSafeProperty(kw().AUTORCC_EXECUTABLE);
// We support Qt4, Qt5 and Qt6
- auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target);
+ auto qtVersion = cmQtAutoGenInitializer::GetQtVersion(target.get());
bool const validQt = (qtVersion.first.Major == 4) ||
(qtVersion.first.Major == 5) || (qtVersion.first.Major == 6);
@@ -135,8 +135,8 @@ cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
if (mocIsValid || uicIsValid || rccIsValid) {
// Create autogen target initializer
Initializers_.emplace_back(cm::make_unique<cmQtAutoGenInitializer>(
- this, target, qtVersion.first, mocIsValid, uicIsValid, rccIsValid,
- globalAutoGenTarget, globalAutoRccTarget));
+ this, target.get(), qtVersion.first, mocIsValid, uicIsValid,
+ rccIsValid, globalAutoGenTarget, globalAutoRccTarget));
}
}
}
@@ -160,7 +160,8 @@ void cmQtAutoGenGlobalInitializer::GetOrCreateGlobalTarget(
std::vector<std::string>() /*output*/,
std::vector<std::string>() /*depends*/, cmCustomCommandLines(), false,
comment.c_str());
- localGen->AddGeneratorTarget(new cmGeneratorTarget(target, localGen));
+ localGen->AddGeneratorTarget(
+ cm::make_unique<cmGeneratorTarget>(target, localGen));
// Set FOLDER property in the target
{