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) ...@@ -1836,12 +1836,10 @@ void cmMakefile::AddGlobalLinkInformation(cmTarget& target)
std::vector<std::string> linkDirs; std::vector<std::string> linkDirs;
cmSystemTools::ExpandListArgument(linkDirsProp, linkDirs); cmSystemTools::ExpandListArgument(linkDirsProp, linkDirs);
for (std::string const& linkDir : linkDirs) { for (std::string& linkDir : linkDirs) {
std::string newdir = linkDir; // Sanitize the path the same way the link_directories command does
// remove trailing slashes // in case projects set the LINK_DIRECTORIES property directly.
if (*linkDir.rbegin() == '/') { cmSystemTools::ConvertToUnixSlashes(linkDir);
newdir = linkDir.substr(0, linkDir.size() - 1);
}
target.AddLinkDirectory(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