summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalUnixMakefileGenerator3.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/cmGlobalUnixMakefileGenerator3.cxx
parent05e4fa47738bf44e8ee6501b415df2899b10f6da (diff)
downloadCMake-b6a957c9696706a338cdeef63540bf8a4c42d22d.zip
CMake-b6a957c9696706a338cdeef63540bf8a4c42d22d.tar.gz
CMake-b6a957c9696706a338cdeef63540bf8a4c42d22d.tar.bz2
cmOutputConverter: move ConvertToRelativePath to cmStateDirectory.
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r--Source/cmGlobalUnixMakefileGenerator3.cxx21
1 files changed, 13 insertions, 8 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx
index 52bb046..9d176c3 100644
--- a/Source/cmGlobalUnixMakefileGenerator3.cxx
+++ b/Source/cmGlobalUnixMakefileGenerator3.cxx
@@ -325,7 +325,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
<< "set(CMAKE_MAKEFILE_DEPENDS\n"
<< " \"CMakeCache.txt\"\n";
for (std::string const& f : lfiles) {
- cmakefileStream << " \"" << lg->ConvertToRelativePath(currentBinDir, f)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(currentBinDir, f)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -339,9 +340,11 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
cmakefileStream << "# The corresponding makefile is:\n"
<< "set(CMAKE_MAKEFILE_OUTPUTS\n"
<< " \""
- << lg->ConvertToRelativePath(currentBinDir, makefileName)
+ << lg->MaybeConvertToRelativePath(currentBinDir,
+ makefileName)
<< "\"\n"
- << " \"" << lg->ConvertToRelativePath(currentBinDir, check)
+ << " \""
+ << lg->MaybeConvertToRelativePath(currentBinDir, check)
<< "\"\n";
cmakefileStream << " )\n\n";
@@ -354,7 +357,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
const std::vector<std::string>& outfiles =
lg->GetMakefile()->GetOutputFiles();
for (std::string const& outfile : outfiles) {
- cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, outfile)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(binDir, outfile)
<< "\"\n";
}
@@ -365,7 +369,8 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile()
tmpStr = lg->GetCurrentBinaryDirectory();
tmpStr += cmake::GetCMakeFilesDirectory();
tmpStr += "/CMakeDirectoryInformation.cmake";
- cmakefileStream << " \"" << lg->ConvertToRelativePath(binDir, tmpStr)
+ cmakefileStream << " \""
+ << lg->MaybeConvertToRelativePath(binDir, tmpStr)
<< "\"\n";
}
cmakefileStream << " )\n\n";
@@ -474,7 +479,7 @@ void cmGlobalUnixMakefileGenerator3::WriteDirectoryRules2(
// Begin the directory-level rules section.
std::string dir =
- cmSystemTools::ConvertToOutputPath(lg->ConvertToRelativePath(
+ cmSystemTools::ConvertToOutputPath(lg->MaybeConvertToRelativePath(
lg->GetBinaryDirectory(), lg->GetCurrentBinaryDirectory()));
lg->WriteDivider(ruleFileStream);
ruleFileStream << "# Directory level rules for directory " << dir << "\n\n";
@@ -526,9 +531,9 @@ void cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
if (fast) {
tname += "/fast";
}
- cmOutputConverter conv(mf->GetStateSnapshot());
tname =
- conv.ConvertToRelativePath(mf->GetState()->GetBinaryDirectory(), tname);
+ mf->GetStateSnapshot().GetDirectory().ConvertToRelPathIfNotContained(
+ mf->GetState()->GetBinaryDirectory(), tname);
cmSystemTools::ConvertToOutputSlashes(tname);
makeCommand.push_back(std::move(tname));
}