summaryrefslogtreecommitdiffstats
path: root/Source/cmStateDirectory.cxx
diff options
context:
space:
mode:
authorBruno Manganelli <bruno.manga95@gmail.com>2018-11-23 18:52:26 (GMT)
committerBruno Manganelli <bruno.manga95@gmail.com>2019-01-27 15:48:57 (GMT)
commitb6a957c9696706a338cdeef63540bf8a4c42d22d (patch)
tree48b0536c2d1ba352576910dcfb44490b75ffde92 /Source/cmStateDirectory.cxx
parent05e4fa47738bf44e8ee6501b415df2899b10f6da (diff)
downloadCMake-b6a957c9696706a338cdeef63540bf8a4c42d22d.zip
CMake-b6a957c9696706a338cdeef63540bf8a4c42d22d.tar.gz
CMake-b6a957c9696706a338cdeef63540bf8a4c42d22d.tar.bz2
cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.
Diffstat (limited to 'Source/cmStateDirectory.cxx')
-rw-r--r--Source/cmStateDirectory.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 40f694c..6752743 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -155,6 +155,15 @@ bool cmStateDirectory::ContainsBoth(std::string const& local_path,
return bothInBinary || bothInSource;
}
+std::string cmStateDirectory::ConvertToRelPathIfNotContained(
+ std::string const& local_path, std::string const& remote_path) const
+{
+ if (!this->ContainsBoth(local_path, remote_path)) {
+ return remote_path;
+ }
+ return cmSystemTools::ForceToRelativePath(local_path, remote_path);
+}
+
cmStateDirectory::cmStateDirectory(
cmLinkedTree<cmStateDetail::BuildsystemDirectoryStateType>::iterator iter,
const cmStateSnapshot& snapshot)