summaryrefslogtreecommitdiffstats
path: root/Source/cmOutputConverter.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2016-08-27 11:44:56 (GMT)
committerStephen Kelly <steveire@gmail.com>2016-08-27 13:26:37 (GMT)
commit564d3a1dc8e19f16db6ddccca38e21d89634c1b4 (patch)
tree895b012d8e95a56a71bf636907d3adabf76bda18 /Source/cmOutputConverter.cxx
parent95a659f1801701b02528c22f0287bb57056dc627 (diff)
downloadCMake-564d3a1dc8e19f16db6ddccca38e21d89634c1b4.zip
CMake-564d3a1dc8e19f16db6ddccca38e21d89634c1b4.tar.gz
CMake-564d3a1dc8e19f16db6ddccca38e21d89634c1b4.tar.bz2
Convert: Extract ConvertToRelativePath from Convert()
Convert() does some kind of relative conversion, followed by a conversion to 'output format'. Make it possible to do the former without the latter.
Diffstat (limited to 'Source/cmOutputConverter.cxx')
-rw-r--r--Source/cmOutputConverter.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/cmOutputConverter.cxx b/Source/cmOutputConverter.cxx
index 80fa4bf..176c9a0 100644
--- a/Source/cmOutputConverter.cxx
+++ b/Source/cmOutputConverter.cxx
@@ -46,11 +46,9 @@ std::string cmOutputConverter::ConvertToOutputForExisting(
return this->ConvertToOutputFormat(remote, format);
}
-std::string cmOutputConverter::Convert(const std::string& source,
- RelativeRoot relative,
- OutputFormat output) const
+std::string cmOutputConverter::ConvertToRelativePath(
+ const std::string& source, RelativeRoot relative) const
{
- // Convert the path to a relative path.
std::string result = source;
switch (relative) {
@@ -76,6 +74,15 @@ std::string cmOutputConverter::Convert(const std::string& source,
result = cmSystemTools::CollapseFullPath(result);
break;
}
+ return result;
+}
+
+std::string cmOutputConverter::Convert(const std::string& source,
+ RelativeRoot relative,
+ OutputFormat output) const
+{
+ // Convert the path to a relative path.
+ std::string result = this->ConvertToRelativePath(source, relative);
return this->ConvertToOutputFormat(result, output);
}