summaryrefslogtreecommitdiffstats
path: root/Source/cmTargetLinkLibrariesCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index ca4bfda..df751da 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -3,6 +3,7 @@
#include "cmTargetLinkLibrariesCommand.h"
#include <cstring>
+#include <memory>
#include <sstream>
#include <unordered_set>
#include <utility>
@@ -81,11 +82,9 @@ bool cmTargetLinkLibrariesCommand(std::vector<std::string> const& args,
cmTarget* target =
mf.GetCMakeInstance()->GetGlobalGenerator()->FindTarget(args[0]);
if (!target) {
- const std::vector<cmTarget*>& importedTargets =
- mf.GetOwnedImportedTargets();
- for (cmTarget* importedTarget : importedTargets) {
+ for (const auto& importedTarget : mf.GetOwnedImportedTargets()) {
if (importedTarget->GetName() == args[0]) {
- target = importedTarget;
+ target = importedTarget.get();
break;
}
}