diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index 0b02ae12f..331e3fde7 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -594,7 +594,7 @@ void cmComputeLinkInformation::AddItem(std::string const& item, cmTarget* tgt) std::string exe = tgt->GetFullPath(config, this->UseImportLibrary, true); linkItem += exe; - this->Items.push_back(Item(linkItem, true)); + this->Items.push_back(Item(linkItem, true, tgt)); this->Depends.push_back(exe); } else @@ -1020,7 +1020,7 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item, } // Now add the full path to the library. - this->Items.push_back(Item(item, true)); + this->Items.push_back(Item(item, true, target)); } //---------------------------------------------------------------------------- diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 0ce47bfa3..147b8ff8b 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -40,11 +40,14 @@ public: struct Item { - Item(): Value(), IsPath(true) {} - Item(Item const& item): Value(item.Value), IsPath(item.IsPath) {} - Item(std::string const& v, bool p): Value(v), IsPath(p) {} + Item(): Value(), IsPath(true), Target(0) {} + Item(Item const& item): + Value(item.Value), IsPath(item.IsPath), Target(item.Target) {} + Item(std::string const& v, bool p, cmTarget* target = 0): + Value(v), IsPath(p), Target(target) {} std::string Value; bool IsPath; + cmTarget* Target; }; typedef std::vector ItemVector; ItemVector const& GetItems();