diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index bbc794dc1..77fbbe940 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -723,8 +723,9 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # in target - progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + progCmd << lg->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(progress.Dir), + cmOutputConverter::SHELL); // std::set emitted; progCmd << " " << this->CountProgressMarksInTarget(gtarget, emitted); @@ -736,8 +737,9 @@ void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules2( { std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << lg->Convert(progress.Dir, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + progCmd << lg->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(progress.Dir), + cmOutputConverter::SHELL); progCmd << " 0"; commands.push_back(progCmd.str()); } diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 2fa3f8687..de9e1e551 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -688,7 +688,9 @@ std::string cmLocalGenerator::ExpandRuleVariable( } } if (variable == "CMAKE_COMMAND") { - return this->Convert(cmSystemTools::GetCMakeCommand(), FULL, SHELL); + return this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(cmSystemTools::GetCMakeCommand()), + SHELL); } std::vector enabledLanguages = this->GetState()->GetEnabledLanguages(); @@ -1183,7 +1185,8 @@ void cmLocalGenerator::GetTargetFlags( if (sf->GetExtension() == "def") { linkFlags += this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); - linkFlags += this->Convert(sf->GetFullPath(), FULL, SHELL); + linkFlags += this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(sf->GetFullPath()), SHELL); linkFlags += " "; } } diff --git a/Source/cmLocalNinjaGenerator.cxx b/Source/cmLocalNinjaGenerator.cxx index bbec63426..d07bfaabe 100644 --- a/Source/cmLocalNinjaGenerator.cxx +++ b/Source/cmLocalNinjaGenerator.cxx @@ -133,7 +133,8 @@ std::string cmLocalNinjaGenerator::ConvertToIncludeReference( bool forceFullPaths) { if (forceFullPaths) { - return this->Convert(path, cmOutputConverter::FULL, format); + return this->ConvertToOutputFormat(cmSystemTools::CollapseFullPath(path), + format); } return this->Convert(path, cmOutputConverter::HOME_OUTPUT, format); } diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 5b83b3d24..3c4841eca 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -640,9 +640,9 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables( std::string cmakeShellCommand = this->MaybeConvertWatcomShellCommand(cmSystemTools::GetCMakeCommand()); if (cmakeShellCommand.empty()) { - cmakeShellCommand = - this->Convert(cmSystemTools::GetCMakeCommand(), cmOutputConverter::FULL, - cmOutputConverter::SHELL); + cmakeShellCommand = this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(cmSystemTools::GetCMakeCommand()), + cmOutputConverter::SHELL); } /* clang-format off */ @@ -665,16 +665,16 @@ void cmLocalUnixMakefileGenerator3::WriteMakeVariables( makefileStream << "# The top-level source directory on which CMake was run.\n" << "CMAKE_SOURCE_DIR = " - << this->Convert(this->GetSourceDirectory(), - cmOutputConverter::FULL, + << this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(this->GetSourceDirectory()), cmOutputConverter::SHELL) << "\n" << "\n"; makefileStream << "# The top-level build directory on which CMake was run.\n" << "CMAKE_BINARY_DIR = " - << this->Convert(this->GetBinaryDirectory(), - cmOutputConverter::FULL, + << this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(this->GetBinaryDirectory()), cmOutputConverter::SHELL) << "\n" << "\n"; @@ -1154,8 +1154,9 @@ void cmLocalUnixMakefileGenerator3::AppendEcho( cmd += color_name; if (progress) { cmd += "--progress-dir="; - cmd += this->Convert(progress->Dir, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + cmd += this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(progress->Dir), + cmOutputConverter::SHELL); cmd += " "; cmd += "--progress-num="; cmd += progress->Arg; @@ -1603,15 +1604,16 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( { std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; - progCmd << this->Convert(progressDir, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + progCmd << this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(progressDir), cmOutputConverter::SHELL); std::string progressFile = cmake::GetCMakeFilesDirectory(); progressFile += "/progress.marks"; std::string progressFileNameFull = this->ConvertToFullPath(progressFile); progCmd << " " - << this->Convert(progressFileNameFull, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + << this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(progressFileNameFull), + cmOutputConverter::SHELL); commands.push_back(progCmd.str()); } std::string mf2Dir = cmake::GetCMakeFilesDirectoryPostSlash(); @@ -1623,8 +1625,8 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( { std::ostringstream progCmd; progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << this->Convert(progressDir, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + progCmd << this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(progressDir), cmOutputConverter::SHELL); progCmd << " 0"; commands.push_back(progCmd.str()); } diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 1beaa87ac..70fe81955 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -269,8 +269,8 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule() args += this->GetBinaryDirectory(); commandLine.push_back(args); commandLine.push_back("--check-stamp-file"); - std::string stampFilename = this->Convert( - stampName.c_str(), cmOutputConverter::FULL, cmOutputConverter::SHELL); + std::string stampFilename = this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(stampName), cmOutputConverter::SHELL); commandLine.push_back(stampFilename.c_str()); std::vector const& listFiles = this->Makefile->GetListFiles(); diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index d1cefe300..b49296222 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -155,7 +155,8 @@ std::string cmLocalVisualStudioGenerator::ConstructScript( script += newline; newline = newline_text; script += "cd "; - script += this->Convert(workingDirectory, FULL, SHELL); + script += this->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(workingDirectory), SHELL); script += check_error; // Change the working drive. diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index b34cd6e07..165f96ce8 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1000,9 +1000,10 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // paths. Make sure PWD is set to the original name of the home // output directory to help cmSystemTools to create the same // translation table for the dependency scanning process. - depCmd << "cd " << (this->LocalGenerator->Convert( - this->LocalGenerator->GetBinaryDirectory(), - cmOutputConverter::FULL, cmOutputConverter::SHELL)) + depCmd << "cd " << (this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath( + this->LocalGenerator->GetBinaryDirectory()), + cmOutputConverter::SHELL)) << " && "; #endif // Generate a call this signature: @@ -1016,20 +1017,29 @@ void cmMakefileTargetGenerator::WriteTargetDependRules() // the state of our local generator sufficiently for its needs. depCmd << "$(CMAKE_COMMAND) -E cmake_depends \"" << this->GlobalGenerator->GetName() << "\" " - << this->Convert(this->LocalGenerator->GetSourceDirectory(), - cmOutputConverter::FULL, cmOutputConverter::SHELL) + << this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath( + this->LocalGenerator->GetSourceDirectory()), + cmOutputConverter::SHELL) << " " - << this->Convert(this->LocalGenerator->GetCurrentSourceDirectory(), - cmOutputConverter::FULL, cmOutputConverter::SHELL) + << this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath( + this->LocalGenerator->GetCurrentSourceDirectory()), + cmOutputConverter::SHELL) << " " - << this->Convert(this->LocalGenerator->GetBinaryDirectory(), - cmOutputConverter::FULL, cmOutputConverter::SHELL) + << this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath( + this->LocalGenerator->GetBinaryDirectory()), + cmOutputConverter::SHELL) << " " - << this->Convert(this->LocalGenerator->GetCurrentBinaryDirectory(), - cmOutputConverter::FULL, cmOutputConverter::SHELL) + << this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath( + this->LocalGenerator->GetCurrentBinaryDirectory()), + cmOutputConverter::SHELL) << " " - << this->Convert(this->InfoFileNameFull, cmOutputConverter::FULL, - cmOutputConverter::SHELL); + << this->LocalGenerator->ConvertToOutputFormat( + cmSystemTools::CollapseFullPath(this->InfoFileNameFull), + cmOutputConverter::SHELL); if (this->LocalGenerator->GetColorMakefile()) { depCmd << " --color=$(COLOR)"; }