This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
       via  1263b0884bbad60b4f21d70a59a11647d30d54a8 (commit)
       via  7891f69c67122eca2cba9f2c58fa0f1d49eba9bc (commit)
       via  6f3c429ee82eda7fccf70de32d6f8cba4079e94e (commit)
       via  1a47d368d8925c8c7e3a8afc75f9592058cce100 (commit)
       via  ca2923110c9999c5cd538a91ec61b10d0b336c48 (commit)
       via  d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22 (commit)
       via  2171f6ec0ea3ca373db94bc55d8b7db999de97cc (commit)
      from  1a901ed09e27387f14d419adb407e7964d176f37 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1263b0884bbad60b4f21d70a59a11647d30d54a8
commit 1263b0884bbad60b4f21d70a59a11647d30d54a8
Merge: 7891f69 1a47d36
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Aug 9 14:31:20 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Aug 9 10:37:25 2019 -0400

    Merge topic 'cmDefinitions_cleanups'
    
    1a47d368d8 cmDefinitions: Cleanups and optimizations
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3666


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7891f69c67122eca2cba9f2c58fa0f1d49eba9bc
commit 7891f69c67122eca2cba9f2c58fa0f1d49eba9bc
Merge: 6f3c429 ca29231
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Aug 9 14:29:22 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Aug 9 10:33:00 2019 -0400

    Merge topic 'autogen_cmStrCat'
    
    ca2923110c Autogen: Modernize to use cmStrCat for string concatenation
    d02a99d9d3 Autogen: Modernize code to use cm::string_view for the info 
writer
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3663


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6f3c429ee82eda7fccf70de32d6f8cba4079e94e
commit 6f3c429ee82eda7fccf70de32d6f8cba4079e94e
Merge: 1a901ed 2171f6e
Author:     Brad King <brad.k...@kitware.com>
AuthorDate: Fri Aug 9 14:28:15 2019 +0000
Commit:     Kitware Robot <kwro...@kitware.com>
CommitDate: Fri Aug 9 10:30:45 2019 -0400

    Merge topic 'soname-darwin'
    
    2171f6ec0e Swift: correct SONAME flag for Darwin targets
    
    Acked-by: Kitware Robot <kwro...@kitware.com>
    Merge-request: !3640


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1a47d368d8925c8c7e3a8afc75f9592058cce100
commit 1a47d368d8925c8c7e3a8afc75f9592058cce100
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Thu Aug 8 13:50:47 2019 +0200
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Thu Aug 8 14:12:43 2019 +0200

    cmDefinitions: Cleanups and optimizations
    
    In cmDefinitions:
    - sort methods in source code by static or not static
    - use `std::unordered_set<cm::string_view>` instead of 
`std::set<std::string>`
      for duplications tests.

diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx
index 42e70d6..cc38d84 100644
--- a/Source/cmDefinitions.cxx
+++ b/Source/cmDefinitions.cxx
@@ -2,8 +2,11 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmDefinitions.h"
 
+#include "cm_string_view.hxx"
+
 #include <assert.h>
-#include <set>
+#include <functional>
+#include <unordered_set>
 #include <utility>
 
 cmDefinitions::Def cmDefinitions::NoDef;
