summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-04-06 14:26:41 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-04-06 14:26:47 (GMT)
commit5454b41e1b95d154c4f6a0c1f191a4e794765d95 (patch)
tree991a1c670a46eba6249b46df1ffd7ce46fbb1fce /Source
parent58e847c49af0c9740c4e5d9648b180491e617266 (diff)
parent0ad329f7c09f67aa2ebae059fbbef6266c8f6515 (diff)
downloadCMake-5454b41e1b95d154c4f6a0c1f191a4e794765d95.zip
CMake-5454b41e1b95d154c4f6a0c1f191a4e794765d95.tar.gz
CMake-5454b41e1b95d154c4f6a0c1f191a4e794765d95.tar.bz2
Merge topic 'sanitize-LINK_DIRECTORIES'
0ad329f7c0 Sanitize paths from LINK_DIRECTORIES directory property Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1920
Diffstat (limited to 'Source')
-rw-r--r--Source/cmMakefile.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 3ecd7eb..bbe6cc9 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -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);
}
}