cmLocalGenerator: Factor out relative path conversion helpers

Most calls to `MaybeConvertToRelativePath` use one of our common work
directories (e.g. top of the build tree) as the local path.  Add helpers
for each of the common cases to simplify and clarify call sites.
This commit is contained in:
Brad King
2021-05-12 15:51:47 -04:00
parent 1879f1bcbc
commit 15fa320071
23 changed files with 210 additions and 326 deletions

View File

@@ -207,10 +207,8 @@ std::string cmLocalVisualStudioGenerator::ConstructScript(
}
if (workingDirectory.empty()) {
script +=
this->ConvertToOutputFormat(this->MaybeConvertToRelativePath(
this->GetCurrentBinaryDirectory(), cmd),
cmOutputConverter::SHELL);
script += this->ConvertToOutputFormat(
this->MaybeRelativeToCurBinDir(cmd), cmOutputConverter::SHELL);
} else {
script += this->ConvertToOutputFormat(cmd.c_str(), SHELL);
}