diff options
author | Stephen Kelly <steveire@gmail.com> | 2016-08-27 11:44:57 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2016-08-27 13:41:17 (GMT) |
commit | 58ba87f892316b9f9cbb7851a940ec808527e36a (patch) | |
tree | aea9e1d7898e6d8baffc74b1ea6abd5937fb955a /Source | |
parent | e80314d7a8208214ac85bf9b2e769a7e3b5aaa04 (diff) | |
download | CMake-58ba87f892316b9f9cbb7851a940ec808527e36a.zip CMake-58ba87f892316b9f9cbb7851a940ec808527e36a.tar.gz CMake-58ba87f892316b9f9cbb7851a940ec808527e36a.tar.bz2 |
Convert: Replace Convert(FULL) with equivalent
This is more explicit than funnelling everything through the Convert
method.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 10 | ||||
-rw-r--r-- | Source/cmLocalGenerator.cxx | 7 | ||||
-rw-r--r-- | Source/cmLocalNinjaGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 32 | ||||
-rw-r--r-- | Source/cmLocalVisualStudio7Generator.cxx | 4 | ||||
-rw-r--r-- | Source/cmLocalVisualStudioGenerator.cxx | 3 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 36 |
7 files changed, 57 insertions, 38 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index bbc794d..77fbbe9 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<cmGeneratorTarget const*> 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 2fa3f86..de9e1e5 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<std::string> 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 bbec634..d07bfaa 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 5b83b3d..3c4841e 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 1beaa87..70fe819 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<std::string> const& listFiles = this->Makefile->GetListFiles(); diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index d1cefe3..b492962 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 b34cd6e..165f96c 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)"; } |