Commit 5454b41e authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'sanitize-LINK_DIRECTORIES'

0ad329f7

 Sanitize paths from LINK_DIRECTORIES directory property
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !1920
parents 58e847c4 0ad329f7
Pipeline #97836 passed with stage
in 0 seconds
......@@ -1836,12 +1836,10 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target)
std::vector<std::string> linkDirs;
cmSystemTools::ExpandListArgument(linkDirsProp, linkDirs);
for (std::string const& linkDir : linkDirs) {
std::string newdir = linkDir;
// remove trailing slashes
if (*linkDir.rbegin() == '/') {
newdir = linkDir.substr(0, linkDir.size() - 1);
}
for (std::string& linkDir : linkDirs) {
// Sanitize the path the same way the link_directories command does
// in case projects set the LINK_DIRECTORIES property directly.
cmSystemTools::ConvertToUnixSlashes(linkDir);
target.AddLinkDirectory(linkDir);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment