diff options
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index ad59748..1d9ecc2 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -3,6 +3,7 @@ #include "cmTargetLinkLibrariesCommand.h" #include <cstring> +#include <memory> #include <sstream> #include "cmExecutionStatus.h" @@ -64,11 +65,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; } } |