From b6a957c9696706a338cdeef63540bf8a4c42d22d Mon Sep 17 00:00:00 2001 From: Bruno Manganelli Date: Fri, 23 Nov 2018 18:52:26 +0000 Subject: cmOutputConverter: move ConvertToRelativePath to cmStateDirectory. --- Source/cmStateDirectory.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Source/cmStateDirectory.cxx') diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx index 40f694c0d9..6752743a1f 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::iterator iter, const cmStateSnapshot& snapshot) -- cgit v1.2.1