summaryrefslogtreecommitdiff
path: root/Source/cmComputeTargetDepends.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmComputeTargetDepends.cxx')
-rw-r--r--Source/cmComputeTargetDepends.cxx14
1 files changed, 6 insertions, 8 deletions
diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx
index 162bab2987..58ec53a713 100644
--- a/Source/cmComputeTargetDepends.cxx
+++ b/Source/cmComputeTargetDepends.cxx
@@ -4,6 +4,7 @@
#include <cassert>
#include <cstdio>
+#include <memory>
#include <sstream>
#include <utility>
@@ -157,15 +158,12 @@ void cmComputeTargetDepends::GetTargetDirectDepends(cmGeneratorTarget const* t,
void cmComputeTargetDepends::CollectTargets()
{
// Collect all targets from all generators.
- std::vector<cmLocalGenerator*> const& lgens =
- this->GlobalGenerator->GetLocalGenerators();
- for (cmLocalGenerator* lgen : lgens) {
- const std::vector<cmGeneratorTarget*>& targets =
- lgen->GetGeneratorTargets();
- for (cmGeneratorTarget const* ti : targets) {
+ auto const& lgens = this->GlobalGenerator->GetLocalGenerators();
+ for (const auto& lgen : lgens) {
+ for (const auto& ti : lgen->GetGeneratorTargets()) {
int index = static_cast<int>(this->Targets.size());
- this->TargetIndex[ti] = index;
- this->Targets.push_back(ti);
+ this->TargetIndex[ti.get()] = index;
+ this->Targets.push_back(ti.get());
}
}
}