diff options
author | Brad King <brad.king@kitware.com> | 2020-03-26 13:18:17 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-03-26 13:18:25 (GMT) |
commit | 6a0c1726e0c6c3381c7def2a5eff2ec239ba3abd (patch) | |
tree | af7e9adb05303f798367aeaf5300b5aee5c4df01 /Source/cmLocalGenerator.cxx | |
parent | 577fc3ef1942fd11791a4b6cd557b6da32daa5d6 (diff) | |
parent | 1e4b5c7d090fc77daa2aaede0bd57d476e3f45ed (diff) | |
download | CMake-6a0c1726e0c6c3381c7def2a5eff2ec239ba3abd.zip CMake-6a0c1726e0c6c3381c7def2a5eff2ec239ba3abd.tar.gz CMake-6a0c1726e0c6c3381c7def2a5eff2ec239ba3abd.tar.bz2 |
Merge topic 'cleanup-endls-2'
1e4b5c7d09 Refactor: Avoid `std::endl` where it's not necessary (part 2)
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4514
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index e7cc189..e908180 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -288,21 +288,23 @@ void cmLocalGenerator::GenerateTestFiles() cmGeneratedFileStream fout(file); fout.SetCopyIfDifferent(true); - fout << "# CMake generated Testfile for " << std::endl - << "# Source directory: " - << this->StateSnapshot.GetDirectory().GetCurrentSource() << std::endl - << "# Build directory: " - << this->StateSnapshot.GetDirectory().GetCurrentBinary() << std::endl - << "# " << std::endl - << "# This file includes the relevant testing commands " - << "required for " << std::endl - << "# testing this directory and lists subdirectories to " - << "be tested as well." << std::endl; + fout << "# CMake generated Testfile for \n" + "# Source directory: " + << this->StateSnapshot.GetDirectory().GetCurrentSource() + << "\n" + "# Build directory: " + << this->StateSnapshot.GetDirectory().GetCurrentBinary() + << "\n" + "# \n" + "# This file includes the relevant testing commands " + "required for \n" + "# testing this directory and lists subdirectories to " + "be tested as well.\n"; const char* testIncludeFile = this->Makefile->GetProperty("TEST_INCLUDE_FILE"); if (testIncludeFile) { - fout << "include(\"" << testIncludeFile << "\")" << std::endl; + fout << "include(\"" << testIncludeFile << "\")\n"; } const char* testIncludeFiles = @@ -310,7 +312,7 @@ void cmLocalGenerator::GenerateTestFiles() if (testIncludeFiles) { std::vector<std::string> includesList = cmExpandedList(testIncludeFiles); for (std::string const& i : includesList) { - fout << "include(\"" << i << "\")" << std::endl; + fout << "include(\"" << i << "\")\n"; } } @@ -327,7 +329,7 @@ void cmLocalGenerator::GenerateTestFiles() std::string outP = i.GetDirectory().GetCurrentBinary(); outP = this->MaybeConvertToRelativePath(parentBinDir, outP); outP = cmOutputConverter::EscapeForCMake(outP); - fout << "subdirs(" << outP << ")" << std::endl; + fout << "subdirs(" << outP << ")\n"; } // Add directory labels property @@ -346,7 +348,7 @@ void cmLocalGenerator::GenerateTestFiles() if (directoryLabels) { fout << cmOutputConverter::EscapeForCMake(directoryLabels); } - fout << ")" << std::endl; + fout << ")\n"; } } @@ -467,16 +469,17 @@ void cmLocalGenerator::GenerateInstallRules() fout.SetCopyIfDifferent(true); // Write the header. + /* clang-format off */ fout << "# Install script for directory: " - << this->StateSnapshot.GetDirectory().GetCurrentSource() << std::endl - << std::endl; - fout << "# Set the install prefix" << std::endl - << "if(NOT DEFINED CMAKE_INSTALL_PREFIX)" << std::endl - << " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")" << std::endl - << "endif()" << std::endl + << this->StateSnapshot.GetDirectory().GetCurrentSource() + << "\n\n" + "# Set the install prefix\n" + "if(NOT DEFINED CMAKE_INSTALL_PREFIX)\n" + " set(CMAKE_INSTALL_PREFIX \"" << prefix << "\")\n" + "endif()\n" << R"(string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX )" - << "\"${CMAKE_INSTALL_PREFIX}\")" << std::endl - << std::endl; + << "\"${CMAKE_INSTALL_PREFIX}\")\n\n"; + /* clang-format on */ // Write support code for generating per-configuration install rules. /* clang-format off */ @@ -591,8 +594,7 @@ void cmLocalGenerator::GenerateInstallRules() if (!c.GetDirectory().GetPropertyAsBool("EXCLUDE_FROM_ALL")) { std::string odir = c.GetDirectory().GetCurrentBinary(); cmSystemTools::ConvertToUnixSlashes(odir); - fout << " include(\"" << odir << "/cmake_install.cmake\")" - << std::endl; + fout << " include(\"" << odir << "/cmake_install.cmake\")\n"; } } fout << "\n"; @@ -949,8 +951,7 @@ void cmLocalGenerator::AddCompileOptions(std::vector<BT<std::string>>& flags, << "\". " "This is not permitted. The COMPILE_FEATURES may not both depend " "on " - "and be depended on by the link implementation." - << std::endl; + "and be depended on by the link implementation.\n"; this->IssueMessage(MessageType::FATAL_ERROR, e.str()); return; } |