@@ -14,7 +17,7 @@ cmDefinitions::Def const& cmDefinitions::GetInternal(const 
std::string& key,
 {
   assert(begin != end);
   {
-    MapType::iterator it = begin->Map.find(key);
+    auto it = begin->Map.find(key);
     if (it != begin->Map.end()) {
       it->second.Used = true;
       return it->second;
@@ -56,33 +59,10 @@ bool cmDefinitions::HasKey(const std::string& key, 
StackIter begin,
   return false;
 }
 
-void cmDefinitions::Set(const std::string& key, cm::string_view value)
-{
-  this->Map[key] = Def(value);
-}
-
-void cmDefinitions::Unset(const std::string& key)
-{
-  this->Map[key] = Def();
-}
-
-std::vector<std::string> cmDefinitions::UnusedKeys() const
-{
-  std::vector<std::string> keys;
-  keys.reserve(this->Map.size());
-  // Consider local definitions.
-  for (auto const& mi : this->Map) {
-    if (!mi.second.Used) {
-      keys.push_back(mi.first);
-    }
-  }
-  return keys;
-}
-
 cmDefinitions cmDefinitions::MakeClosure(StackIter begin, StackIter end)
 {
   cmDefinitions closure;
-  std::set<std::string> undefined;
+  std::unordered_set<cm::string_view> undefined;
   for (StackIter it = begin; it != end; ++it) {
     // Consider local definitions.
     for (auto const& mi : it->Map) {
@@ -92,7 +72,7 @@ cmDefinitions cmDefinitions::MakeClosure(StackIter begin, 
StackIter end)
         if (mi.second.Exists) {
           closure.Map.insert(mi);
         } else {
-          undefined.insert(mi.first);
+          undefined.emplace(mi.first);
         }
       }
     }
@@ -104,13 +84,13 @@ std::vector<std::string> 
cmDefinitions::ClosureKeys(StackIter begin,
                                                     StackIter end)
 {
   std::vector<std::string> defined;
-  std::set<std::string> bound;
+  std::unordered_set<cm::string_view> bound;
 
   for (StackIter it = begin; it != end; ++it) {
     defined.reserve(defined.size() + it->Map.size());
     for (auto const& mi : it->Map) {
       // Use this key if it is not already set or unset.
-      if (bound.insert(mi.first).second && mi.second.Exists) {
+      if (bound.emplace(mi.first).second && mi.second.Exists) {
         defined.push_back(mi.first);
       }
     }
@@ -118,3 +98,26 @@ std::vector<std::string> 
cmDefinitions::ClosureKeys(StackIter begin,
 
   return defined;
 }
+
+void cmDefinitions::Set(const std::string& key, cm::string_view value)
+{
+  this->Map[key] = Def(value);
+}
+
+void cmDefinitions::Unset(const std::string& key)
+{
+  this->Map[key] = Def();
+}
+
+std::vector<std::string> cmDefinitions::UnusedKeys() const
+{
+  std::vector<std::string> keys;
+  keys.reserve(this->Map.size());
+  // Consider local definitions.
+  for (auto const& mi : this->Map) {
+    if (!mi.second.Used) {
+      keys.push_back(mi.first);
+    }
+  }
+  return keys;
+}
diff --git a/Source/cmDefinitions.h b/Source/cmDefinitions.h
index 4d8810a..787471a 100644
--- a/Source/cmDefinitions.h
+++ b/Source/cmDefinitions.h
@@ -25,6 +25,8 @@ class cmDefinitions
   typedef cmLinkedTree<cmDefinitions>::iterator StackIter;
 
 public:
+  // -- Static member functions
+
   static const std::string* Get(const std::string& key, StackIter begin,
                                 StackIter end);
 
@@ -32,18 +34,21 @@ public:
 
   static bool HasKey(const std::string& key, StackIter begin, StackIter end);
 
+  static std::vector<std::string> ClosureKeys(StackIter begin, StackIter end);
+
+  static cmDefinitions MakeClosure(StackIter begin, StackIter end);
+
+  // -- Member functions
+
   /** Set a value associated with a key.  */
   void Set(const std::string& key, cm::string_view value);
 
   /** Unset a definition.  */
   void Unset(const std::string& key);
 
+  /** List of unused keys.  */
   std::vector<std::string> UnusedKeys() const;
 
-  static std::vector<std::string> ClosureKeys(StackIter begin, StackIter end);
-
-  static cmDefinitions MakeClosure(StackIter begin, StackIter end);
-
 private:
   /** String with existence boolean.  */
   struct Def
@@ -61,8 +66,7 @@ private:
   };
   static Def NoDef;
 
-  typedef std::unordered_map<std::string, Def> MapType;
-  MapType Map;
+  std::unordered_map<std::string, Def> Map;
 
   static Def const& GetInternal(const std::string& key, StackIter begin,
                                 StackIter end, bool raise);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ca2923110c9999c5cd538a91ec61b10d0b336c48
commit ca2923110c9999c5cd538a91ec61b10d0b336c48
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Tue Aug 6 10:40:49 2019 +0200
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Wed Aug 7 19:48:02 2019 +0200

    Autogen: Modernize to use cmStrCat for string concatenation

diff --git a/Source/cmQtAutoGen.cxx b/Source/cmQtAutoGen.cxx
index 712e22c..3026b33 100644
--- a/Source/cmQtAutoGen.cxx
+++ b/Source/cmQtAutoGen.cxx
@@ -353,9 +353,8 @@ bool cmQtAutoGen::RccLister::list(std::string const& 
qrcFile,
 
       // Log command
       if (verbose) {
-        std::string msg = "Running command:\n";
-        msg += QuotedCommand(cmd);
-        msg += '\n';
+        std::string msg =
+          cmStrCat("Running command:\n", QuotedCommand(cmd), '\n');
         cmSystemTools::Stdout(msg);
       }
 
diff --git a/Source/cmQtAutoGenGlobalInitializer.cxx 
b/Source/cmQtAutoGenGlobalInitializer.cxx
index f172b77..ca5a587 100644
--- a/Source/cmQtAutoGenGlobalInitializer.cxx
+++ b/Source/cmQtAutoGenGlobalInitializer.cxx
@@ -1,8 +1,6 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQtAutoGenGlobalInitializer.h"
-#include "cmQtAutoGen.h"
-#include "cmQtAutoGenInitializer.h"
 
 #include "cmCustomCommandLines.h"
 #include "cmDuration.h"
@@ -11,15 +9,18 @@
 #include "cmMakefile.h"
 #include "cmMessageType.h"
 #include "cmProcessOutput.h"
+#include "cmQtAutoGen.h"
+#include "cmQtAutoGenInitializer.h"
 #include "cmState.h"
 #include "cmStateTypes.h"
+#include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmTarget.h"
 
-#include <utility>
-
 #include "cm_memory.hxx"
 
+#include <utility>
+
 cmQtAutoGenGlobalInitializer::Keywords::Keywords()
   : AUTOMOC("AUTOMOC")
   , AUTOUIC("AUTOUIC")
@@ -119,23 +120,17 @@ 
cmQtAutoGenGlobalInitializer::cmQtAutoGenGlobalInitializer(
         bool const uicDisabled = (uic && !uicAvailable);
         bool const rccDisabled = (rcc && !rccAvailable);
         if (mocDisabled || uicDisabled || rccDisabled) {
-          std::string msg = "AUTOGEN: No valid Qt version found for target ";
-          msg += target->GetName();
-          msg += ". ";
-          msg += cmQtAutoGen::Tools(mocDisabled, uicDisabled, rccDisabled);
-          msg += " disabled.  Consider adding:\n";
-          {
-            std::string version = (qtVersion.second == 0)
-              ? std::string("<QTVERSION>")
-              : std::to_string(qtVersion.second);
-            std::string comp = uicDisabled ? "Widgets" : "Core";
-            msg += "  find_package(Qt";
-            msg += version;
-            msg += " COMPONENTS ";
-            msg += comp;
-            msg += ")\n";
-          }
-          msg += "to your CMakeLists.txt file.";
+          cmAlphaNum version = (qtVersion.second == 0)
+            ? cmAlphaNum("<QTVERSION>")
+            : cmAlphaNum(qtVersion.second);
+          cmAlphaNum component = uicDisabled ? "Widgets" : "Core";
+
+          std::string const msg = cmStrCat(
+            "AUTOGEN: No valid Qt version found for target ",
+            target->GetName(), ".  ",
+            cmQtAutoGen::Tools(mocDisabled, uicDisabled, rccDisabled),
+            " disabled.  Consider adding:\n", "  find_package(Qt", version,
+            " COMPONENTS ", component, ")\n", "to your CMakeLists.txt file.");
           target->Makefile->IssueMessage(MessageType::AUTHOR_WARNING, msg);
         }
         if (mocIsValid || uicIsValid || rccIsValid) {
diff --git a/Source/cmQtAutoGenInitializer.cxx 
b/Source/cmQtAutoGenInitializer.cxx
index 7e72fd6..360df25 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -716,14 +716,13 @@ bool cmQtAutoGenInitializer::InitScanFiles()
       if (muf.MocIt || muf.UicIt) {
         // Search for the default header file and a private header
         std::string const& srcPath = muf.SF->GetFullPath();
-        std::string basePath = cmQtAutoGen::SubDirPrefix(srcPath);
-        basePath += cmSystemTools::GetFilenameWithoutLastExtension(srcPath);
+        std::string basePath =
+          cmStrCat(cmQtAutoGen::SubDirPrefix(srcPath),
+                   cmSystemTools::GetFilenameWithoutLastExtension(srcPath));
         for (auto const& suffix : suffixes) {
           std::string const suffixedPath = basePath + suffix;
           for (auto const& ext : exts) {
-            std::string fullPath = suffixedPath;
-            fullPath += '.';
-            fullPath += ext;
+            std::string fullPath = cmStrCat(suffixedPath, '.', ext);
 
             auto constexpr locationKind = cmSourceFileLocationKind::Known;
             cmSourceFile* sf = makefile->GetSource(fullPath, locationKind);
@@ -828,9 +827,8 @@ bool cmQtAutoGenInitializer::InitScanFiles()
         this->AutogenTarget.DependFiles.insert(muf->RealPath);
       }
     } else if (this->CMP0071Warn) {
-      std::string msg;
-      msg += cmPolicies::GetPolicyWarning(cmPolicies::CMP0071);
-      msg += '\n';
+      std::string msg =
+        cmStrCat(cmPolicies::GetPolicyWarning(cmPolicies::CMP0071), '\n');
       std::string property;
       if (this->Moc.Enabled && this->Uic.Enabled) {
         property = kw.SKIP_AUTOGEN;
@@ -883,18 +881,10 @@ bool cmQtAutoGenInitializer::InitScanFiles()
       for (Qrc& qrc : this->Rcc.Qrcs) {
         qrc.PathChecksum = fpathCheckSum.getPart(qrc.QrcFile);
         // RCC output file name
+        qrc.RccFile = cmStrCat(this->Dir.Build + "/", qrc.PathChecksum,
+                               "/qrc_", qrc.QrcName, ".cpp");
         {
-          std::string rccFile = this->Dir.Build + "/";
-          rccFile += qrc.PathChecksum;
-          rccFile += "/qrc_";
-          rccFile += qrc.QrcName;
-          rccFile += ".cpp";
-          qrc.RccFile = std::move(rccFile);
-        }
-        {
-          std::string base = this->Dir.Info;
-          base += "/RCC";
-          base += qrc.QrcName;
+          std::string base = cmStrCat(this->Dir.Info, "/RCC", qrc.QrcName);
           if (!qrc.Unique) {
             base += qrc.PathChecksum;
           }
@@ -927,8 +917,7 @@ bool cmQtAutoGenInitializer::InitScanFiles()
         // Replace '-' with '_'. The former is not valid for symbol names.
         std::replace(name.begin(), name.end(), '-', '_');
         if (!qrc.Unique) {
-          name += "_";
-          name += qrc.PathChecksum;
+          name += cmStrCat("_", qrc.PathChecksum);
         }
         std::vector<std::string> nameOpts;
         nameOpts.emplace_back("-name");
@@ -1152,8 +1141,8 @@ bool cmQtAutoGenInitializer::InitRccTargets()
       currentLine.push_back("$<CONFIG>");
       commandLines.push_back(std::move(currentLine));
     }
-    std::string ccComment = "Automatic RCC for ";
-    ccComment += FileProjectRelativePath(makefile, qrc.QrcFile);
+    std::string ccComment = cmStrCat(
+      "Automatic RCC for ", FileProjectRelativePath(makefile, qrc.QrcFile));
 
     if (qrc.Generated || this->Rcc.GlobalTarget) {
       // Create custom rcc target
@@ -1221,9 +1210,8 @@ bool cmQtAutoGenInitializer::SetupCustomTargets()
 {
   // Create info directory on demand
   if (!cmSystemTools::MakeDirectory(this->Dir.Info)) {
-    std::string emsg = ("AutoGen: Could not create directory: ");
-    emsg += Quoted(this->Dir.Info);
-    cmSystemTools::Error(emsg);
+    cmSystemTools::Error(cmStrCat("AutoGen: Could not create directory: ",
+                                  Quoted(this->Dir.Info)));
     return false;
   }
 
@@ -1306,10 +1294,8 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
         }
         if (muf->MocIt || muf->UicIt) {
           headers.emplace_back(muf->RealPath);
-          std::string flags;
-          flags += muf->MocIt ? 'M' : 'm';
-          flags += muf->UicIt ? 'U' : 'u';
-          headersFlags.emplace_back(std::move(flags));
+          headersFlags.emplace_back(
+            cmStrCat(muf->MocIt ? "M" : "m", muf->UicIt ? "U" : "u"));
         }
       }
     }
@@ -1318,14 +1304,13 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
       cmFilePathChecksum const fpathCheckSum(makefile);
       std::unordered_set<std::string> emitted;
       for (std::string const& hdr : headers) {
-        std::string basePath = fpathCheckSum.getPart(hdr);
-        basePath += "/moc_";
-        basePath += cmSystemTools::GetFilenameWithoutLastExtension(hdr);
-        for (unsigned int ii = 1; ii != 1024; ++ii) {
+        std::string basePath =
+          cmStrCat(fpathCheckSum.getPart(hdr), "/moc_",
+                   cmSystemTools::GetFilenameWithoutLastExtension(hdr));
+        for (int ii = 1; ii != 1024; ++ii) {
           std::string path = basePath;
           if (ii > 1) {
-            path += '_';
-            path += std::to_string(ii);
+            path += cmStrCat("_", ii);
           }
           path += ".cpp";
           if (emitted.emplace(path).second) {
@@ -1364,10 +1349,8 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
         }
         if (muf->MocIt || muf->UicIt) {
           sources.emplace_back(muf->RealPath);
-          std::string flags;
-          flags += muf->MocIt ? 'M' : 'm';
-          flags += muf->UicIt ? 'U' : 'u';
-          sourcesFlags.emplace_back(std::move(flags));
+          sourcesFlags.emplace_back(
+            cmStrCat(muf->MocIt ? "M" : "m", muf->UicIt ? "U" : "u"));
         }
       }
     }
@@ -1421,9 +1404,8 @@ bool cmQtAutoGenInitializer::SetupWriteAutogenInfo()
       ofs.WriteStrings("AM_UIC_SEARCH_PATHS", this->Uic.SearchPaths);
     }
   } else {
-    std::string err = "AutoGen: Could not write file ";
-    err += this->AutogenTarget.InfoFile;
-    cmSystemTools::Error(err);
+    cmSystemTools::Error(cmStrCat("AutoGen: Could not write file ",
+                                  this->AutogenTarget.InfoFile));
     return false;
   }
 
@@ -1462,9 +1444,8 @@ bool cmQtAutoGenInitializer::SetupWriteRccInfo()
       ofs.WriteStrings("ARCC_OPTIONS", qrc.Options);
       ofs.WriteStrings("ARCC_INPUTS", qrc.Resources);
     } else {
-      std::string err = "AutoRcc: Could not write file ";
-      err += qrc.InfoFile;
-      cmSystemTools::Error(err);
+      cmSystemTools::Error(
+        cmStrCat("AutoRcc: Could not write file ", qrc.InfoFile));
       return false;
     }
   }
@@ -1519,13 +1500,10 @@ bool 
cmQtAutoGenInitializer::AddToSourceGroup(std::string const& fileName,
     if (!groupName.empty()) {
       sourceGroup = makefile->GetOrCreateSourceGroup(groupName);
       if (sourceGroup == nullptr) {
-        std::string err;
-        err += genNameUpper;
-        err += " error in ";
-        err += property;
-        err += ": Could not find or create the source group ";
-        err += cmQtAutoGen::Quoted(groupName);
-        cmSystemTools::Error(err);
+        cmSystemTools::Error(
+          cmStrCat(genNameUpper, " error in ", property,
+                   ": Could not find or create the source group ",
+                   cmQtAutoGen::Quoted(groupName)));
         return false;
       }
     }
@@ -1617,12 +1595,8 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& 
genVars,
                                              bool ignoreMissingTarget) const
 {
   auto print_err = [this, &genVars](std::string const& err) {
-    std::string msg = genVars.GenNameUpper;
-    msg += " for target ";
-    msg += this->Target->GetName();
-    msg += ": ";
-    msg += err;
-    cmSystemTools::Error(msg);
+    cmSystemTools::Error(cmStrCat(genVars.GenNameUpper, " for target ",
+                                  this->Target->GetName(), ": ", err));
   };
 
   // Custom executable
@@ -1682,11 +1656,8 @@ bool cmQtAutoGenInitializer::GetQtExecutable(GenVarsT& 
genVars,
           std::make_shared<cmQtAutoGen::CompilerFeatures>();
         return true;
       }
-      std::string err = "Could not find ";
-      err += executable;
-      err += " executable target ";
-      err += targetName;
-      print_err(err);
+      print_err(cmStrCat("Could not find ", executable, " executable target ",
+                         targetName));
       return false;
     }
   }
diff --git a/Source/cmQtAutoGenerator.cxx b/Source/cmQtAutoGenerator.cxx
index 2516d84..0ad87b1 100644
--- a/Source/cmQtAutoGenerator.cxx
+++ b/Source/cmQtAutoGenerator.cxx
@@ -1,17 +1,17 @@
 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmQtAutoGenerator.h"
-#include "cmQtAutoGen.h"
-
-#include "cmsys/FStream.hxx"
 
 #include "cm_memory.hxx"
+#include "cmsys/FStream.hxx"
 
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
+#include "cmQtAutoGen.h"
 #include "cmState.h"
 #include "cmStateDirectory.h"
 #include "cmStateSnapshot.h"
+#include "cmStringAlgorithms.h"
 #include "cmSystemTools.h"
 #include "cmake.h"
 
@@ -60,19 +60,13 @@ void cmQtAutoGenerator::Logger::SetColorOutput(bool value)
 
 std::string cmQtAutoGenerator::Logger::HeadLine(std::string const& title)
 {
-  std::string head = title;
-  head += '\n';
-  head.append(head.size() - 1, '-');
-  head += '\n';
-  return head;
+  return cmStrCat(title, "\n", std::string(title.size(), '-'), "\n");
 }
 
 void cmQtAutoGenerator::Logger::Info(GenT genType,
                                      std::string const& message) const
 {
-  std::string msg = GeneratorName(genType);
-  msg += ": ";
-  msg += message;
+  std::string msg = cmStrCat(GeneratorName(genType), ": ", message);
   if (msg.back() != '\n') {
     msg.push_back('\n');
   }
@@ -110,19 +104,13 @@ void cmQtAutoGenerator::Logger::WarningFile(GenT genType,
                                             std::string const& filename,
                                             std::string const& message) const
 {
-  std::string msg = "  ";
-  msg += Quoted(filename);
-  msg.push_back('\n');
-  // Message
-  msg += message;
-  Warning(genType, msg);
+  Warning(genType, cmStrCat("  ", Quoted(filename), "\n", message));
 }
 
 void cmQtAutoGenerator::Logger::Error(GenT genType,
                                       std::string const& message) const
 {
-  std::string msg;
-  msg += HeadLine(GeneratorName(genType) + " error");
+  std::string msg = HeadLine(GeneratorName(genType) + " error");
   // Message
   msg += message;
   if (msg.back() != '\n') {
@@ -139,12 +127,7 @@ void cmQtAutoGenerator::Logger::ErrorFile(GenT genType,
                                           std::string const& filename,
                                           std::string const& message) const
 {
-  std::string emsg = "  ";
-  emsg += Quoted(filename);
-  emsg += '\n';
-  // Message
-  emsg += message;
-  Error(genType, emsg);
+  Error(genType, cmStrCat("  ", Quoted(filename), '\n', message));
 }
 
 void cmQtAutoGenerator::Logger::ErrorCommand(
@@ -280,10 +263,8 @@ bool cmQtAutoGenerator::Run(std::string const& infoFile,
   InfoFile_ = infoFile;
   cmSystemTools::ConvertToUnixSlashes(InfoFile_);
   if (!InfoFileTime_.Load(InfoFile_)) {
-    std::string msg = "AutoGen: The info file ";
-    msg += Quoted(InfoFile_);
-    msg += " is not readable\n";
-    cmSystemTools::Stderr(msg);
+    cmSystemTools::Stderr(cmStrCat("AutoGen: The info file ",
+                                   Quoted(InfoFile_), " is not readable\n"));
     return false;
   }
   InfoDir_ = cmSystemTools::GetFilenamePath(infoFile);
diff --git a/Source/cmQtAutoMocUic.cxx b/Source/cmQtAutoMocUic.cxx
index 0801c24..e693816 100644
--- a/Source/cmQtAutoMocUic.cxx
+++ b/Source/cmQtAutoMocUic.cxx
@@ -302,10 +302,9 @@ void cmQtAutoMocUic::JobMocPredefsT::Process()
       }
       // Execute command
       if (!RunProcess(GenT::MOC, result, cmd, reason.get())) {
-        std::string msg = "The content generation command for ";
-        msg += Quoted(predefsFileRel);
-        msg += " failed.\n";
-        msg += result.ErrorMessage;
+        std::string msg =
+          cmStrCat("The content generation command for ",
+                   Quoted(predefsFileRel), " failed.\n", result.ErrorMessage);
         LogCommandError(GenT::MOC, msg, cmd, result.StdOut);
         return;
       }
@@ -314,9 +313,8 @@ void cmQtAutoMocUic::JobMocPredefsT::Process()
     // (Re)write predefs file only on demand
     if (cmQtAutoGenerator::FileDiffers(predefsFileAbs, result.StdOut)) {
       if (!cmQtAutoGenerator::FileWrite(predefsFileAbs, result.StdOut)) {
-        std::string msg = "Writing ";
-        msg += Quoted(predefsFileRel);
-        msg += " failed.";
+        std::string msg =
+          cmStrCat("Writing ", Quoted(predefsFileRel), " failed.");
         LogFileError(GenT::MOC, predefsFileAbs, msg);
         return;
       }
@@ -326,9 +324,8 @@ void cmQtAutoMocUic::JobMocPredefsT::Process()
         Log().Info(GenT::MOC, "Touching " + Quoted(predefsFileRel));
       }
       if (!cmSystemTools::Touch(predefsFileAbs, false)) {
-        std::string msg = "Touching ";
-        msg += Quoted(predefsFileAbs);
-        msg += " failed.";
+        std::string msg =
+          cmStrCat("Touching ", Quoted(predefsFileAbs), " failed.");
         LogFileError(GenT::MOC, predefsFileAbs, msg);
         return;
       }
@@ -663,13 +660,11 @@ bool cmQtAutoMocUic::JobEvaluateT::MocEvalSource(
   if (!sourceIncludesDotMoc && !parseData.Macro.empty() &&
       !(relaxedMode && sourceIncludesMocUnderscore)) {
     {
-      std::string emsg = "The file contains a ";
-      emsg += Quoted(parseData.Macro);
-      emsg += " macro, but does not include ";
-      emsg += Quoted(sourceBase + ".moc");
-      emsg += "!\nConsider to\n  - add #include \"";
-      emsg += sourceBase;
-      emsg += ".moc\"\n  - enable SKIP_AUTOMOC for this file";
+      std::string emsg =
+        cmStrCat("The file contains a ", Quoted(parseData.Macro),
+                 " macro, but does not include ", Quoted(sourceBase + ".moc"),
+                 "!\nConsider to\n  - add #include \"", sourceBase,
+                 ".moc\"\n  - enable SKIP_AUTOMOC for this file");
       LogFileError(GenT::MOC, sourceFile.FileName, emsg);
     }
     return false;
@@ -700,18 +695,14 @@ bool cmQtAutoMocUic::JobEvaluateT::MocEvalSource(
       // used. This is for KDE4 compatibility.
       {
         // Issue a warning
-        std::string msg = "The file contains a ";
-        msg += Quoted(parseData.Macro);
-        msg += " macro, but does not include ";
-        msg += Quoted(sourceBase + ".moc");
-        msg += ".\nInstead it includes ";
-        msg += Quoted(incKey.Key);
-        msg += ".\nRunning moc on the source\n  ";
-        msg += Quoted(sourceFile.FileName);
-        msg += "!\nBetter include ";
-        msg += Quoted(sourceBase + ".moc");
-        msg += " for compatibility with regular mode.\n";
-        msg += "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n";
+        std::string msg = cmStrCat(
+          "The file contains a ", Quoted(parseData.Macro),
+          " macro, but does not include ", Quoted(sourceBase + ".moc"),
+          ".\nInstead it includes ", Quoted(incKey.Key),
+          ".\nRunning moc on the source\n  ", Quoted(sourceFile.FileName),
+          "!\nBetter include ", Quoted(sourceBase + ".moc"),
+          " for compatibility with regular mode.\n",
+          "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n");
         Log().WarningFile(GenT::MOC, sourceFile.FileName, msg);
       }
       // Create mapping
@@ -764,28 +755,22 @@ bool cmQtAutoMocUic::JobEvaluateT::MocEvalSource(
       }
       // Issue a warning
       if (ownMoc && parseData.Macro.empty()) {
-        std::string msg = "The file includes the moc file ";
-        msg += Quoted(incKey.Key);
-        msg += ", but does not contain a\n";
-        msg += MocConst().MacrosString();
-        msg += " macro.\nRunning moc on the header\n  ";
-        msg += Quoted(header->FileName);
-        msg += "!\nBetter include ";
-        msg += Quoted("moc_" + incKey.Base + ".cpp");
-        msg += " for a compatibility with regular mode.\n";
-        msg += "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n";
+        std::string msg = cmStrCat(
+          "The file includes the moc file ", Quoted(incKey.Key),
+          ", but does not contain a\n", MocConst().MacrosString(),
+          " macro.\nRunning moc on the header\n  ", Quoted(header->FileName),
+          "!\nBetter include ", Quoted("moc_" + incKey.Base + ".cpp"),
+          " for a compatibility with regular mode.\n",
+          "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n");
         Log().WarningFile(GenT::MOC, sourceFile.FileName, msg);
       } else {
-        std::string msg = "The file includes the moc file ";
-        msg += Quoted(incKey.Key);
-        msg += " instead of ";
-        msg += Quoted("moc_" + incKey.Base + ".cpp");
-        msg += ".\nRunning moc on the header\n  ";
-        msg += Quoted(header->FileName);
-        msg += "!\nBetter include ";
-        msg += Quoted("moc_" + incKey.Base + ".cpp");
-        msg += " for compatibility with regular mode.\n";
-        msg += "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n";
+        std::string msg = cmStrCat(
+          "The file includes the moc file ", Quoted(incKey.Key),
+          " instead of ", Quoted("moc_" + incKey.Base + ".cpp"),
+          ".\nRunning moc on the header\n  ", Quoted(header->FileName),
+          "!\nBetter include ", Quoted("moc_" + incKey.Base + ".cpp"),
+          " for compatibility with regular mode.\n",
+          "This is a CMAKE_AUTOMOC_RELAXED_MODE warning.\n");
         Log().WarningFile(GenT::MOC, sourceFile.FileName, msg);
       }
       // Create mapping
@@ -811,11 +796,9 @@ bool cmQtAutoMocUic::JobEvaluateT::MocEvalSource(
       }
       // Accept but issue a warning if moc isn't required
       if (parseData.Macro.empty()) {
-        std::string msg = "The file includes the moc file ";
-        msg += Quoted(incKey.Key);
-        msg += ", but does not contain a ";
-        msg += MocConst().MacrosString();
-        msg += " macro.";
+        std::string msg = cmStrCat(
+          "The file includes the moc file ", Quoted(incKey.Key),
+          ", but does not contain a ", MocConst().MacrosString(), " macro.");
         Log().WarningFile(GenT::MOC, sourceFile.FileName, msg);
       }
       // Create mapping
@@ -841,9 +824,7 @@ cmQtAutoMocUic::JobEvaluateT::MocFindIncludedHeader(
   }
   // Search in include directories
   for (std::string const& path : MocConst().IncludePaths) {
-    std::string testPath = path;
-    testPath += '/';
-    testPath += includeBase;
+    std::string testPath = cmStrCat(path, '/', includeBase);
     SourceFileHandleT res = MocFindHeader(testPath);
     if (res) {
       return res;
@@ -893,10 +874,9 @@ std::string 
cmQtAutoMocUic::JobEvaluateT::MocMessageTestHeaders(
 {
   std::ostringstream res;
   {
-    std::string exts = ".{";
-    exts += cmJoin(BaseConst().HeaderExtensions, ",");
-    exts += '}';
-    // Compose result string
+    std::string exts =
+      cmStrCat(".{", cmJoin(BaseConst().HeaderExtensions, ","),
+               '}'); // Compose result string
     res << "  " << fileBase << exts << '\n';
     for (std::string const& path : MocConst().IncludePaths) {
       res << "  " << path << '/' << fileBase << exts << '\n';
@@ -914,9 +894,8 @@ bool cmQtAutoMocUic::JobEvaluateT::MocRegisterIncluded(
   if (handle) {
     // Check if the output file would be generated from different source files
     if (handle->SourceFile != sourceFileHandle) {
-      std::string msg = "The source files\n  ";
-      msg += Quoted(includerFileHandle->FileName);
-      msg += '\n';
+      std::string msg = cmStrCat("The source files\n  ",
+                                 Quoted(includerFileHandle->FileName), '\n');
       for (auto const& item : handle->IncluderFiles) {
         msg += "  ";
         msg += Quoted(item->FileName);
@@ -1020,9 +999,8 @@ bool cmQtAutoMocUic::JobEvaluateT::UicRegisterMapping(
     MappingHandleT const& handle = it->second;
     if (handle->SourceFile != uiFileHandle) {
       // The output file already gets generated - from a different .ui file!
-      std::string msg = "The source files\n  ";
-      msg += Quoted(includerFileHandle->FileName);
-      msg += '\n';
+      std::string msg = cmStrCat("The source files\n  ",
+                                 Quoted(includerFileHandle->FileName), '\n');
       for (auto const& item : handle->IncluderFiles) {
         msg += "  ";
         msg += Quoted(item->FileName);
@@ -1063,8 +1041,7 @@ cmQtAutoMocUic::JobEvaluateT::UicFindIncludedUi(
   std::string const& sourceFile, std::string const& sourceDir,
   IncludeKeyT const& incKey) const
 {
-  std::string searchFileName = incKey.Base;
-  searchFileName += ".ui";
+  std::string searchFileName = cmStrCat(incKey.Base, ".ui");
   // Collect search paths list
   std::vector<std::string> testFiles;
   {
@@ -1074,26 +1051,17 @@ cmQtAutoMocUic::JobEvaluateT::UicFindIncludedUi(
     // Vicinity of the source
     testFiles.emplace_back(sourceDir + searchFileName);
     if (!incKey.Dir.empty()) {
-      std::string path = sourceDir;
-      path += incKey.Dir;
-      path += searchFileName;
-      testFiles.emplace_back(path);
+      testFiles.emplace_back(cmStrCat(sourceDir, incKey.Dir, searchFileName));
     }
     // AUTOUIC search paths
     if (!searchPaths.empty()) {
       for (std::string const& sPath : searchPaths) {
-        std::string path = sPath;
-        path += '/';
-        path += searchFileName;
-        testFiles.emplace_back(std::move(path));
+        testFiles.emplace_back(cmStrCat(sPath, '/', searchFileName));
       }
       if (!incKey.Dir.empty()) {
         for (std::string const& sPath : searchPaths) {
-          std::string path = sPath;
-          path += '/';
-          path += incKey.Dir;
-          path += searchFileName;
-          testFiles.emplace_back(std::move(path));
+          testFiles.emplace_back(
+            cmStrCat(sPath, '/', incKey.Dir, searchFileName));
         }
       }
     }
@@ -1118,11 +1086,10 @@ cmQtAutoMocUic::JobEvaluateT::UicFindIncludedUi(
 
   // Log error
   {
-    std::string msg = "The file includes the uic file ";
-    msg += Quoted(incKey.Key);
-    msg += ",\nbut the user interface file ";
-    msg += Quoted(searchFileName);
-    msg += "\ncould not be found in the following locations\n";
+    std::string msg =
+      cmStrCat("The file includes the uic file ", Quoted(incKey.Key),
+               ",\nbut the user interface file ", Quoted(searchFileName),
+               "\ncould not be found in the following locations\n");
     for (std::string const& testFile : testFiles) {
       msg += "  ";
       msg += Quoted(testFile);
@@ -1418,10 +1385,9 @@ void cmQtAutoMocUic::JobMocT::Process()
     }
   } else {
     // Moc command failed
-    std::string msg = "The moc process failed to compile\n  ";
-    msg += Quoted(sourceFile);
-    msg += "\ninto\n  ";
-    msg += Quoted(outputFile);
+    std::string msg =
+      cmStrCat("The moc process failed to compile\n  ", Quoted(sourceFile),
+               "\ninto\n  ", Quoted(outputFile));
     if (Mapping->IncluderFiles.empty()) {
       msg += ".\n";
     } else {
@@ -1467,11 +1433,9 @@ void cmQtAutoMocUic::JobUicT::Process()
     }
   } else {
     // Uic command failed
-    std::string msg = "The uic process failed to compile\n  ";
-    msg += Quoted(sourceFile);
-    msg += "\ninto\n  ";
-    msg += Quoted(outputFile);
-    msg += "\nincluded by\n";
+    std::string msg =
+      cmStrCat("The uic process failed to compile\n  ", Quoted(sourceFile),
+               "\ninto\n  ", Quoted(outputFile), "\nincluded by\n");
     for (auto const& item : Mapping->IncluderFiles) {
       msg += "  ";
       msg += Quoted(item->FileName);
@@ -1564,12 +1528,8 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
         if (length >= 2) {
           std::string::const_iterator itBeg = value.begin() + (pos + 1);
           std::string::const_iterator itEnd = itBeg + (length - 2);
-          {
-            std::string subValue(itBeg, itEnd);
-            std::vector<std::string> list;
-            cmSystemTools::ExpandListArgument(subValue, list);
-            lists.push_back(std::move(list));
-          }
+          lists.emplace_back(
+            cmSystemTools::ExpandedListArgument(std::string(itBeg, itEnd)));
         }
         pos += length;
         pos += ListSep.size();
@@ -1580,9 +1540,7 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
   auto InfoGetConfig = [makefile, this](const char* key) -> std::string {
     const char* valueConf = nullptr;
     {
-      std::string keyConf = key;
-      keyConf += '_';
-      keyConf += InfoConfig();
+      std::string keyConf = cmStrCat(key, '_', InfoConfig());
       valueConf = makefile->GetDefinition(keyConf);
     }
     if (valueConf == nullptr) {
@@ -1653,9 +1611,9 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
     return LogInfoError("CMake executable file name missing.");
   }
   if (!BaseConst_.CMakeExecutableTime.Load(BaseConst_.CMakeExecutable)) {
-    std::string error = "The CMake executable ";
-    error += Quoted(BaseConst_.CMakeExecutable);
-    error += " does not exist.";
+    std::string error =
+      cmStrCat("The CMake executable ", Quoted(BaseConst_.CMakeExecutable),
+               " does not exist.");
     return LogInfoError(error);
   }
   BaseConst_.ParseCacheFile = InfoGetConfig("AM_PARSE_CACHE_FILE");
@@ -1684,9 +1642,9 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
     MocConst_.Enabled = true;
     // Load the executable file time
     if (!MocConst_.ExecutableTime.Load(MocConst_.Executable)) {
-      std::string error = "The moc executable ";
-      error += Quoted(MocConst_.Executable);
-      error += " does not exist.";
+      std::string error =
+        cmStrCat("The moc executable ", Quoted(MocConst_.Executable),
+                 " does not exist.");
       return LogInfoError(error);
     }
     for (std::string& sfl : InfoGetList("AM_MOC_SKIP")) {
@@ -1752,9 +1710,9 @@ bool cmQtAutoMocUic::Init(cmMakefile* makefile)
     UicConst_.Enabled = true;
     // Load the executable file time
     if (!UicConst_.ExecutableTime.Load(UicConst_.Executable)) {
-      std::string error = "The uic executable ";
-      error += Quoted(UicConst_.Executable);
-      error += " does not exist.";
+      std::string error =
+        cmStrCat("The uic executable ", Quoted(UicConst_.Executable),
+                 " does not exist.");
       return LogInfoError(error);
     }
     for (std::string& sfl : InfoGetList("AM_UIC_SKIP")) {
diff --git a/Source/cmQtAutoRcc.cxx b/Source/cmQtAutoRcc.cxx
index 59f632d..c75b2ca 100644
--- a/Source/cmQtAutoRcc.cxx
+++ b/Source/cmQtAutoRcc.cxx
@@ -36,9 +36,7 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile)
                         this](std::string const& key) -> std::string {
     const char* valueConf = nullptr;
     {
-      std::string keyConf = key;
-      keyConf += '_';
-      keyConf += InfoConfig();
+      std::string keyConf = cmStrCat(key, '_', InfoConfig());
       valueConf = makefile->GetDefinition(keyConf);
     }
     if (valueConf == nullptr) {
@@ -82,9 +80,8 @@ bool cmQtAutoRcc::Init(cmMakefile* makefile)
   // - Rcc executable
   RccExecutable_ = InfoGet("ARCC_RCC_EXECUTABLE");
   if (!RccExecutableTime_.Load(RccExecutable_)) {
-    std::string error = "The rcc executable ";
-    error += Quoted(RccExecutable_);
-    error += " does not exist.";
+    std::string error = cmStrCat("The rcc executable ", Quoted(RccExecutable_),
+                                 " does not exist.");
     return LogInfoError(error);
   }
   RccListOptions_ = InfoGetList("ARCC_RCC_LIST_OPTIONS");
@@ -179,10 +176,8 @@ bool cmQtAutoRcc::Process()
 std::string cmQtAutoRcc::MultiConfigOutput() const
 {
   static std::string const suffix = "_CMAKE_";
-  std::string res;
-  res += RccPathChecksum_;
-  res += '/';
-  res += AppendFilenameSuffix(RccFileName_, suffix);
+  std::string res = cmStrCat(RccPathChecksum_, '/',
+                             AppendFilenameSuffix(RccFileName_, suffix));
   return res;
 }
 
@@ -273,9 +268,7 @@ bool cmQtAutoRcc::SettingsFileWrite()
       Log().Info(GenT::RCC, "Writing settings file " + Quoted(SettingsFile_));
     }
     // Write settings file
-    std::string content = "rcc:";
-    content += SettingsString_;
-    content += '\n';
+    std::string content = cmStrCat("rcc:", SettingsString_, '\n');
     std::string error;
     if (!FileWrite(SettingsFile_, content, &error)) {
       Log().ErrorFile(GenT::RCC, SettingsFile_,
@@ -403,10 +396,9 @@ bool cmQtAutoRcc::TestInfoFile()
   // Test if the rcc output file is older than the info file
   if (RccFileTime_.Older(InfoFileTime())) {
     if (Log().Verbose()) {
-      std::string reason = "Touching ";
-      reason += Quoted(RccFileOutput_);
-      reason += " because it is older than ";
-      reason += Quoted(InfoFile());
+      std::string reason =
+        cmStrCat("Touching ", Quoted(RccFileOutput_),
+                 " because it is older than ", Quoted(InfoFile()));
       Log().Info(GenT::RCC, reason);
     }
     // Touch build file
@@ -457,10 +449,9 @@ bool cmQtAutoRcc::GenerateRcc()
   if (!result || (retVal != 0)) {
     // rcc process failed
     {
-      std::string err = "The rcc process failed to compile\n  ";
-      err += Quoted(QrcFile_);
-      err += "\ninto\n  ";
-      err += Quoted(RccFileOutput_);
+      std::string err =
+        cmStrCat("The rcc process failed to compile\n  ", Quoted(QrcFile_),
+                 "\ninto\n  ", Quoted(RccFileOutput_));
       Log().ErrorCommand(GenT::RCC, err, cmd, rccStdOut + rccStdErr);
     }
     cmSystemTools::RemoveFile(RccFileOutput_);
@@ -482,12 +473,10 @@ bool cmQtAutoRcc::GenerateWrapper()
   // Generate a wrapper source file on demand
   if (IsMultiConfig()) {
     // Wrapper file content
-    std::string content;
-    content += "// This is an autogenerated configuration wrapper file.\n";
-    content += "// Changes will be overwritten.\n";
-    content += "#include <";
-    content += MultiConfigOutput();
-    content += ">\n";
+    std::string content =
+      cmStrCat("// This is an autogenerated configuration wrapper file.\n",
+               "// Changes will be overwritten.\n", "#include <",
+               MultiConfigOutput(), ">\n");
 
     // Compare with existing file content
     bool fileDiffers = true;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22
commit d02a99d9d3aa8d8f33efbd3255c78d6b87a99a22
Author:     Sebastian Holtermann <sebh...@xwmw.org>
AuthorDate: Tue Aug 6 10:32:07 2019 +0200
Commit:     Sebastian Holtermann <sebh...@xwmw.org>
CommitDate: Wed Aug 7 18:01:32 2019 +0200

    Autogen: Modernize code to use cm::string_view for the info writer

diff --git a/Source/cmQtAutoGenInitializer.cxx 
b/Source/cmQtAutoGenInitializer.cxx
index da6094d..7e72fd6 100644
--- a/Source/cmQtAutoGenInitializer.cxx
+++ b/Source/cmQtAutoGenInitializer.cxx
@@ -156,30 +156,27 @@ std::string 
cmQtAutoGenInitializer::InfoWriter::ListJoin(IT it_begin,
   return res;
 }
 
-std::string cmQtAutoGenInitializer::InfoWriter::ConfigKey(
-  const char* key, std::string const& config)
+inline std::string cmQtAutoGenInitializer::InfoWriter::ConfigKey(
+  cm::string_view key, std::string const& config)
 {
-  std::string ckey = key;
-  ckey += '_';
-  ckey += config;
-  return ckey;
+  return cmStrCat(key, "_", config);
 }
 
-void cmQtAutoGenInitializer::InfoWriter::Write(const char* key,
+void cmQtAutoGenInitializer::InfoWriter::Write(cm::string_view key,
                                                std::string const& value)
 {
   Ofs_ << "set(" << key << " " << cmOutputConverter::EscapeForCMake(value)
        << ")\n";
 };
 
-void cmQtAutoGenInitializer::InfoWriter::WriteUInt(const char* key,
+void cmQtAutoGenInitializer::InfoWriter::WriteUInt(cm::string_view key,
                                                    unsigned int value)
 {
   Ofs_ << "set(" << key << " " << value << ")\n";
 };
 
 template <class C>
-void cmQtAutoGenInitializer::InfoWriter::WriteStrings(const char* key,
+void cmQtAutoGenInitializer::InfoWriter::WriteStrings(cm::string_view key,
                                                       C const& container)
 {
   Ofs_ << "set(" << key << " \""
@@ -187,31 +184,29 @@ void 
cmQtAutoGenInitializer::InfoWriter::WriteStrings(const char* key,
 }
 
 void cmQtAutoGenInitializer::InfoWriter::WriteConfig(
-  const char* key, std::map<std::string, std::string> const& map)
+  cm::string_view key, std::map<std::string, std::string> const& map)
 {
   for (auto const& item : map) {
-    Write(ConfigKey(key, item.first).c_str(), item.second);
+    Write(ConfigKey(key, item.first), item.second);
   }
 };
 
 template <class C>
 void cmQtAutoGenInitializer::InfoWriter::WriteConfigStrings(
-  const char* key, std::map<std::string, C> const& map)
+  cm::string_view key, std::map<std::string, C> const& map)
 {
   for (auto const& item : map) {
-    WriteStrings(ConfigKey(key, item.first).c_str(), item.second);
+    WriteStrings(ConfigKey(key, item.first), item.second);
   }
 }
 
 void cmQtAutoGenInitializer::InfoWriter::WriteNestedLists(
-  const char* key, std::vector<std::vector<std::string>> const& lists)
+  cm::string_view key, std::vector<std::vector<std::string>> const& lists)
 {
   std::vector<std::string> seplist;
-  for (const std::vector<std::string>& list : lists) {
-    std::string blist = "{";
-    blist += ListJoin(list.begin(), list.end());
-    blist += "}";
-    seplist.push_back(std::move(blist));
+  seplist.reserve(lists.size());
+  for (std::vector<std::string> const& list : lists) {
+    seplist.push_back(cmStrCat("{", ListJoin(list.begin(), list.end()), "}"));
   }
   Write(key, cmJoin(seplist, cmQtAutoGen::ListSep));
 };
diff --git a/Source/cmQtAutoGenInitializer.h b/Source/cmQtAutoGenInitializer.h
index eb0d35e..7d72cad 100644
--- a/Source/cmQtAutoGenInitializer.h
+++ b/Source/cmQtAutoGenInitializer.h
@@ -6,6 +6,7 @@
 #include "cmConfigure.h" // IWYU pragma: keep
 #include "cmGeneratedFileStream.h"
 #include "cmQtAutoGen.h"
+#include "cm_string_view.hxx"
 
 #include <map>
 #include <memory>
@@ -85,24 +86,24 @@ public:
     /// @return True if the file is open
     explicit operator bool() const { return static_cast<bool>(Ofs_); }
 
-    void Write(const char* text) { Ofs_ << text; }
-    void Write(const char* key, std::string const& value);
-    void WriteUInt(const char* key, unsigned int value);
+    void Write(cm::string_view text) { Ofs_ << text; }
+    void Write(cm::string_view, std::string const& value);
+    void WriteUInt(cm::string_view, unsigned int value);
 
     template <class C>
-    void WriteStrings(const char* key, C const& container);
-    void WriteConfig(const char* key,
+    void WriteStrings(cm::string_view, C const& container);
+    void WriteConfig(cm::string_view,
                      std::map<std::string, std::string> const& map);
     template <class C>
-    void WriteConfigStrings(const char* key,
+    void WriteConfigStrings(cm::string_view,
                             std::map<std::string, C> const& map);
-    void WriteNestedLists(const char* key,
+    void WriteNestedLists(cm::string_view,
                           std::vector<std::vector<std::string>> const& lists);
 
   private:
     template <class IT>
     static std::string ListJoin(IT it_begin, IT it_end);
-    static std::string ConfigKey(const char* key, std::string const& config);
+    static std::string ConfigKey(cm::string_view, std::string const& config);
 
   private:
     cmGeneratedFileStream Ofs_;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2171f6ec0ea3ca373db94bc55d8b7db999de97cc
commit 2171f6ec0ea3ca373db94bc55d8b7db999de97cc
Author:     Saleem Abdulrasool <compn...@compnerd.org>
AuthorDate: Fri Aug 2 10:10:21 2019 -0700
Commit:     Saleem Abdulrasool <compn...@compnerd.org>
CommitDate: Mon Aug 5 17:29:41 2019 -0700

    Swift: correct SONAME flag for Darwin targets
    
    Adjust the build rules for Swift to fix the SONAME handling for Darwin.

diff --git a/Modules/CMakeSwiftInformation.cmake 
b/Modules/CMakeSwiftInformation.cmake
index 58b0813..54e441c 100644
--- a/Modules/CMakeSwiftInformation.cmake
+++ b/Modules/CMakeSwiftInformation.cmake
@@ -18,7 +18,9 @@ if(CMAKE_Swift_COMPILER_ID)
 endif()
 
 set(CMAKE_INCLUDE_FLAG_Swift "-I ")
-if(NOT CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_SYSTEM_NAME STREQUAL 
Darwin)
+if(CMAKE_SYSTEM_NAME STREQUAL Darwin)
+  set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -install_name -Xlinker 
")
+elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
   set(CMAKE_SHARED_LIBRARY_SONAME_Swift_FLAG "-Xlinker -soname -Xlinker ")
 endif()
 

-----------------------------------------------------------------------

Summary of changes:
 Modules/CMakeSwiftInformation.cmake     |   4 +-
 Source/cmDefinitions.cxx                |  61 ++++++-----
 Source/cmDefinitions.h                  |  16 +--
 Source/cmQtAutoGen.cxx                  |   5 +-
 Source/cmQtAutoGenGlobalInitializer.cxx |  37 +++----
 Source/cmQtAutoGenInitializer.cxx       | 132 +++++++++--------------
 Source/cmQtAutoGenInitializer.h         |  17 +--
 Source/cmQtAutoGenerator.cxx            |  39 ++-----
 Source/cmQtAutoMocUic.cxx               | 186 +++++++++++++-------------------
 Source/cmQtAutoRcc.cxx                  |  43 +++-----
 10 files changed, 219 insertions(+), 321 deletions(-)


hooks/post-receive
-- 
CMake
_______________________________________________
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits

Reply via email to