summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2008-03-14 18:21:57 (GMT)
committerBrad King <brad.king@kitware.com>2008-03-14 18:21:57 (GMT)
commite395fee0805c4a862dd153ba0a4e5201ab8c1810 (patch)
treedc58313e5c67c9d31d709db1bf74197ebc53f073 /Source/cmComputeLinkInformation.cxx
parentf874cd684c5212405fdf3e88f50a9da0c8a11a29 (diff)
downloadCMake-e395fee0805c4a862dd153ba0a4e5201ab8c1810.zip
CMake-e395fee0805c4a862dd153ba0a4e5201ab8c1810.tar.gz
CMake-e395fee0805c4a862dd153ba0a4e5201ab8c1810.tar.bz2
ENH: Improve CMP0003 to provide more compatibility
- Targets built in the tree now add compatibility paths too - The warning message's first list includes at most one item for each unique compatibility path - Clarified error message further
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx20
1 files changed, 17 insertions, 3 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index f43cb55..ca6ed00 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1001,6 +1001,15 @@ void cmComputeLinkInformation::AddTargetItem(std::string const& item,
this->Items.push_back(Item(this->LibLinkFileFlag, false));
}
+ // For compatibility with CMake 2.4 include the item's directory in
+ // the linker search path.
+ if(this->OldLinkDirMode &&
+ this->OldLinkDirMask.find(cmSystemTools::GetFilenamePath(item)) ==
+ this->OldLinkDirMask.end())
+ {
+ this->OldLinkDirItems.push_back(item);
+ }
+
// Now add the full path to the library.
this->Items.push_back(Item(item, true));
}
@@ -1372,16 +1381,21 @@ void cmComputeLinkInformation::PrintLinkPolicyDiagnosis(std::ostream& os)
os << "Target \"" << this->Target->GetName() << "\" ";
// List the items that would add paths in old behavior.
- os << " links to some items with known full path:\n";
+ std::set<cmStdString> emitted;
+ os << " links to some items by full path not located in any linker search "
+ << "directory added by a link_directories command:\n";
for(std::vector<std::string>::const_iterator
i = this->OldLinkDirItems.begin();
i != this->OldLinkDirItems.end(); ++i)
{
- os << " " << *i << "\n";
+ if(emitted.insert(cmSystemTools::GetFilenamePath(*i)).second)
+ {
+ os << " " << *i << "\n";
+ }
}
// List the items that might need the old-style paths.
- os << "and to some items with no path known:\n";
+ os << "This is okay but it also links to some items with no path known:\n";
{
// Format the list of unknown items to be as short as possible while
// still fitting in the allowed width (a true solution would be the