Browse Source

strings: combine string literals where possible

Ben Boeckel 2 years ago
parent
commit
a5ba00bdf8

+ 8 - 5
Source/CPack/WiX/cmCPackWIXGenerator.cxx

@@ -104,8 +104,9 @@ bool cmCPackWIXGenerator::RunCandleCommand(std::string const& sourceFile,
 
   std::ostringstream command;
   command << QuotePath(executable);
-  command << " -nologo";
-  command << " -arch " << arch;
+  command << " -nologo"
+             " -arch "
+          << arch;
   command << " -out " << QuotePath(objectFile);
 
   for (std::string const& ext : CandleExtensions) {
@@ -132,8 +133,9 @@ bool cmCPackWIXGenerator::RunLightCommand(std::string const& objectFiles)
 
   std::ostringstream command;
   command << QuotePath(executable);
-  command << " -nologo";
-  command << " -out " << QuotePath(CMakeToWixPath(packageFileNames.at(0)));
+  command << " -nologo"
+             " -out "
+          << QuotePath(CMakeToWixPath(packageFileNames.at(0)));
 
   for (std::string const& ext : this->LightExtensions) {
     command << " -ext " << QuotePath(ext);
@@ -1183,7 +1185,8 @@ void cmCPackWIXGenerator::CollectXmlNamespaces(std::string const& variableName,
     } else {
       cmCPackLogger(cmCPackLog::LOG_ERROR,
                     "Invalid element in CPACK_WIX_CUSTOM_XMLNS ignored: "
-                      << "\"" << str << "\"" << std::endl);
+                    "\""
+                      << str << "\"" << std::endl);
     }
   }
   std::ostringstream oss;

+ 4 - 2
Source/cmGlobalVisualStudio10Generator.cxx

@@ -438,7 +438,8 @@ bool cmGlobalVisualStudio10Generator::InitializeSystem(cmMakefile* mf)
     if (this->PlatformInGeneratorName) {
       std::ostringstream e;
       e << "CMAKE_SYSTEM_NAME is 'Android' but CMAKE_GENERATOR "
-        << "specifies a platform too: '" << this->GetName() << "'";
+           "specifies a platform too: '"
+        << this->GetName() << "'";
       mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
       return false;
     }
@@ -468,7 +469,8 @@ bool cmGlobalVisualStudio10Generator::InitializeWindowsCE(cmMakefile* mf)
   if (this->PlatformInGeneratorName) {
     std::ostringstream e;
     e << "CMAKE_SYSTEM_NAME is 'WindowsCE' but CMAKE_GENERATOR "
-      << "specifies a platform too: '" << this->GetName() << "'";
+         "specifies a platform too: '"
+      << this->GetName() << "'";
     mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
     return false;
   }

+ 4 - 2
Source/cmGlobalVisualStudio11Generator.cxx

@@ -44,7 +44,8 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsPhone(cmMakefile* mf)
         << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
     } else {
       e << "A Windows Phone component with CMake requires both the Windows "
-        << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion
+           "Desktop SDK as well as the Windows Phone '"
+        << this->SystemVersion
         << "' SDK. Please make sure that you have both installed";
     }
     mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
@@ -62,7 +63,8 @@ bool cmGlobalVisualStudio11Generator::InitializeWindowsStore(cmMakefile* mf)
         << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
     } else {
       e << "A Windows Store component with CMake requires both the Windows "
-        << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+           "Desktop SDK as well as the Windows Store '"
+        << this->SystemVersion
         << "' SDK. Please make sure that you have both installed";
     }
     mf->IssueMessage(MessageType::FATAL_ERROR, e.str());

+ 4 - 2
Source/cmGlobalVisualStudio12Generator.cxx

@@ -159,7 +159,8 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsPhone(cmMakefile* mf)
         << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
     } else {
       e << "A Windows Phone component with CMake requires both the Windows "
-        << "Desktop SDK as well as the Windows Phone '" << this->SystemVersion
+           "Desktop SDK as well as the Windows Phone '"
+        << this->SystemVersion
         << "' SDK. Please make sure that you have both installed";
     }
     mf->IssueMessage(MessageType::FATAL_ERROR, e.str());
@@ -179,7 +180,8 @@ bool cmGlobalVisualStudio12Generator::InitializeWindowsStore(cmMakefile* mf)
         << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
     } else {
       e << "A Windows Store component with CMake requires both the Windows "
-        << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+           "Desktop SDK as well as the Windows Store '"
+        << this->SystemVersion
         << "' SDK. Please make sure that you have both installed";
     }
     mf->IssueMessage(MessageType::FATAL_ERROR, e.str());

+ 2 - 1
Source/cmGlobalVisualStudio14Generator.cxx

@@ -182,7 +182,8 @@ bool cmGlobalVisualStudio14Generator::InitializeWindowsStore(cmMakefile* mf)
         << this->SystemVersion << "'.  Check CMAKE_SYSTEM_VERSION.";
     } else {
       e << "A Windows Store component with CMake requires both the Windows "
-        << "Desktop SDK as well as the Windows Store '" << this->SystemVersion
+           "Desktop SDK as well as the Windows Store '"
+        << this->SystemVersion
         << "' SDK. Please make sure that you have both installed";
     }
     mf->IssueMessage(MessageType::FATAL_ERROR, e.str());

+ 3 - 3
Source/cmGlobalVisualStudio71Generator.cxx

@@ -136,9 +136,9 @@ void cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout,
          << uname << ".vcproj" << "\", \"{"
          << this->GetGUID(uname) << "}\"\n"
          << "\tProjectSection(ProjectDependencies) = postProject\n"
-         << "\t\t{" << guid << "} = {" << guid << "}\n"
-         << "\tEndProjectSection\n"
-         << "EndProject\n";
+            "\t\t{" << guid << "} = {" << guid << "}\n"
+            "\tEndProjectSection\n"
+            "EndProject\n";
     /* clang-format on */
   }
 }

+ 6 - 5
Source/cmVisualStudio10TargetGenerator.cxx

@@ -310,10 +310,11 @@ std::string cmVisualStudio10TargetGenerator::CalcCondition(
   // handle special case for 32 bit C# targets
   if (this->ProjectType == VsProjectType::csproj &&
       this->Platform == "Win32"_s) {
-    oss << " Or ";
-    oss << "'$(Configuration)|$(Platform)'=='";
-    oss << config << "|x86";
-    oss << "'";
+    oss << " Or "
+           "'$(Configuration)|$(Platform)'=='";
+    oss << config
+        << "|x86"
+           "'";
   }
   return oss.str();
 }
@@ -881,7 +882,7 @@ void cmVisualStudio10TargetGenerator::WriteClassicMsBuildProjectFile(
           oss << "      " << i << ";\n";
         }
         oss << "      "
-            << "$(BuildDependsOn)\n";
+               "$(BuildDependsOn)\n";
         e1.Element("BuildDependsOn", oss.str());
       }
     }