diff options
author | Brad King <brad.king@kitware.com> | 2021-05-14 16:57:06 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-05-17 14:02:16 (GMT) |
commit | 5b3a71a83faf913aa4a9644779ae35c9d5eda733 (patch) | |
tree | 03c012dd1fa62ba1330e4c064bf6a8069aa5266f /Source/cmFileAPICodemodel.cxx | |
parent | ea9b1d36b8cdf384903021d41ca665848895480f (diff) | |
download | CMake-5b3a71a83faf913aa4a9644779ae35c9d5eda733.zip CMake-5b3a71a83faf913aa4a9644779ae35c9d5eda733.tar.gz CMake-5b3a71a83faf913aa4a9644779ae35c9d5eda733.tar.bz2 |
cmSystemTools: Adopt RelativeIfUnder helper
This returns a relative path if it does not start in `../`.
Diffstat (limited to 'Source/cmFileAPICodemodel.cxx')
-rw-r--r-- | Source/cmFileAPICodemodel.cxx | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/Source/cmFileAPICodemodel.cxx b/Source/cmFileAPICodemodel.cxx index 6b8757c..6b35842 100644 --- a/Source/cmFileAPICodemodel.cxx +++ b/Source/cmFileAPICodemodel.cxx @@ -57,15 +57,7 @@ using TargetIndexMapType = std::string RelativeIfUnder(std::string const& top, std::string const& in) { - std::string out; - if (in == top) { - out = "."; - } else if (cmSystemTools::IsSubDirectory(in, top)) { - out = in.substr(top.size() + 1); - } else { - out = in; - } - return out; + return cmSystemTools::RelativeIfUnder(top, in); } class JBTIndex |