From b7e6c418e3d7de531f6d2b5e0de154d955dc98c8 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 10 Dec 2024 11:20:40 -0500 Subject: cmLocalUnixMakefileGenerator3: Simplify progress command generation --- Source/cmLocalUnixMakefileGenerator3.cxx | 38 ++++++++++++-------------------- 1 file changed, 14 insertions(+), 24 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 4a776b4..d5d86b6 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -6,7 +6,6 @@ #include #include #include -#include #include #include @@ -1733,33 +1732,24 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules( depends.emplace_back("cmake_check_build_system"); } - std::string progressDir = - cmStrCat(this->GetBinaryDirectory(), "/CMakeFiles"); - { - std::ostringstream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; - progCmd << this->ConvertToOutputFormat(progressDir, - cmOutputConverter::SHELL); - - std::string progressFile = "/CMakeFiles/progress.marks"; - std::string progressFileNameFull = this->ConvertToFullPath(progressFile); - progCmd << " " - << this->ConvertToOutputFormat(progressFileNameFull, - cmOutputConverter::SHELL); - commands.push_back(progCmd.str()); - } + std::string const progressDir = this->ConvertToOutputFormat( + cmStrCat(this->GetBinaryDirectory(), "/CMakeFiles"), + cmOutputConverter::SHELL); + std::string const progressMarks = this->ConvertToOutputFormat( + this->ConvertToFullPath("/CMakeFiles/progress.marks"), + cmOutputConverter::SHELL); + std::string const progressStartCommand = + cmStrCat("$(CMAKE_COMMAND) -E cmake_progress_start ", progressDir, ' ', + progressMarks); + std::string const progressFinishCommand = + cmStrCat("$(CMAKE_COMMAND) -E cmake_progress_start ", progressDir, " 0"); + + commands.emplace_back(progressStartCommand); std::string mf2Dir = "CMakeFiles/Makefile2"; commands.push_back(this->GetRecursiveMakeCall(mf2Dir, recursiveTarget)); this->CreateCDCommand(commands, this->GetBinaryDirectory(), this->GetCurrentBinaryDirectory()); - { - std::ostringstream progCmd; - progCmd << "$(CMAKE_COMMAND) -E cmake_progress_start "; // # 0 - progCmd << this->ConvertToOutputFormat(progressDir, - cmOutputConverter::SHELL); - progCmd << " 0"; - commands.push_back(progCmd.str()); - } + commands.emplace_back(progressFinishCommand); this->WriteMakeRule(ruleFileStream, "The main all target", "all", depends, commands, true); -- cgit v0.12