[Cmake-commits] CMake branch, master, updated. v3.9.3-1016-g41492c2

Kitware Robot kwrobot at kitware.com
Fri Sep 29 08:55:07 EDT 2017


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  41492c2d99b0e2c9bdc166af3b6eea8e3da95aa6 (commit)
       via  194dd9ea8b6fb8b73aa6484551e87bb7676015cc (commit)
       via  460a94e29f19846bc219f8f8a02cddb196472be9 (commit)
       via  e6e32101d8e9c34a6ec2f5e8c9051d2f8bfdece2 (commit)
       via  e24e0ff6fac02bc8a12514d22ab4d8b80d789f56 (commit)
       via  b8018135b5729b5c74a0c95ab2b8cc8677fbe5b8 (commit)
       via  42f4e6974c99cfdd6727f2fcd35c83f431ab10a5 (commit)
       via  77f674be35717a6eb296246733885b5a7ddf95ec (commit)
       via  f0bab294dcd3f2c4f3be5e491426b5eefb2a9aba (commit)
       via  b5d7f5b0e8490a66cdd603e0ee38890426b3b6c4 (commit)
       via  9a2da3395034844fb91998005d9c7db648492c6b (commit)
       via  870dd06da15751250786d435ee4c1361a2b10b4d (commit)
       via  2033abff0dec29072ac070cb6fe1604e8c03f180 (commit)
       via  79b8c3802a430577a83ead5b0baab7038a813116 (commit)
       via  a45928cdebcf37de2605e4f58509a37542dd9eba (commit)
       via  b128f8c5bc02f716c700d4560b949b05afdcb659 (commit)
       via  bb0ad1bea81f60cbbb2c66c2c0ab24ee12db0026 (commit)
       via  8cc33aeaec2798c9ff5a3af23e361ee22fa2ba95 (commit)
       via  ffefdb2c084e1e2d46c4d8133dd7aa7bcef79b85 (commit)
       via  7cf089fcbf527e13446a856b1c1e49542040f080 (commit)
       via  ff6a51254a77ece4ec741c8cf061c01fcfe0f62d (commit)
       via  8831818f1403bfb77362e8c14666e275bda7b75d (commit)
       via  b0775c751b62784320a1e998f21c2ae40af688b4 (commit)
       via  93c8d55d049cacaa884d71b6c3177ce3757ab817 (commit)
       via  084ace47b6492245c2eb85ced45baccebac8111e (commit)
       via  08041dd15e7a4a030b2458e70018b50e1bbc0939 (commit)
       via  7b33d67bc53446e89eb27d750d80e4b639f8d3e5 (commit)
       via  76c634c4ac0f2d95babe04fa04e85d4c9fdeae23 (commit)
       via  786b5be03bf992fe78a9a6450d5665ab7233a815 (commit)
       via  a245f850bc4f4f209e759b6eab5b48c0693e38af (commit)
      from  f920ffd8f382c891bd863977eb453533b39c4bcc (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=41492c2d99b0e2c9bdc166af3b6eea8e3da95aa6
commit 41492c2d99b0e2c9bdc166af3b6eea8e3da95aa6
Merge: 194dd9e a245f85
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 12:54:19 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 29 08:54:22 2017 -0400

    Merge topic 'FindMatlab-version-quoting'
    
    a245f850 FindMatlab: Fix extraction of quoted version number
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1316


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=194dd9ea8b6fb8b73aa6484551e87bb7676015cc
commit 194dd9ea8b6fb8b73aa6484551e87bb7676015cc
Merge: 460a94e 93c8d55
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 12:52:43 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 29 08:53:13 2017 -0400

    Merge topic 'autogen-macro-names2'
    
    93c8d55d Autogen: Update (CMAKE_)AUTOMOC_MACRO_NAMES release notes
    084ace47 Autogen: Tests: Update AUTOMOC_MACRO_NAMES test
    08041dd1 Autogen: Doc: Update documentation for (CMAKE_)AUTOMOC_MACRO_NAMES
    7b33d67b Autogen: Create info file directory before writing
    786b5be0 Autogen: Define all macro names in CMAKE_AUTOMOC_MACRO_NAMES
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1321


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=460a94e29f19846bc219f8f8a02cddb196472be9
commit 460a94e29f19846bc219f8f8a02cddb196472be9
Merge: e6e3210 ff6a512
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 12:52:31 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 29 08:52:44 2017 -0400

    Merge topic 'autogen-cmp0071-warning'
    
    ff6a5125 Autogen: Doc: Add examples to the SKIP_AUTO* documentations
    8831818f Autogen: Doc: Update CMP0071 description
    b0775c75 Autogen: Offer solution for CMP0071 in warning message
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1322


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e6e32101d8e9c34a6ec2f5e8c9051d2f8bfdece2
commit e6e32101d8e9c34a6ec2f5e8c9051d2f8bfdece2
Merge: e24e0ff b801813
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 12:48:56 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 29 08:49:02 2017 -0400

    Merge topic 'cxx11-eq-delete'
    
    b8018135 Use C++11 '= delete' instead of CM_EQ_DELETE
    42f4e697 Drop unused CMake_HAVE_CXX_UNIQUE_PTR macro
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1326


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e24e0ff6fac02bc8a12514d22ab4d8b80d789f56
commit e24e0ff6fac02bc8a12514d22ab4d8b80d789f56
Merge: f920ffd 77f674b
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Sep 29 12:47:43 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Fri Sep 29 08:48:16 2017 -0400

    Merge topic 'clang-tidy'
    
    77f674be Fix some occurrences of readability-braces-around-statements
    f0bab294 Convert some leftover loops to C++11 range-based loop
    b5d7f5b0 Fix occurrences of readability-non-const-parameter
    9a2da339 Fix some occurrences of readability-avoid-const-params-in-decls
    870dd06d Fix left-over occurrences of else-after-return
    2033abff Fix minor clang-tidy findings
    79b8c380 Improve several occurrences of vector::push_back in loops
    a45928cd Fix some occurrences of missing override keywords
    ...
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !1292


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b8018135b5729b5c74a0c95ab2b8cc8677fbe5b8
commit b8018135b5729b5c74a0c95ab2b8cc8677fbe5b8
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 28 09:50:18 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 09:50:18 2017 -0400

    Use C++11 '= delete' instead of CM_EQ_DELETE
    
    We now require C++11 support including `= delete`.  Drop use of
    the old compatibility macro.

diff --git a/Help/dev/source.rst b/Help/dev/source.rst
index 96fc4a7..d0c19eb 100644
--- a/Help/dev/source.rst
+++ b/Help/dev/source.rst
@@ -30,14 +30,6 @@ building on older toolchains some constructs need to be handled with care:
 
   The ``std::auto_ptr`` template is deprecated in C++11. Use ``std::unique_ptr``.
 
-* Use ``CM_EQ_DELETE;`` instead of ``= delete;``.
-
-  Older C++11 compilers do not support deleting functions.  Using
-  ``CM_EQ_DELETE`` will delete the functions if the compiler supports it and
-  give them no implementation otherwise.  Calling such a function will lead
-  to compiler errors if the compiler supports *deleted* functions and linker
-  errors otherwise.
-
 * Use ``CM_DISABLE_COPY(Class)`` to mark classes as non-copyable.
 
   The ``CM_DISABLE_COPY`` macro should be used in the private section of a
diff --git a/Source/Checks/cm_cxx_eq_delete.cxx b/Source/Checks/cm_cxx_eq_delete.cxx
deleted file mode 100644
index 809e4cf..0000000
--- a/Source/Checks/cm_cxx_eq_delete.cxx
+++ /dev/null
@@ -1,14 +0,0 @@
-struct Foo
-{
-  Foo() {}
-  ~Foo() {}
-  Foo(Foo const&) = delete;
-  Foo& operator=(Foo const&) = delete;
-  int test() const { return 0; }
-};
-
-int main()
-{
-  Foo const foo;
-  return foo.test();
-}
diff --git a/Source/Checks/cm_cxx_features.cmake b/Source/Checks/cm_cxx_features.cmake
index 7755cfe..a30a5e6 100644
--- a/Source/Checks/cm_cxx_features.cmake
+++ b/Source/Checks/cm_cxx_features.cmake
@@ -41,7 +41,6 @@ function(cm_check_cxx_feature name)
   endif()
 endfunction()
 
-cm_check_cxx_feature(eq_delete)
 cm_check_cxx_feature(fallthrough)
 if(NOT CMake_HAVE_CXX_FALLTHROUGH)
   cm_check_cxx_feature(gnu_fallthrough)
diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index 5f3110c..9a78aca 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -19,7 +19,6 @@
 #cmakedefine HAVE_UNSETENV
 #cmakedefine CMAKE_USE_ELF_PARSER
 #cmakedefine CMAKE_USE_MACH_PARSER
-#cmakedefine CMake_HAVE_CXX_EQ_DELETE
 #cmakedefine CMake_HAVE_CXX_FALLTHROUGH
 #cmakedefine CMake_HAVE_CXX_GNU_FALLTHROUGH
 #cmakedefine CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH
@@ -27,12 +26,6 @@
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
 
-#ifdef CMake_HAVE_CXX_EQ_DELETE
-#define CM_EQ_DELETE = delete
-#else
-#define CM_EQ_DELETE
-#endif
-
 #if defined(CMake_HAVE_CXX_FALLTHROUGH)
 #define CM_FALLTHROUGH [[fallthrough]]
 #elif defined(CMake_HAVE_CXX_GNU_FALLTHROUGH)
@@ -44,7 +37,7 @@
 #endif
 
 #define CM_DISABLE_COPY(Class)                                                \
-  Class(Class const&) CM_EQ_DELETE;                                           \
-  Class& operator=(Class const&) CM_EQ_DELETE;
+  Class(Class const&) = delete;                                               \
+  Class& operator=(Class const&) = delete;
 
 #endif
diff --git a/Source/cmSourceFileLocation.h b/Source/cmSourceFileLocation.h
index fb5b330..467682d 100644
--- a/Source/cmSourceFileLocation.h
+++ b/Source/cmSourceFileLocation.h
@@ -90,8 +90,7 @@ private:
   void Update(cmSourceFileLocation const& loc);
   void UpdateExtension(const std::string& name);
 
-  cmSourceFileLocation& operator=(const cmSourceFileLocation& loc)
-    CM_EQ_DELETE;
+  cmSourceFileLocation& operator=(const cmSourceFileLocation& loc) = delete;
 };
 
 #endif
diff --git a/bootstrap b/bootstrap
index f7f45cf..47f7e76 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1270,7 +1270,6 @@ cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP_BINARY_DIR \"${CMAKE_
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BIN_DIR \"/bootstrap-not-insalled\""
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_DATA_DIR \"/bootstrap-not-insalled\""
 cmake_report cmConfigure.h${_tmp} "#define CMAKE_BOOTSTRAP"
-cmake_report cmConfigure.h${_tmp} "#define CM_EQ_DELETE"
 cmake_report cmConfigure.h${_tmp} "#define CM_FALLTHROUGH"
 cmake_report cmConfigure.h${_tmp} "#define CM_DISABLE_COPY(Class)"
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=42f4e6974c99cfdd6727f2fcd35c83f431ab10a5
commit 42f4e6974c99cfdd6727f2fcd35c83f431ab10a5
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 28 09:48:37 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 09:50:17 2017 -0400

    Drop unused CMake_HAVE_CXX_UNIQUE_PTR macro
    
    We now require C++11 `std::unique_ptr` support from the compiler,
    so none of our code is conditioned on the macro.

diff --git a/Source/cmConfigure.cmake.h.in b/Source/cmConfigure.cmake.h.in
index f4e5fb8..5f3110c 100644
--- a/Source/cmConfigure.cmake.h.in
+++ b/Source/cmConfigure.cmake.h.in
@@ -24,7 +24,6 @@
 #cmakedefine CMake_HAVE_CXX_GNU_FALLTHROUGH
 #cmakedefine CMake_HAVE_CXX_ATTRIBUTE_FALLTHROUGH
 #cmakedefine CMake_HAVE_CXX_MAKE_UNIQUE
-#cmakedefine CMake_HAVE_CXX_UNIQUE_PTR
 #define CMAKE_BIN_DIR "/@CMAKE_BIN_DIR@"
 #define CMAKE_DATA_DIR "/@CMAKE_DATA_DIR@"
 

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=77f674be35717a6eb296246733885b5a7ddf95ec
commit 77f674be35717a6eb296246733885b5a7ddf95ec
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Wed Sep 20 23:53:14 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:43 2017 -0400

    Fix some occurrences of readability-braces-around-statements
    
    Fix issues diagnosed by clang-tidy [readability-braces-around-statements]
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 72ddd6a..45c7fc6 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -866,10 +866,11 @@ bool cmCPackDragNDropGenerator::BreakLongLine(const std::string& line,
     size_t line_length = max_line_length;
     if (i + line_length > line.size()) {
       line_length = line.size() - i;
-    } else
+    } else {
       while (line_length > 0 && line[i + line_length - 1] != ' ') {
         line_length = line_length - 1;
       }
+    }
 
     if (line_length == 0) {
       *error = "Please make sure there are no words "
diff --git a/Source/CPack/cmCPackPackageMakerGenerator.cxx b/Source/CPack/cmCPackPackageMakerGenerator.cxx
index 6624b16..0299279 100644
--- a/Source/CPack/cmCPackPackageMakerGenerator.cxx
+++ b/Source/CPack/cmCPackPackageMakerGenerator.cxx
@@ -275,8 +275,9 @@ int cmCPackPackageMakerGenerator::PackageFiles()
     if (this->PackageMakerVersion > 2.0) {
       pkgCmd << " -v";
     }
-    if (!RunPackageMaker(pkgCmd.str().c_str(), packageDirFileName.c_str()))
+    if (!RunPackageMaker(pkgCmd.str().c_str(), packageDirFileName.c_str())) {
       return 0;
+    }
   } else {
     // We have built the package in place. Generate the
     // distribution.dist file to describe it for the installer.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index c218641..304a188 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -163,8 +163,9 @@ cmGlobalGeneratorFactory* cmGlobalXCodeGenerator::NewFactory()
 cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
   const std::string& name, cmake* cm) const
 {
-  if (name != GetActualName())
+  if (name != GetActualName()) {
     return nullptr;
+  }
 #if defined(CMAKE_BUILD_WITH_CMAKE)
   cmXcodeVersionParser parser;
   std::string versionFile;
@@ -2344,10 +2345,12 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
       return (target->GetPropertyAsBool("FRAMEWORK") ? "wrapper.framework"
                                                      : "archive.ar");
     case cmStateEnums::MODULE_LIBRARY:
-      if (target->IsXCTestOnApple())
+      if (target->IsXCTestOnApple()) {
         return "wrapper.cfbundle";
-      if (target->IsCFBundleOnApple())
+      }
+      if (target->IsCFBundleOnApple()) {
         return "wrapper.plug-in";
+      }
       return "compiled.mach-o.executable";
     case cmStateEnums::SHARED_LIBRARY:
       return (target->GetPropertyAsBool("FRAMEWORK")
@@ -2376,12 +2379,13 @@ const char* cmGlobalXCodeGenerator::GetTargetProductType(
                 ? "com.apple.product-type.framework"
                 : "com.apple.product-type.library.static");
     case cmStateEnums::MODULE_LIBRARY:
-      if (target->IsXCTestOnApple())
+      if (target->IsXCTestOnApple()) {
         return "com.apple.product-type.bundle.unit-test";
-      else if (target->IsCFBundleOnApple())
+      } else if (target->IsCFBundleOnApple()) {
         return "com.apple.product-type.bundle";
-      else
+      } else {
         return "com.apple.product-type.tool";
+      }
     case cmStateEnums::SHARED_LIBRARY:
       return (target->GetPropertyAsBool("FRAMEWORK")
                 ? "com.apple.product-type.framework"
@@ -2710,16 +2714,18 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreatePBXGroup(cmXCodeObject* parent,
                                                       const std::string& name)
 {
   cmXCodeObject* parentChildren = nullptr;
-  if (parent)
+  if (parent) {
     parentChildren = parent->GetObject("children");
+  }
   cmXCodeObject* group = this->CreateObject(cmXCodeObject::PBXGroup);
   cmXCodeObject* groupChildren =
     this->CreateObject(cmXCodeObject::OBJECT_LIST);
   group->AddAttribute("name", this->CreateString(name));
   group->AddAttribute("children", groupChildren);
   group->AddAttribute("sourceTree", this->CreateString("<group>"));
-  if (parentChildren)
+  if (parentChildren) {
     parentChildren->AddObject(group);
+  }
   return group;
 }
 
@@ -2866,15 +2872,16 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   v << std::setfill('0') << std::setw(4) << XcodeVersion * 10;
   group->AddAttribute("LastUpgradeCheck", this->CreateString(v.str()));
   this->RootObject->AddAttribute("attributes", group);
-  if (this->XcodeVersion >= 32)
+  if (this->XcodeVersion >= 32) {
     this->RootObject->AddAttribute("compatibilityVersion",
                                    this->CreateString("Xcode 3.2"));
-  else if (this->XcodeVersion >= 31)
+  } else if (this->XcodeVersion >= 31) {
     this->RootObject->AddAttribute("compatibilityVersion",
                                    this->CreateString("Xcode 3.1"));
-  else
+  } else {
     this->RootObject->AddAttribute("compatibilityVersion",
                                    this->CreateString("Xcode 3.0"));
+  }
   // Point Xcode at the top of the source tree.
   {
     std::string pdir =
@@ -3333,12 +3340,13 @@ void cmGlobalXCodeGenerator::WriteXCodePBXProj(std::ostream& fout,
   cmXCodeObject::Indent(1, fout);
   fout << "};\n";
   cmXCodeObject::Indent(1, fout);
-  if (this->XcodeVersion >= 32)
+  if (this->XcodeVersion >= 32) {
     fout << "objectVersion = 46;\n";
-  else if (this->XcodeVersion >= 31)
+  } else if (this->XcodeVersion >= 31) {
     fout << "objectVersion = 45;\n";
-  else
+  } else {
     fout << "objectVersion = 44;\n";
+  }
   cmXCode21Object::PrintList(this->XCodeObjects, fout);
   cmXCodeObject::Indent(1, fout);
   fout << "rootObject = " << this->RootObject->GetId()
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index e0ed445..e54f1f3 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -120,8 +120,9 @@ void cmXCodeObject::Print(std::ostream& out)
   out << "isa = " << PBXTypeNames[this->IsA] << ";" << separator;
   for (i = this->ObjectAttributes.begin(); i != this->ObjectAttributes.end();
        ++i) {
-    if (i->first == "isa")
+    if (i->first == "isa") {
       continue;
+    }
 
     PrintAttribute(out, 3, separator, indentFactor, i->first, i->second, this);
   }
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index 29de35e..f1dce64 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -222,8 +222,9 @@ std::string cmXCodeScheme::FindConfiguration(const std::string& name)
   //
   if (std::find(this->ConfigList.begin(), this->ConfigList.end(), name) ==
         this->ConfigList.end() &&
-      !this->ConfigList.empty())
+      !this->ConfigList.empty()) {
     return this->ConfigList[0];
+  }
 
   return name;
 }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0bab294dcd3f2c4f3be5e491426b5eefb2a9aba
commit f0bab294dcd3f2c4f3be5e491426b5eefb2a9aba
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Wed Sep 20 23:44:34 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:43 2017 -0400

    Convert some leftover loops to C++11 range-based loop
    
    Fix issues diagnosed by clang-tidy [modern-loop-convert]
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CPack/cmCPackBundleGenerator.cxx b/Source/CPack/cmCPackBundleGenerator.cxx
index bbf2a50..f47ca7a 100644
--- a/Source/CPack/cmCPackBundleGenerator.cxx
+++ b/Source/CPack/cmCPackBundleGenerator.cxx
@@ -213,8 +213,7 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
     cmSystemTools::ExpandListArgument(sign_files, relFiles);
 
     // sign the files supplied by the user, ie. frameworks.
-    for (std::vector<std::string>::iterator it = relFiles.begin();
-         it != relFiles.end(); ++it) {
+    for (auto const& file : relFiles) {
       std::ostringstream temp_sign_file_cmd;
       temp_sign_file_cmd << this->GetOption("CPACK_COMMAND_CODESIGN");
       temp_sign_file_cmd << " " << sign_parameter << " -s \""
@@ -223,11 +222,11 @@ int cmCPackBundleGenerator::SignBundle(const std::string& src_dir)
       temp_sign_file_cmd << this->GetOption("CPACK_APPLE_BUNDLE_ID");
       temp_sign_file_cmd << " \"";
       temp_sign_file_cmd << bundle_path;
-      temp_sign_file_cmd << *it << "\"";
+      temp_sign_file_cmd << file << "\"";
 
       if (!this->RunCommand(temp_sign_file_cmd, &output)) {
         cmCPackLogger(cmCPackLog::LOG_ERROR,
-                      "Error signing file:" << bundle_path << *it << std::endl
+                      "Error signing file:" << bundle_path << file << std::endl
                                             << output << std::endl);
 
         return 0;
diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 88b83af..72ddd6a 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -136,17 +136,17 @@ int cmCPackDragNDropGenerator::InitializeInternal()
                     "CPACK_DMG_SLA_LANGUAGES set but empty" << std::endl);
       return 0;
     }
-    for (size_t i = 0; i < languages.size(); ++i) {
-      std::string license = slaDirectory + "/" + languages[i] + ".license.txt";
+    for (auto const& language : languages) {
+      std::string license = slaDirectory + "/" + language + ".license.txt";
       if (!singleLicense && !cmSystemTools::FileExists(license)) {
         cmCPackLogger(cmCPackLog::LOG_ERROR, "Missing license file "
-                        << languages[i] << ".license.txt" << std::endl);
+                        << language << ".license.txt" << std::endl);
         return 0;
       }
-      std::string menu = slaDirectory + "/" + languages[i] + ".menu.txt";
+      std::string menu = slaDirectory + "/" + language + ".menu.txt";
       if (!cmSystemTools::FileExists(menu)) {
         cmCPackLogger(cmCPackLog::LOG_ERROR, "Missing menu file "
-                        << languages[i] << ".menu.txt" << std::endl);
+                        << language << ".menu.txt" << std::endl);
         return 0;
       }
     }
@@ -185,19 +185,19 @@ int cmCPackDragNDropGenerator::PackageFiles()
 
   // loop to create dmg files
   packageFileNames.clear();
-  for (size_t i = 0; i < package_files.size(); i++) {
+  for (auto const& package_file : package_files) {
     std::string full_package_name = std::string(toplevel) + std::string("/");
-    if (package_files[i] == "ALL_IN_ONE") {
+    if (package_file == "ALL_IN_ONE") {
       full_package_name += this->GetOption("CPACK_PACKAGE_FILE_NAME");
     } else {
-      full_package_name += package_files[i];
+      full_package_name += package_file;
     }
     full_package_name += std::string(GetOutputExtension());
     packageFileNames.push_back(full_package_name);
 
     std::string src_dir = toplevel;
     src_dir += "/";
-    src_dir += package_files[i];
+    src_dir += package_file;
 
     if (0 == this->CreateDMG(src_dir, full_package_name)) {
       return 0;
@@ -796,8 +796,8 @@ bool cmCPackDragNDropGenerator::WriteLicense(
         if (!this->BreakLongLine(line, lines, error)) {
           return false;
         }
-        for (size_t i = 0; i < lines.size(); ++i) {
-          outputStream << "        \"" << lines[i] << "\"\n";
+        for (auto const& l : lines) {
+          outputStream << "        \"" << l << "\"\n";
         }
       }
       outputStream << "        \"\\n\"\n";
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 3035663..c218641 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -436,18 +436,13 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
 
   // now make the allbuild depend on all the non-utility targets
   // in the project
-  for (std::vector<cmLocalGenerator*>::iterator i = gens.begin();
-       i != gens.end(); ++i) {
-    cmLocalGenerator* lg = *i;
-    if (this->IsExcluded(root, *i)) {
+  for (auto& gen : gens) {
+    if (this->IsExcluded(root, gen)) {
       continue;
     }
 
-    const std::vector<cmGeneratorTarget*>& tgts = lg->GetGeneratorTargets();
-    for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
-         l != tgts.end(); l++) {
-      cmGeneratorTarget* target = *l;
-
+    const std::vector<cmGeneratorTarget*>& tgts = gen->GetGeneratorTargets();
+    for (auto target : tgts) {
       if (target->GetType() == cmStateEnums::GLOBAL_TARGET) {
         continue;
       }
@@ -473,7 +468,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
         cmCustomCommandLines commandLines;
         commandLines.push_back(makeHelper);
         std::vector<std::string> no_byproducts;
-        lg->GetMakefile()->AddCustomCommandToTarget(
+        gen->GetMakefile()->AddCustomCommandToTarget(
           target->GetName(), no_byproducts, no_depends, commandLines,
           cmTarget::POST_BUILD, "Depend check for xcode", dir.c_str(), true,
           false, "", false, cmMakefile::AcceptObjectLibraryCommands);
@@ -485,7 +480,7 @@ void cmGlobalXCodeGenerator::AddExtraTargets(
       }
 
       // Refer to the build configuration file for easy editing.
-      listfile = lg->GetCurrentSourceDirectory();
+      listfile = gen->GetCurrentSourceDirectory();
       listfile += "/";
       listfile += "CMakeLists.txt";
       target->AddSource(listfile);
@@ -497,9 +492,8 @@ void cmGlobalXCodeGenerator::CreateReRunCMakeFile(
   cmLocalGenerator* root, std::vector<cmLocalGenerator*> const& gens)
 {
   std::vector<std::string> lfiles;
-  for (std::vector<cmLocalGenerator*>::const_iterator gi = gens.begin();
-       gi != gens.end(); ++gi) {
-    std::vector<std::string> const& lf = (*gi)->GetMakefile()->GetListFiles();
+  for (auto gen : gens) {
+    std::vector<std::string> const& lf = gen->GetMakefile()->GetListFiles();
     lfiles.insert(lfiles.end(), lf.begin(), lf.end());
   }
 
@@ -559,8 +553,8 @@ void cmGlobalXCodeGenerator::SortXCodeObjects()
 void cmGlobalXCodeGenerator::ClearXCodeObjects()
 {
   this->TargetDoneSet.clear();
-  for (unsigned int i = 0; i < this->XCodeObjects.size(); ++i) {
-    delete this->XCodeObjects[i];
+  for (auto& obj : this->XCodeObjects) {
+    delete obj;
   }
   this->XCodeObjects.clear();
   this->XCodeObjectIDs.clear();
@@ -934,13 +928,11 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
   typedef std::map<std::string, cmGeneratorTarget*, cmCompareTargets>
     cmSortedTargets;
   cmSortedTargets sortedTargets;
-  for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
-       l != tgts.end(); l++) {
-    sortedTargets[(*l)->GetName()] = *l;
+  for (auto tgt : tgts) {
+    sortedTargets[tgt->GetName()] = tgt;
   }
-  for (cmSortedTargets::iterator l = sortedTargets.begin();
-       l != sortedTargets.end(); l++) {
-    cmGeneratorTarget* gtgt = l->second;
+  for (auto& sortedTarget : sortedTargets) {
+    cmGeneratorTarget* gtgt = sortedTarget.second;
 
     std::string targetName = gtgt->GetName();
 
@@ -1043,9 +1035,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
       sourceBuildPhase->AddAttribute("buildActionMask",
                                      this->CreateString("2147483647"));
       buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
-      for (std::vector<cmXCodeObject*>::iterator i = sourceFiles.begin();
-           i != sourceFiles.end(); ++i) {
-        buildFiles->AddObject(*i);
+      for (auto& sourceFile : sourceFiles) {
+        buildFiles->AddObject(sourceFile);
       }
       sourceBuildPhase->AddAttribute("files", buildFiles);
       sourceBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
@@ -1061,9 +1052,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
       headerBuildPhase->AddAttribute("buildActionMask",
                                      this->CreateString("2147483647"));
       buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
-      for (std::vector<cmXCodeObject*>::iterator i = headerFiles.begin();
-           i != headerFiles.end(); ++i) {
-        buildFiles->AddObject(*i);
+      for (auto& headerFile : headerFiles) {
+        buildFiles->AddObject(headerFile);
       }
       headerBuildPhase->AddAttribute("files", buildFiles);
       headerBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
@@ -1080,9 +1070,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
       resourceBuildPhase->AddAttribute("buildActionMask",
                                        this->CreateString("2147483647"));
       buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
-      for (std::vector<cmXCodeObject*>::iterator i = resourceFiles.begin();
-           i != resourceFiles.end(); ++i) {
-        buildFiles->AddObject(*i);
+      for (auto& resourceFile : resourceFiles) {
+        buildFiles->AddObject(resourceFile);
       }
       resourceBuildPhase->AddAttribute("files", buildFiles);
       resourceBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
@@ -1190,9 +1179,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
                                         this->CreateString("2147483647"));
       buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
       frameworkBuildPhase->AddAttribute("files", buildFiles);
-      for (std::vector<cmXCodeObject*>::iterator i = externalObjFiles.begin();
-           i != externalObjFiles.end(); ++i) {
-        buildFiles->AddObject(*i);
+      for (auto& externalObjFile : externalObjFiles) {
+        buildFiles->AddObject(externalObjFile);
       }
       frameworkBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
                                         this->CreateString("0"));
@@ -1213,14 +1201,13 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets(
 
 void cmGlobalXCodeGenerator::ForceLinkerLanguages()
 {
-  for (unsigned int i = 0; i < this->LocalGenerators.size(); ++i) {
+  for (auto& localGenerator : this->LocalGenerators) {
     const std::vector<cmGeneratorTarget*>& tgts =
-      this->LocalGenerators[i]->GetGeneratorTargets();
+      localGenerator->GetGeneratorTargets();
     // All targets depend on the build-system check target.
-    for (std::vector<cmGeneratorTarget*>::const_iterator ti = tgts.begin();
-         ti != tgts.end(); ++ti) {
+    for (auto tgt : tgts) {
       // This makes sure all targets link using the proper language.
-      this->ForceLinkerLanguage(*ti);
+      this->ForceLinkerLanguage(tgt);
     }
   }
 }
@@ -1241,9 +1228,8 @@ void cmGlobalXCodeGenerator::ForceLinkerLanguage(cmGeneratorTarget* gtgt)
 
   // If the language is compiled as a source trust Xcode to link with it.
   cmLinkImplementation const* impl = gtgt->GetLinkImplementation("NOCONFIG");
-  for (std::vector<std::string>::const_iterator li = impl->Languages.begin();
-       li != impl->Languages.end(); ++li) {
-    if (*li == llang) {
+  for (auto const& Language : impl->Languages) {
+    if (Language == llang) {
       return;
     }
   }
@@ -1545,16 +1531,15 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
   makefileStream << "all: ";
   std::map<const cmCustomCommand*, std::string> tname;
   int count = 0;
-  for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
-       i != commands.end(); ++i) {
-    cmCustomCommandGenerator ccg(*i, configName, this->CurrentLocalGenerator);
+  for (auto const& command : commands) {
+    cmCustomCommandGenerator ccg(command, configName,
+                                 this->CurrentLocalGenerator);
     if (ccg.GetNumberOfCommands() > 0) {
       const std::vector<std::string>& outputs = ccg.GetOutputs();
       if (!outputs.empty()) {
-        for (std::vector<std::string>::const_iterator o = outputs.begin();
-             o != outputs.end(); ++o) {
+        for (auto const& output : outputs) {
           makefileStream << "\\\n\t"
-                         << this->ConvertToRelativeForMake(o->c_str());
+                         << this->ConvertToRelativeForMake(output.c_str());
         }
       } else {
         std::ostringstream str;
@@ -1565,18 +1550,18 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
     }
   }
   makefileStream << "\n\n";
-  for (std::vector<cmCustomCommand>::const_iterator i = commands.begin();
-       i != commands.end(); ++i) {
-    cmCustomCommandGenerator ccg(*i, configName, this->CurrentLocalGenerator);
+  for (auto const& command : commands) {
+    cmCustomCommandGenerator ccg(command, configName,
+                                 this->CurrentLocalGenerator);
     if (ccg.GetNumberOfCommands() > 0) {
       makefileStream << "\n";
       const std::vector<std::string>& outputs = ccg.GetOutputs();
       if (!outputs.empty()) {
         // There is at least one output, start the rule for it
         const char* sep = "";
-        for (std::vector<std::string>::const_iterator oi = outputs.begin();
-             oi != outputs.end(); ++oi) {
-          makefileStream << sep << this->ConvertToRelativeForMake(oi->c_str());
+        for (auto const& output : outputs) {
+          makefileStream << sep
+                         << this->ConvertToRelativeForMake(output.c_str());
           sep = " ";
         }
         makefileStream << ": ";
@@ -1584,11 +1569,9 @@ void cmGlobalXCodeGenerator::CreateCustomRulesMakefile(
         // There are no outputs.  Use the generated force rule name.
         makefileStream << tname[&ccg.GetCC()] << ": ";
       }
-      for (std::vector<std::string>::const_iterator d =
-             ccg.GetDepends().begin();
-           d != ccg.GetDepends().end(); ++d) {
+      for (auto const& d : ccg.GetDepends()) {
         std::string dep;
-        if (this->CurrentLocalGenerator->GetRealDependency(*d, configName,
+        if (this->CurrentLocalGenerator->GetRealDependency(d, configName,
                                                            dep)) {
           makefileStream << "\\\n"
                          << this->ConvertToRelativeForMake(dep.c_str());
@@ -1643,9 +1626,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   std::set<std::string> languages;
   gtgt->GetLanguages(languages, configName);
   std::map<std::string, std::string> cflags;
-  for (std::set<std::string>::iterator li = languages.begin();
-       li != languages.end(); ++li) {
-    std::string const& lang = *li;
+  for (auto const& lang : languages) {
     std::string& flags = cflags[lang];
 
     // Add language-specific flags.
@@ -1741,9 +1722,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
     } else {
       cmXCodeObject* archObjects =
         this->CreateObject(cmXCodeObject::OBJECT_LIST);
-      for (std::vector<std::string>::iterator i = archs.begin();
-           i != archs.end(); i++) {
-        archObjects->AddObject(this->CreateString(*i));
+      for (auto& arch : archs) {
+        archObjects->AddObject(this->CreateString(arch));
       }
       buildSettings->AddAttribute("ARCHS", archObjects);
     }
@@ -1968,10 +1948,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   std::set<std::string> emitted;
   emitted.insert("/System/Library/Frameworks");
 
-  for (std::vector<std::string>::iterator i = includes.begin();
-       i != includes.end(); ++i) {
-    if (this->NameResolvesToFramework(*i)) {
-      std::string frameworkDir = *i;
+  for (auto& include : includes) {
+    if (this->NameResolvesToFramework(include)) {
+      std::string frameworkDir = include;
       frameworkDir += "/../";
       frameworkDir = cmSystemTools::CollapseFullPath(frameworkDir);
       if (emitted.insert(frameworkDir).second) {
@@ -1984,9 +1963,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
         }
       }
     } else {
-      std::string incpath = this->XCodeEscapePath(*i);
+      std::string incpath = this->XCodeEscapePath(include);
       if (emitSystemIncludes &&
-          gtgt->IsSystemIncludeDirectory(*i, configName)) {
+          gtgt->IsSystemIncludeDirectory(include, configName)) {
         sysdirs.Add(incpath);
       } else {
         dirs.Add(incpath);
@@ -1996,12 +1975,11 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   // Add framework search paths needed for linking.
   if (cmComputeLinkInformation* cli = gtgt->GetLinkInformation(configName)) {
     std::vector<std::string> const& fwDirs = cli->GetFrameworkPaths();
-    for (std::vector<std::string>::const_iterator fdi = fwDirs.begin();
-         fdi != fwDirs.end(); ++fdi) {
-      if (emitted.insert(*fdi).second) {
-        std::string incpath = this->XCodeEscapePath(*fdi);
+    for (auto const& fwDir : fwDirs) {
+      if (emitted.insert(fwDir).second) {
+        std::string incpath = this->XCodeEscapePath(fwDir);
         if (emitSystemIncludes &&
-            gtgt->IsSystemIncludeDirectory(*fdi, configName)) {
+            gtgt->IsSystemIncludeDirectory(fwDir, configName)) {
           sysfdirs.Add(incpath);
         } else {
           fdirs.Add(incpath);
@@ -2029,13 +2007,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
     // system include directory awareness. We need to also keep on setting
     // HEADER_SEARCH_PATHS to work around a missing compile options flag for
     // GNU assembly files (#16449)
-    for (std::set<std::string>::iterator li = languages.begin();
-         li != languages.end(); ++li) {
+    for (auto const& language : languages) {
       std::string includeFlags = this->CurrentLocalGenerator->GetIncludeFlags(
-        includes, gtgt, *li, true, false, configName);
+        includes, gtgt, language, true, false, configName);
 
       if (!includeFlags.empty()) {
-        cflags[*li] += " " + includeFlags;
+        cflags[language] += " " + includeFlags;
       }
     }
   }
@@ -2046,10 +2023,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   std::string optLevel = "0";
 
   // Minimal map of flags to build settings.
-  for (std::set<std::string>::iterator li = languages.begin();
-       li != languages.end(); ++li) {
-    std::string& flags = cflags[*li];
-    std::string& gflag = gflags[*li];
+  for (auto const& language : languages) {
+    std::string& flags = cflags[language];
+    std::string& gflag = gflags[language];
     std::string oflag =
       this->ExtractFlagRegex("(^| )(-Ofast|-Os|-O[0-9]*)( |$)", 2, flags);
     if (oflag.size() == 2) {
@@ -2074,10 +2050,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   if (!same_gflags) {
     // We can't set the Xcode flag differently depending on the language,
     // so put them back in this case.
-    for (std::set<std::string>::iterator li = languages.begin();
-         li != languages.end(); ++li) {
-      cflags[*li] += " ";
-      cflags[*li] += gflags[*li];
+    for (auto const& language : languages) {
+      cflags[language] += " ";
+      cflags[language] += gflags[language];
     }
     debugStr = "NO";
   } else if (last_gflag && (last_gflag->empty() || *last_gflag == "-g0")) {
@@ -2094,18 +2069,17 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
                               this->CreateString("NO"));
   buildSettings->AddAttribute("GCC_INLINES_ARE_PRIVATE_EXTERN",
                               this->CreateString("NO"));
-  for (std::set<std::string>::iterator li = languages.begin();
-       li != languages.end(); ++li) {
-    std::string flags = cflags[*li] + " " + defFlags;
-    if (*li == "CXX") {
+  for (auto const& language : languages) {
+    std::string flags = cflags[language] + " " + defFlags;
+    if (language == "CXX") {
       buildSettings->AddAttribute("OTHER_CPLUSPLUSFLAGS",
                                   this->CreateString(flags));
-    } else if (*li == "Fortran") {
+    } else if (language == "Fortran") {
       buildSettings->AddAttribute("IFORT_OTHER_FLAGS",
                                   this->CreateString(flags));
-    } else if (*li == "C") {
+    } else if (language == "C") {
       buildSettings->AddAttribute("OTHER_CFLAGS", this->CreateString(flags));
-    } else if (*li == "Swift") {
+    } else if (language == "Swift") {
       buildSettings->AddAttribute("OTHER_SWIFT_FLAGS",
                                   this->CreateString(flags));
     }
@@ -2229,15 +2203,14 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
   // Convert "XCODE_ATTRIBUTE_*" properties directly.
   {
     std::vector<std::string> const& props = gtgt->GetPropertyKeys();
-    for (std::vector<std::string>::const_iterator i = props.begin();
-         i != props.end(); ++i) {
-      if (i->find("XCODE_ATTRIBUTE_") == 0) {
-        std::string attribute = i->substr(16);
+    for (auto const& prop : props) {
+      if (prop.find("XCODE_ATTRIBUTE_") == 0) {
+        std::string attribute = prop.substr(16);
         this->FilterConfigurationAttribute(configName, attribute);
         if (!attribute.empty()) {
           cmGeneratorExpression ge;
           std::string processed =
-            ge.Parse(gtgt->GetProperty(*i))
+            ge.Parse(gtgt->GetProperty(prop))
               ->Evaluate(this->CurrentLocalGenerator, configName);
           buildSettings->AddAttribute(attribute,
                                       this->CreateString(processed));
@@ -2325,15 +2298,15 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
   configlist->SetComment(comment);
   target->AddAttribute("buildConfigurationList",
                        this->CreateObjectReference(configlist));
-  for (unsigned int i = 0; i < configVector.size(); ++i) {
+  for (auto const& i : configVector) {
     cmXCodeObject* config =
       this->CreateObject(cmXCodeObject::XCBuildConfiguration);
     buildConfigurations->AddObject(config);
     cmXCodeObject* buildSettings =
       this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
-    this->CreateBuildSettings(gtgt, buildSettings, configVector[i]);
-    config->AddAttribute("name", this->CreateString(configVector[i]));
-    config->SetComment(configVector[i]);
+    this->CreateBuildSettings(gtgt, buildSettings, i);
+    config->AddAttribute("name", this->CreateString(i));
+    config->SetComment(i);
     config->AddAttribute("buildSettings", buildSettings);
   }
   if (!configVector.empty()) {
@@ -2562,15 +2535,14 @@ void cmGlobalXCodeGenerator::AppendBuildSettingAttribute(
   std::vector<cmXCodeObject*> list = buildConfigs->GetObjectList();
   // each configuration and the target itself has a buildSettings in it
   // list.push_back(target);
-  for (std::vector<cmXCodeObject*>::iterator i = list.begin(); i != list.end();
-       ++i) {
+  for (auto& i : list) {
     if (!configName.empty()) {
-      if ((*i)->GetObject("name")->GetString() == configName) {
-        cmXCodeObject* settings = (*i)->GetObject("buildSettings");
+      if (i->GetObject("name")->GetString() == configName) {
+        cmXCodeObject* settings = i->GetObject("buildSettings");
         this->AppendOrAddBuildSetting(settings, attribute, value);
       }
     } else {
-      cmXCodeObject* settings = (*i)->GetObject("buildSettings");
+      cmXCodeObject* settings = i->GetObject("buildSettings");
       this->AppendOrAddBuildSetting(settings, attribute, value);
     }
   }
@@ -2589,20 +2561,15 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
 
   // Add dependencies on other CMake targets.
   TargetDependSet const& deps = this->GetTargetDirectDepends(gt);
-  for (TargetDependSet::const_iterator i = deps.begin(); i != deps.end();
-       ++i) {
-    if (cmXCodeObject* dptarget = this->FindXCodeTarget(*i)) {
+  for (auto dep : deps) {
+    if (cmXCodeObject* dptarget = this->FindXCodeTarget(dep)) {
       this->AddDependTarget(target, dptarget);
     }
   }
 
   // Loop over configuration types and set per-configuration info.
-  for (std::vector<std::string>::iterator i =
-         this->CurrentConfigurationTypes.begin();
-       i != this->CurrentConfigurationTypes.end(); ++i) {
+  for (auto const& configName : this->CurrentConfigurationTypes) {
     // Get the current configuration name.
-    std::string configName = *i;
-
     if (this->XcodeVersion >= 50) {
       // Add object library contents as link flags.
       std::string linkObjs;
@@ -2638,9 +2605,8 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
     // Add dependencies directly on library files.
     {
       std::vector<std::string> const& libDeps = cli.GetDepends();
-      for (std::vector<std::string>::const_iterator j = libDeps.begin();
-           j != libDeps.end(); ++j) {
-        target->AddDependLibrary(configName, *j);
+      for (auto const& libDep : libDeps) {
+        target->AddDependLibrary(configName, libDep);
       }
     }
 
@@ -2648,16 +2614,15 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
     {
       std::vector<std::string> const& libDirs = cli.GetDirectories();
       std::string linkDirs;
-      for (std::vector<std::string>::const_iterator libDir = libDirs.begin();
-           libDir != libDirs.end(); ++libDir) {
-        if (!libDir->empty() && *libDir != "/usr/lib") {
+      for (auto const& libDir : libDirs) {
+        if (!libDir.empty() && libDir != "/usr/lib") {
           // Now add the same one but append
           // $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to it:
           linkDirs += " ";
           linkDirs += this->XCodeEscapePath(
-            *libDir + "/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)");
+            libDir + "/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)");
           linkDirs += " ";
-          linkDirs += this->XCodeEscapePath(*libDir);
+          linkDirs += this->XCodeEscapePath(libDir);
         }
       }
       this->AppendBuildSettingAttribute(target, "LIBRARY_SEARCH_PATHS",
@@ -2670,18 +2635,18 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
       const char* sep = "";
       typedef cmComputeLinkInformation::ItemVector ItemVector;
       ItemVector const& libNames = cli.GetItems();
-      for (ItemVector::const_iterator li = libNames.begin();
-           li != libNames.end(); ++li) {
+      for (auto const& libName : libNames) {
         linkLibs += sep;
         sep = " ";
-        if (li->IsPath) {
-          linkLibs += this->XCodeEscapePath(li->Value);
-        } else if (!li->Target ||
-                   li->Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
-          linkLibs += li->Value;
+        if (libName.IsPath) {
+          linkLibs += this->XCodeEscapePath(libName.Value);
+        } else if (!libName.Target ||
+                   libName.Target->GetType() !=
+                     cmStateEnums::INTERFACE_LIBRARY) {
+          linkLibs += libName.Value;
         }
-        if (li->Target && !li->Target->IsImported()) {
-          target->AddDependTarget(configName, li->Target->GetName());
+        if (libName.Target && !libName.Target->IsImported()) {
+          target->AddDependTarget(configName, libName.Target->GetName());
         }
       }
       this->AppendBuildSettingAttribute(
@@ -2693,15 +2658,12 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
 bool cmGlobalXCodeGenerator::CreateGroups(
   std::vector<cmLocalGenerator*>& generators)
 {
-  for (std::vector<cmLocalGenerator*>::iterator i = generators.begin();
-       i != generators.end(); ++i) {
-    cmMakefile* mf = (*i)->GetMakefile();
+  for (auto& generator : generators) {
+    cmMakefile* mf = generator->GetMakefile();
     std::vector<cmSourceGroup> sourceGroups = mf->GetSourceGroups();
-    const std::vector<cmGeneratorTarget*>& tgts = (*i)->GetGeneratorTargets();
-    for (std::vector<cmGeneratorTarget*>::const_iterator l = tgts.begin();
-         l != tgts.end(); l++) {
-      cmGeneratorTarget* gtgt = *l;
-
+    const std::vector<cmGeneratorTarget*>& tgts =
+      generator->GetGeneratorTargets();
+    for (auto gtgt : tgts) {
       // Same skipping logic here as in CreateXCodeTargets so that we do not
       // end up with (empty anyhow) ALL_BUILD and XCODE_DEPEND_HELPER source
       // groups:
@@ -2725,10 +2687,8 @@ bool cmGlobalXCodeGenerator::CreateGroups(
         gtgt->GetAllConfigSources();
 
       // Put cmSourceFile instances in proper groups:
-      for (std::vector<cmGeneratorTarget::AllConfigSource>::const_iterator si =
-             sources.begin();
-           si != sources.end(); ++si) {
-        cmSourceFile const* sf = si->Source;
+      for (auto const& si : sources) {
+        cmSourceFile const* sf = si.Source;
         if (this->XcodeVersion >= 50 && !sf->GetObjectLibrary().empty()) {
           // Object library files go on the link line instead.
           continue;
@@ -2824,13 +2784,13 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateOrGetPBXGroup(
       cmSystemTools::tokenize(sg->GetFullName(), "\\");
     std::string curr_folder = target;
     curr_folder += "/";
-    for (std::vector<std::string>::size_type i = 0; i < folders.size(); i++) {
-      curr_folder += folders[i];
+    for (auto const& folder : folders) {
+      curr_folder += folder;
       std::map<std::string, cmXCodeObject*>::iterator i_folder =
         this->GroupNameMap.find(curr_folder);
       // Create new folder
       if (i_folder == this->GroupNameMap.end()) {
-        cmXCodeObject* group = this->CreatePBXGroup(tgroup, folders[i]);
+        cmXCodeObject* group = this->CreatePBXGroup(tgroup, folder);
         this->GroupNameMap[curr_folder] = group;
         tgroup = group;
       } else {
@@ -2854,10 +2814,10 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   cmXCodeObject* group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
   group->AddAttribute("COPY_PHASE_STRIP", this->CreateString("NO"));
   cmXCodeObject* listObjs = this->CreateObject(cmXCodeObject::OBJECT_LIST);
-  for (unsigned int i = 0; i < this->CurrentConfigurationTypes.size(); ++i) {
+  for (auto& CurrentConfigurationType : this->CurrentConfigurationTypes) {
     cmXCodeObject* buildStyle =
       this->CreateObject(cmXCodeObject::PBXBuildStyle);
-    const char* name = this->CurrentConfigurationTypes[i].c_str();
+    const char* name = CurrentConfigurationType.c_str();
     buildStyle->AddAttribute("name", this->CreateString(name));
     buildStyle->SetComment(name);
     cmXCodeObject* sgroup = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
@@ -2939,8 +2899,8 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
     config->AddAttribute("name", this->CreateString(name));
     configs.push_back(std::make_pair(name, config));
   }
-  for (Configs::iterator c = configs.begin(); c != configs.end(); ++c) {
-    buildConfigurations->AddObject(c->second);
+  for (auto& config : configs) {
+    buildConfigurations->AddObject(config.second);
   }
   configlist->AddAttribute("buildConfigurations", buildConfigurations);
 
@@ -2998,7 +2958,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   symroot += "/build";
   buildSettings->AddAttribute("SYMROOT", this->CreateString(symroot));
 
-  for (Configs::iterator i = configs.begin(); i != configs.end(); ++i) {
+  for (auto& config : configs) {
     cmXCodeObject* buildSettingsForCfg = this->CreateFlatClone(buildSettings);
 
     // Put this last so it can override existing settings
@@ -3008,43 +2968,38 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
          d != vars.end(); ++d) {
       if (d->find("CMAKE_XCODE_ATTRIBUTE_") == 0) {
         std::string attribute = d->substr(22);
-        this->FilterConfigurationAttribute(i->first, attribute);
+        this->FilterConfigurationAttribute(config.first, attribute);
         if (!attribute.empty()) {
           cmGeneratorExpression ge;
           std::string processed =
             ge.Parse(this->CurrentMakefile->GetDefinition(*d))
-              ->Evaluate(this->CurrentLocalGenerator, i->first);
+              ->Evaluate(this->CurrentLocalGenerator, config.first);
           buildSettingsForCfg->AddAttribute(attribute,
                                             this->CreateString(processed));
         }
       }
     }
     // store per-config buildSettings into configuration object
-    i->second->AddAttribute("buildSettings", buildSettingsForCfg);
+    config.second->AddAttribute("buildSettings", buildSettingsForCfg);
   }
 
   this->RootObject->AddAttribute("buildConfigurationList",
                                  this->CreateObjectReference(configlist));
 
   std::vector<cmXCodeObject*> targets;
-  for (std::vector<cmLocalGenerator*>::iterator i = generators.begin();
-       i != generators.end(); ++i) {
-    if (!this->CreateXCodeTargets(*i, targets)) {
+  for (auto& generator : generators) {
+    if (!this->CreateXCodeTargets(generator, targets)) {
       return false;
     }
   }
   // loop over all targets and add link and depend info
-  for (std::vector<cmXCodeObject*>::iterator i = targets.begin();
-       i != targets.end(); ++i) {
-    cmXCodeObject* t = *i;
+  for (auto t : targets) {
     this->AddDependAndLinkInformation(t);
   }
   this->CreateXCodeDependHackTarget(targets);
   // now add all targets to the root object
   cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST);
-  for (std::vector<cmXCodeObject*>::iterator i = targets.begin();
-       i != targets.end(); ++i) {
-    cmXCodeObject* t = *i;
+  for (auto t : targets) {
     allTargets->AddObject(t);
     cmXCodeObject* productRef = t->GetObject("productReference");
     if (productRef) {
@@ -3137,9 +3092,7 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
          this->CurrentConfigurationTypes.begin();
        ct != this->CurrentConfigurationTypes.end(); ++ct) {
     std::string configName = *ct;
-    for (std::vector<cmXCodeObject*>::iterator i = targets.begin();
-         i != targets.end(); ++i) {
-      cmXCodeObject* target = *i;
+    for (auto target : targets) {
       cmGeneratorTarget* gt = target->GetTarget();
 
       if (gt->GetType() == cmStateEnums::EXECUTABLE ||
@@ -3164,9 +3117,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
           target->GetDependTargets().find(*ct);
         if (y != target->GetDependTargets().end()) {
           std::vector<std::string> const& deptgts = y->second;
-          for (std::vector<std::string>::const_iterator d = deptgts.begin();
-               d != deptgts.end(); ++d) {
-            makefileStream << this->PostBuildMakeTarget(*d, *ct) << ": "
+          for (auto const& deptgt : deptgts) {
+            makefileStream << this->PostBuildMakeTarget(deptgt, *ct) << ": "
                            << trel << "\n";
           }
         }
@@ -3188,9 +3140,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
           target->GetDependLibraries().find(*ct);
         if (x != target->GetDependLibraries().end()) {
           std::vector<std::string> const& deplibs = x->second;
-          for (std::vector<std::string>::const_iterator d = deplibs.begin();
-               d != deplibs.end(); ++d) {
-            std::string file = this->ConvertToRelativeForMake(d->c_str());
+          for (auto const& deplib : deplibs) {
+            std::string file = this->ConvertToRelativeForMake(deplib.c_str());
             makefileStream << "\\\n\t" << file;
             dummyRules.insert(file);
           }
@@ -3222,11 +3173,9 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
         if (this->Architectures.size() > 1) {
           std::string universal = this->GetObjectsNormalDirectory(
             this->CurrentProject, configName, gt);
-          for (std::vector<std::string>::iterator arch =
-                 this->Architectures.begin();
-               arch != this->Architectures.end(); ++arch) {
+          for (auto& architecture : this->Architectures) {
             std::string universalFile = universal;
-            universalFile += *arch;
+            universalFile += architecture;
             universalFile += "/";
             universalFile += gt->GetFullName(configName);
             makefileStream << "\t/bin/rm -f "
@@ -3243,9 +3192,8 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
   makefileStream << "\n\n"
                  << "# For each target create a dummy rule"
                  << "so the target does not have to exist\n";
-  for (std::set<std::string>::const_iterator it = dummyRules.begin();
-       it != dummyRules.end(); ++it) {
-    makefileStream << *it << ":\n";
+  for (auto const& dummyRule : dummyRules) {
+    makefileStream << dummyRule << ":\n";
   }
 }
 
@@ -3256,9 +3204,8 @@ void cmGlobalXCodeGenerator::OutputXCodeProject(
     return;
   }
   // Skip local generators that are excluded from this project.
-  for (std::vector<cmLocalGenerator*>::iterator g = generators.begin();
-       g != generators.end(); ++g) {
-    if (this->IsExcluded(root, *g)) {
+  for (auto& generator : generators) {
+    if (this->IsExcluded(root, generator)) {
       continue;
     }
   }
@@ -3511,11 +3458,10 @@ void cmGlobalXCodeGenerator::AppendDefines(
 {
   // GCC_PREPROCESSOR_DEFINITIONS is a space-separated list of definitions.
   std::string def;
-  for (std::vector<std::string>::const_iterator di = defines.begin();
-       di != defines.end(); ++di) {
+  for (auto const& define : defines) {
     // Start with -D if requested.
     def = dflag ? "-D" : "";
-    def += *di;
+    def += define;
 
     // Append the flag with needed escapes.
     std::string tmp;
diff --git a/Source/cmLocalXCodeGenerator.cxx b/Source/cmLocalXCodeGenerator.cxx
index 355c394..853e66c 100644
--- a/Source/cmLocalXCodeGenerator.cxx
+++ b/Source/cmLocalXCodeGenerator.cxx
@@ -43,9 +43,8 @@ void cmLocalXCodeGenerator::Generate()
   cmLocalGenerator::Generate();
 
   const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
-  for (std::vector<cmGeneratorTarget*>::const_iterator iter = targets.begin();
-       iter != targets.end(); ++iter) {
-    (*iter)->HasMacOSXRpathInstallNameDir("");
+  for (auto target : targets) {
+    target->HasMacOSXRpathInstallNameDir("");
   }
 }
 
@@ -54,9 +53,8 @@ void cmLocalXCodeGenerator::GenerateInstallRules()
   cmLocalGenerator::GenerateInstallRules();
 
   const std::vector<cmGeneratorTarget*>& targets = this->GetGeneratorTargets();
-  for (std::vector<cmGeneratorTarget*>::const_iterator iter = targets.begin();
-       iter != targets.end(); ++iter) {
-    (*iter)->HasMacOSXRpathInstallNameDir("");
+  for (auto target : targets) {
+    target->HasMacOSXRpathInstallNameDir("");
   }
 }
 
@@ -69,10 +67,8 @@ void cmLocalXCodeGenerator::ComputeObjectFilenames(
   // to avoid exact duplicate file names. Note that Mac file names are not
   // typically case sensitive, hence the LowerCase.
   std::map<std::string, int> counts;
-  for (std::map<cmSourceFile const*, std::string>::iterator si =
-         mapping.begin();
-       si != mapping.end(); ++si) {
-    cmSourceFile const* sf = si->first;
+  for (auto& si : mapping) {
+    cmSourceFile const* sf = si.first;
     std::string objectName =
       cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath());
     objectName += ".o";
@@ -82,6 +78,6 @@ void cmLocalXCodeGenerator::ComputeObjectFilenames(
     if (2 == counts[objectNameLower]) {
       // TODO: emit warning about duplicate name?
     }
-    si->second = objectName;
+    si.second = objectName;
   }
 }
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index 8002175..7294c1c 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -251,8 +251,7 @@ cmMachOInternal::cmMachOInternal(const char* fname)
     }
 
     // parse each Mach-O file
-    for (size_t i = 0; i < this->FatArchs.size(); i++) {
-      const fat_arch& arch = this->FatArchs[i];
+    for (const auto& arch : this->FatArchs) {
       if (!this->read_mach_o(OSSwapBigToHostInt32(arch.offset))) {
         return;
       }
@@ -265,8 +264,8 @@ cmMachOInternal::cmMachOInternal(const char* fname)
 
 cmMachOInternal::~cmMachOInternal()
 {
-  for (size_t i = 0; i < this->MachOList.size(); i++) {
-    delete this->MachOList[i];
+  for (auto& i : this->MachOList) {
+    delete i;
   }
 }
 
diff --git a/Source/cmXCode21Object.cxx b/Source/cmXCode21Object.cxx
index 719e627..a9bb2ef 100644
--- a/Source/cmXCode21Object.cxx
+++ b/Source/cmXCode21Object.cxx
@@ -34,9 +34,7 @@ void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
                                 std::ostream& out, PBXType t)
 {
   bool hasOne = false;
-  for (std::vector<cmXCodeObject*>::const_iterator i = v.begin(); i != v.end();
-       ++i) {
-    cmXCodeObject* obj = *i;
+  for (auto obj : v) {
     if (obj->GetType() == OBJECT && obj->GetIsA() == t) {
       hasOne = true;
       break;
@@ -46,9 +44,7 @@ void cmXCode21Object::PrintList(std::vector<cmXCodeObject*> const& v,
     return;
   }
   out << "\n/* Begin " << PBXTypeNames[t] << " section */\n";
-  for (std::vector<cmXCodeObject*>::const_iterator i = v.begin(); i != v.end();
-       ++i) {
-    cmXCodeObject* obj = *i;
+  for (auto obj : v) {
     if (obj->GetType() == OBJECT && obj->GetIsA() == t) {
       obj->Print(out);
     }
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 356ebd0..e0ed445 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -203,9 +203,9 @@ void cmXCodeObject::PrintList(std::vector<cmXCodeObject*> const& objs,
 {
   cmXCodeObject::Indent(1, out);
   out << "objects = {\n";
-  for (unsigned int i = 0; i < objs.size(); ++i) {
-    if (objs[i]->TypeValue == OBJECT) {
-      objs[i]->Print(out);
+  for (auto obj : objs) {
+    if (obj->TypeValue == OBJECT) {
+      obj->Print(out);
     }
   }
   cmXCodeObject::Indent(1, out);
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index 22ec61b..b0f1d31 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -119,9 +119,7 @@ public:
   // search the attribute list for an object of the specified type
   cmXCodeObject* GetObject(cmXCodeObject::PBXType t) const
   {
-    for (std::vector<cmXCodeObject*>::const_iterator i = this->List.begin();
-         i != this->List.end(); ++i) {
-      cmXCodeObject* o = *i;
+    for (auto o : this->List) {
       if (o->IsA == t) {
         return o;
       }
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index 98e814b..29de35e 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -104,12 +104,11 @@ void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
   xout.Attribute("shouldUseLaunchSchemeArgsEnv", "YES");
 
   xout.StartElement("Testables");
-  for (TestObjects::const_iterator it = this->Tests.begin();
-       it != this->Tests.end(); ++it) {
+  for (auto test : this->Tests) {
     xout.StartElement("TestableReference");
     xout.BreakAttributes();
     xout.Attribute("skipped", "NO");
-    WriteBuildableReference(xout, *it, container);
+    WriteBuildableReference(xout, test, container);
     xout.EndElement(); // TestableReference
   }
   xout.EndElement();

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b5d7f5b0e8490a66cdd603e0ee38890426b3b6c4
commit b5d7f5b0e8490a66cdd603e0ee38890426b3b6c4
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 23:58:08 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:42 2017 -0400

    Fix occurrences of readability-non-const-parameter
    
    Fix issues diagnosed by clang-tidy [readability-non-const-parameter]
    
    The patch separates the definitions of the function headers for the two
    variants (CMAKE_USE_ELF_PARSER or not) and comments out the parameter names
    to not consider them for any const-ness in the case they are actually not
    even looked at.
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 26073d3..63c1452 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2326,12 +2326,12 @@ struct cmSystemToolsRPathInfo
 };
 #endif
 
+#if defined(CMAKE_USE_ELF_PARSER)
 bool cmSystemTools::ChangeRPath(std::string const& file,
                                 std::string const& oldRPath,
                                 std::string const& newRPath, std::string* emsg,
                                 bool* changed)
 {
-#if defined(CMAKE_USE_ELF_PARSER)
   if (changed) {
     *changed = false;
   }
@@ -2497,15 +2497,16 @@ bool cmSystemTools::ChangeRPath(std::string const& file,
     *changed = true;
   }
   return true;
+}
 #else
-  (void)file;
-  (void)oldRPath;
-  (void)newRPath;
-  (void)emsg;
-  (void)changed;
+bool cmSystemTools::ChangeRPath(std::string const& /*file*/,
+                                std::string const& /*oldRPath*/,
+                                std::string const& /*newRPath*/,
+                                std::string* /*emsg*/, bool* /*changed*/)
+{
   return false;
-#endif
 }
+#endif
 
 bool cmSystemTools::VersionCompare(cmSystemTools::CompareOp op,
                                    const char* lhss, const char* rhss)
@@ -2639,10 +2640,10 @@ int cmSystemTools::strverscmp(std::string const& lhs, std::string const& rhs)
   return cm_strverscmp(lhs.c_str(), rhs.c_str());
 }
 
+#if defined(CMAKE_USE_ELF_PARSER)
 bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
                                 bool* removed)
 {
-#if defined(CMAKE_USE_ELF_PARSER)
   if (removed) {
     *removed = false;
   }
@@ -2780,13 +2781,14 @@ bool cmSystemTools::RemoveRPath(std::string const& file, std::string* emsg,
     *removed = true;
   }
   return true;
+}
 #else
-  (void)file;
-  (void)emsg;
-  (void)removed;
+bool cmSystemTools::RemoveRPath(std::string const& /*file*/,
+                                std::string* /*emsg*/, bool* /*removed*/)
+{
   return false;
-#endif
 }
+#endif
 
 bool cmSystemTools::CheckRPath(std::string const& file,
                                std::string const& newRPath)

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a2da3395034844fb91998005d9c7db648492c6b
commit 9a2da3395034844fb91998005d9c7db648492c6b
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 23:49:38 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:42 2017 -0400

    Fix some occurrences of readability-avoid-const-params-in-decls
    
    Fix issues diagnosed by clang-tidy [readability-avoid-const-params-in-decls]
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 457f913..356ebd0 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -129,9 +129,9 @@ void cmXCodeObject::Print(std::ostream& out)
   out << "};\n";
 }
 
-void cmXCodeObject::PrintAttribute(std::ostream& out, const int level,
-                                   const std::string& separator,
-                                   const int factor, const std::string& name,
+void cmXCodeObject::PrintAttribute(std::ostream& out, int level,
+                                   const std::string& separator, int factor,
+                                   const std::string& name,
                                    const cmXCodeObject* object,
                                    const cmXCodeObject* parent)
 {
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index ceed601..22ec61b 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -94,8 +94,8 @@ public:
   }
   static void Indent(int level, std::ostream& out);
   void Print(std::ostream& out);
-  void PrintAttribute(std::ostream& out, const int level,
-                      const std::string& separator, const int factor,
+  void PrintAttribute(std::ostream& out, int level,
+                      const std::string& separator, int factor,
                       const std::string& name, const cmXCodeObject* object,
                       const cmXCodeObject* parent);
   virtual void PrintComment(std::ostream&) {}

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=870dd06da15751250786d435ee4c1361a2b10b4d
commit 870dd06da15751250786d435ee4c1361a2b10b4d
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 16:19:31 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:42 2017 -0400

    Fix left-over occurrences of else-after-return
    
    Fix issues diagnosed by clang-tidy [readability-else-after-return]
    
    These were mostly only showing up on OSX.
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index e5329ad..88b83af 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -226,14 +226,14 @@ bool cmCPackDragNDropGenerator::CreateEmptyFile(std::ostringstream& target,
   cmsys::ofstream fout(target.str().c_str(), std::ios::out | std::ios::binary);
   if (!fout) {
     return false;
-  } else {
-    // Seek to desired size - 1 byte
-    fout.seekp(size - 1, std::ios::beg);
-    char byte = 0;
-    // Write one byte to ensure file grows
-    fout.write(&byte, 1);
   }
 
+  // Seek to desired size - 1 byte
+  fout.seekp(size - 1, std::ios::beg);
+  char byte = 0;
+  // Write one byte to ensure file grows
+  fout.write(&byte, 1);
+
   return true;
 }
 
diff --git a/Source/CPack/cmCPackPKGGenerator.cxx b/Source/CPack/cmCPackPKGGenerator.cxx
index 321b6a7..4f5b2a0 100644
--- a/Source/CPack/cmCPackPKGGenerator.cxx
+++ b/Source/CPack/cmCPackPKGGenerator.cxx
@@ -42,9 +42,9 @@ std::string cmCPackPKGGenerator::GetPackageName(
     out << cmSystemTools::GetFilenameWithoutLastExtension(packagesDir) << "-"
         << component.Name << ".pkg";
     return out.str();
-  } else {
-    return component.ArchiveFile + ".pkg";
   }
+
+  return component.ArchiveFile + ".pkg";
 }
 
 void cmCPackPKGGenerator::WriteDistributionFile(const char* metapackageFile)
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index f06ef43..fdd5f0c 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2294,10 +2294,9 @@ bool cmFileCommand::HandleReadElfCommand(std::vector<std::string> const& args)
   if (errorArg.GetString().empty()) {
     this->SetError(error);
     return false;
-  } else {
-    this->Makefile->AddDefinition(errorArg.GetString(), error.c_str());
-    return true;
   }
+  this->Makefile->AddDefinition(errorArg.GetString(), error.c_str());
+  return true;
 #endif
 }
 
diff --git a/Source/cmFileTimeComparison.cxx b/Source/cmFileTimeComparison.cxx
index 61e419c..622c15e 100644
--- a/Source/cmFileTimeComparison.cxx
+++ b/Source/cmFileTimeComparison.cxx
@@ -116,18 +116,22 @@ int cmFileTimeComparisonInternal::Compare(cmFileTimeComparison_Type* s1,
   // Compare using nanosecond resolution.
   if (s1->st_mtimespec.tv_sec < s2->st_mtimespec.tv_sec) {
     return -1;
-  } else if (s1->st_mtimespec.tv_sec > s2->st_mtimespec.tv_sec) {
+  }
+  if (s1->st_mtimespec.tv_sec > s2->st_mtimespec.tv_sec) {
     return 1;
-  } else if (s1->st_mtimespec.tv_nsec < s2->st_mtimespec.tv_nsec) {
+  }
+  if (s1->st_mtimespec.tv_nsec < s2->st_mtimespec.tv_nsec) {
     return -1;
-  } else if (s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) {
+  }
+  if (s1->st_mtimespec.tv_nsec > s2->st_mtimespec.tv_nsec) {
     return 1;
   }
 #else
   // Compare using 1 second resolution.
   if (s1->st_mtime < s2->st_mtime) {
     return -1;
-  } else if (s1->st_mtime > s2->st_mtime) {
+  }
+  if (s1->st_mtime > s2->st_mtime) {
     return 1;
   }
 #endif
@@ -162,20 +166,20 @@ bool cmFileTimeComparisonInternal::TimesDiffer(cmFileTimeComparison_Type* s1,
   long long t2 = s2->st_mtimespec.tv_sec * bil + s2->st_mtimespec.tv_nsec;
   if (t1 < t2) {
     return (t2 - t1) >= bil;
-  } else if (t2 < t1) {
+  }
+  if (t2 < t1) {
     return (t1 - t2) >= bil;
-  } else {
-    return false;
   }
+  return false;
 #else
   // Times are integers in units of 1s.
   if (s1->st_mtime < s2->st_mtime) {
     return (s2->st_mtime - s1->st_mtime) >= 1;
-  } else if (s1->st_mtime > s2->st_mtime) {
+  }
+  if (s1->st_mtime > s2->st_mtime) {
     return (s1->st_mtime - s2->st_mtime) >= 1;
-  } else {
-    return false;
   }
+  return false;
 #endif
 #else
   // Times are integers in units of 100ns.
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 5dc5950..3035663 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -111,9 +111,8 @@ public:
   {
     if (this->Group) {
       return this->Group;
-    } else {
-      return this->Generator->CreateString(this->String);
     }
+    return this->Generator->CreateString(this->String);
   }
 };
 
@@ -240,10 +239,9 @@ std::string cmGlobalXCodeGenerator::FindXcodeBuildCommand()
       makeProgram = "xcodebuild";
     }
     return makeProgram;
-  } else {
-    // Use cmakexbuild wrapper to suppress environment dump from output.
-    return cmSystemTools::GetCMakeCommand() + "xbuild";
   }
+  // Use cmakexbuild wrapper to suppress environment dump from output.
+  return cmSystemTools::GetCMakeCommand() + "xbuild";
 }
 
 bool cmGlobalXCodeGenerator::SetGeneratorToolset(std::string const& ts,
@@ -2355,9 +2353,8 @@ const char* cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(
       (target->GetType() == cmStateEnums::STATIC_LIBRARY ||
        target->GetType() == cmStateEnums::OBJECT_LIBRARY)) {
     return "OTHER_LIBTOOLFLAGS";
-  } else {
-    return "OTHER_LDFLAGS";
   }
+  return "OTHER_LDFLAGS";
 }
 
 const char* cmGlobalXCodeGenerator::GetTargetFileType(
@@ -2376,10 +2373,9 @@ const char* cmGlobalXCodeGenerator::GetTargetFileType(
     case cmStateEnums::MODULE_LIBRARY:
       if (target->IsXCTestOnApple())
         return "wrapper.cfbundle";
-      else if (target->IsCFBundleOnApple())
+      if (target->IsCFBundleOnApple())
         return "wrapper.plug-in";
-      else
-        return "compiled.mach-o.executable";
+      return "compiled.mach-o.executable";
     case cmStateEnums::SHARED_LIBRARY:
       return (target->GetPropertyAsBool("FRAMEWORK")
                 ? "wrapper.framework"

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=2033abff0dec29072ac070cb6fe1604e8c03f180
commit 2033abff0dec29072ac070cb6fe1604e8c03f180
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 16:19:14 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:42 2017 -0400

    Fix minor clang-tidy findings
    
    Fix issues diagnosed by clang-tidy
     - modernize-use-bool-literals
     - misc-string-integer-assignment
     - performance-faster-string-find
     - readability-redundant-string-cstr
     - readability-delete-null-pointer
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index ed4463c..6a6dc82 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -190,7 +190,7 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
     cmCPackLogger(cmCPackLog::LOG_ERROR,
                   "Problem creating installer directory: " << scriptDir
                                                            << std::endl);
-    return 0;
+    return false;
   }
 
   // if preflight, postflight, or postupgrade are set
diff --git a/Source/cmFindLibraryCommand.cxx b/Source/cmFindLibraryCommand.cxx
index b8b51ba..758da2c 100644
--- a/Source/cmFindLibraryCommand.cxx
+++ b/Source/cmFindLibraryCommand.cxx
@@ -260,7 +260,7 @@ void cmFindLibraryHelper::RegexFromLiteral(std::string& out,
       out += "\\";
     }
 #if defined(_WIN32) || defined(__APPLE__)
-    out += tolower(ch);
+    out += static_cast<char>(tolower(ch));
 #else
     out += ch;
 #endif
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 29b06c3..5dc5950 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1471,7 +1471,7 @@ void cmGlobalXCodeGenerator::FilterConfigurationAttribute(
     return;
   }
 
-  std::string::size_type endVariant = attribute.find("]", beginVariant + 9);
+  std::string::size_type endVariant = attribute.find(']', beginVariant + 9);
   if (endVariant == std::string::npos) {
     // There is no terminating bracket.
     return;
@@ -2894,7 +2894,7 @@ bool cmGlobalXCodeGenerator::CreateXCodeObjects(
   std::string project_id = "PROJECT_";
   project_id += root->GetProjectName();
   this->RootObject->SetId(
-    this->GetOrCreateId(project_id.c_str(), this->RootObject->GetId()));
+    this->GetOrCreateId(project_id, this->RootObject->GetId()));
 
   group = this->CreateObject(cmXCodeObject::ATTRIBUTE_GROUP);
   this->RootObject->AddAttribute("mainGroup",
diff --git a/Source/cmInstalledFile.cxx b/Source/cmInstalledFile.cxx
index c8144aa..3ffeabd 100644
--- a/Source/cmInstalledFile.cxx
+++ b/Source/cmInstalledFile.cxx
@@ -16,9 +16,7 @@ cmInstalledFile::cmInstalledFile()
 
 cmInstalledFile::~cmInstalledFile()
 {
-  if (NameExpression) {
-    delete NameExpression;
-  }
+  delete NameExpression;
 }
 
 cmInstalledFile::Property::Property()

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=79b8c3802a430577a83ead5b0baab7038a813116
commit 79b8c3802a430577a83ead5b0baab7038a813116
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 16:16:25 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:41 2017 -0400

    Improve several occurrences of vector::push_back in loops
    
    Fix issues diagnosed by clang-tidy by pre-allocating the vector capacity
    before the loop [performance-inefficient-vector-operation].
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CTest/cmCTestBuildHandler.cxx b/Source/CTest/cmCTestBuildHandler.cxx
index 1da42d4..f4fc769 100644
--- a/Source/CTest/cmCTestBuildHandler.cxx
+++ b/Source/CTest/cmCTestBuildHandler.cxx
@@ -769,6 +769,7 @@ int cmCTestBuildHandler::RunMakeCommand(const char* command, int* retVal,
   }
 
   std::vector<const char*> argv;
+  argv.reserve(args.size() + 1);
   for (std::string const& arg : args) {
     argv.push_back(arg.c_str());
   }
diff --git a/Source/CTest/cmCTestGIT.cxx b/Source/CTest/cmCTestGIT.cxx
index 7fe74af..8cb795e 100644
--- a/Source/CTest/cmCTestGIT.cxx
+++ b/Source/CTest/cmCTestGIT.cxx
@@ -214,6 +214,7 @@ bool cmCTestGIT::UpdateByCustom(std::string const& custom)
   std::vector<std::string> git_custom_command;
   cmSystemTools::ExpandListArgument(custom, git_custom_command, true);
   std::vector<char const*> git_custom;
+  git_custom.reserve(git_custom_command.size() + 1);
   for (std::string const& i : git_custom_command) {
     git_custom.push_back(i.c_str());
   }
diff --git a/Source/CTest/cmCTestP4.cxx b/Source/CTest/cmCTestP4.cxx
index 11f6a00..fdf8932 100644
--- a/Source/CTest/cmCTestP4.cxx
+++ b/Source/CTest/cmCTestP4.cxx
@@ -464,6 +464,7 @@ bool cmCTestP4::UpdateCustom(const std::string& custom)
   cmSystemTools::ExpandListArgument(custom, p4_custom_command, true);
 
   std::vector<char const*> p4_custom;
+  p4_custom.reserve(p4_custom_command.size() + 1);
   for (std::string const& i : p4_custom_command) {
     p4_custom.push_back(i.c_str());
   }
diff --git a/Source/CTest/cmCTestVC.cxx b/Source/CTest/cmCTestVC.cxx
index 7e09ef0..fd7f37a 100644
--- a/Source/CTest/cmCTestVC.cxx
+++ b/Source/CTest/cmCTestVC.cxx
@@ -56,6 +56,7 @@ bool cmCTestVC::InitialCheckout(const char* command)
   // Construct the initial checkout command line.
   std::vector<std::string> args = cmSystemTools::ParseArguments(command);
   std::vector<char const*> vc_co;
+  vc_co.reserve(args.size() + 1);
   for (std::string const& arg : args) {
     vc_co.push_back(arg.c_str());
   }
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index e248219..4ea1493 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -969,6 +969,7 @@ int cmCTest::RunMakeCommand(const char* command, std::string& output,
   }
 
   std::vector<const char*> argv;
+  argv.reserve(args.size() + 1);
   for (std::string const& a : args) {
     argv.push_back(a.c_str());
   }
@@ -2569,6 +2570,7 @@ bool cmCTest::RunCommand(std::vector<std::string> const& args,
                          const char* dir, double timeout, Encoding encoding)
 {
   std::vector<const char*> argv;
+  argv.reserve(args.size() + 1);
   for (std::string const& a : args) {
     argv.push_back(a.c_str());
   }
diff --git a/Source/cmCommonTargetGenerator.cxx b/Source/cmCommonTargetGenerator.cxx
index bd4077f..1189606 100644
--- a/Source/cmCommonTargetGenerator.cxx
+++ b/Source/cmCommonTargetGenerator.cxx
@@ -194,6 +194,7 @@ std::string cmCommonTargetGenerator::GetManifests()
   this->GeneratorTarget->GetManifests(manifest_srcs, this->ConfigName);
 
   std::vector<std::string> manifests;
+  manifests.reserve(manifest_srcs.size());
   for (cmSourceFile const* manifest_src : manifest_srcs) {
     manifests.push_back(this->LocalCommonGenerator->ConvertToOutputFormat(
       this->LocalCommonGenerator->ConvertToRelativePath(
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index 1b47608..e835b7a 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -602,11 +602,12 @@ bool LanguageData::operator==(const LanguageData& other) const
 void LanguageData::SetDefines(const std::set<std::string>& defines)
 {
   std::vector<std::string> result;
+  result.reserve(defines.size());
   for (std::string const& i : defines) {
     result.push_back(i);
   }
   std::sort(result.begin(), result.end());
-  Defines = result;
+  Defines = std::move(result);
 }
 
 namespace std {
diff --git a/Source/cmStateDirectory.cxx b/Source/cmStateDirectory.cxx
index 5aa8e5b..85e6366 100644
--- a/Source/cmStateDirectory.cxx
+++ b/Source/cmStateDirectory.cxx
@@ -442,6 +442,7 @@ const char* cmStateDirectory::GetProperty(const std::string& prop,
     std::vector<std::string> child_dirs;
     std::vector<cmStateSnapshot> const& children =
       this->DirectoryState->Children;
+    child_dirs.reserve(children.size());
     for (cmStateSnapshot const& ci : children) {
       child_dirs.push_back(ci.GetDirectory().GetCurrentSource());
     }
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 6fdfd44..26073d3 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -700,6 +700,7 @@ bool cmSystemTools::RunSingleCommand(std::vector<std::string> const& command,
                                      double timeout, Encoding encoding)
 {
   std::vector<const char*> argv;
+  argv.reserve(command.size() + 1);
   for (std::string const& cmd : command) {
     argv.push_back(cmd.c_str());
   }
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 5a9e321..c0c7d03 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -348,6 +348,7 @@ int cmcmd::HandleCoCompileCommands(std::vector<std::string>& args)
     std::bind(&cmcmd::HandleCppCheck, a1, a2, a3);
   // copy the command options to a vector of strings
   std::vector<std::string> commandOptions;
+  commandOptions.reserve(coCompileTypes.size());
   for (const auto& i : coCompileTypes) {
     commandOptions.push_back(i.first);
   }
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index fe24a72..f6466fa 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -186,6 +186,7 @@ int main(int argc, char const* const* argv)
 
   // copy the args to a vector
   std::vector<std::string> args;
+  args.reserve(argc);
   for (int i = 0; i < argc; ++i) {
     args.push_back(argv[i]);
   }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a45928cdebcf37de2605e4f58509a37542dd9eba
commit a45928cdebcf37de2605e4f58509a37542dd9eba
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 16:00:21 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:41 2017 -0400

    Fix some occurrences of missing override keywords
    
    Fix issues diagnosed by clang-tidy [modernize-use-override].
    
    These occurrences are only showing up on OSX.
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index a1bec6b..29b06c3 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -47,8 +47,11 @@ public:
     : Version("1.5")
   {
   }
-  void StartElement(const std::string&, const char**) { this->Data = ""; }
-  void EndElement(const std::string& name)
+  void StartElement(const std::string&, const char**) override
+  {
+    this->Data = "";
+  }
+  void EndElement(const std::string& name) override
   {
     if (name == "key") {
       this->Key = this->Data;
@@ -58,7 +61,7 @@ public:
       }
     }
   }
-  void CharacterDataHandler(const char* data, int length)
+  void CharacterDataHandler(const char* data, int length) override
   {
     this->Data.append(data, length);
   }
diff --git a/Source/cmLocalXCodeGenerator.h b/Source/cmLocalXCodeGenerator.h
index b05eab7..8c9596f 100644
--- a/Source/cmLocalXCodeGenerator.h
+++ b/Source/cmLocalXCodeGenerator.h
@@ -27,16 +27,16 @@ public:
   ///! Set cache only and recurse to false by default.
   cmLocalXCodeGenerator(cmGlobalGenerator* gg, cmMakefile* mf);
 
-  virtual ~cmLocalXCodeGenerator();
-  virtual std::string GetTargetDirectory(
-    cmGeneratorTarget const* target) const;
-  virtual void AppendFlagEscape(std::string& flags,
-                                const std::string& rawFlag);
-  virtual void Generate();
+  ~cmLocalXCodeGenerator() override;
+  std::string GetTargetDirectory(
+    cmGeneratorTarget const* target) const override;
+  void AppendFlagEscape(std::string& flags,
+                        const std::string& rawFlag) override;
+  void Generate() override;
   virtual void GenerateInstallRules();
-  virtual void ComputeObjectFilenames(
+  void ComputeObjectFilenames(
     std::map<cmSourceFile const*, std::string>& mapping,
-    cmGeneratorTarget const* gt = nullptr);
+    cmGeneratorTarget const* gt = nullptr) override;
 
 private:
 };
diff --git a/Source/cmMachO.cxx b/Source/cmMachO.cxx
index 3706dd3..8002175 100644
--- a/Source/cmMachO.cxx
+++ b/Source/cmMachO.cxx
@@ -134,7 +134,7 @@ public:
     : cmMachOHeaderAndLoadCommands(_swap)
   {
   }
-  bool read_mach_o(cmsys::ifstream& fin)
+  bool read_mach_o(cmsys::ifstream& fin) override
   {
     if (!read(fin, this->Header)) {
       return false;
diff --git a/Source/cmXCode21Object.h b/Source/cmXCode21Object.h
index bcd8d93..8e4b80f 100644
--- a/Source/cmXCode21Object.h
+++ b/Source/cmXCode21Object.h
@@ -14,7 +14,7 @@ class cmXCode21Object : public cmXCodeObject
 {
 public:
   cmXCode21Object(PBXType ptype, Type type);
-  virtual void PrintComment(std::ostream&);
+  void PrintComment(std::ostream&) override;
   static void PrintList(std::vector<cmXCodeObject*> const&, std::ostream& out,
                         PBXType t);
   static void PrintList(std::vector<cmXCodeObject*> const&, std::ostream& out);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b128f8c5bc02f716c700d4560b949b05afdcb659
commit b128f8c5bc02f716c700d4560b949b05afdcb659
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 15:57:08 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:41 2017 -0400

    Clean up some C-Style casts
    
    Fix issues diagnosed by clang-tidy [google-readability-casting]
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 4fbd194..e5329ad 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -561,7 +561,7 @@ int cmCPackDragNDropGenerator::CreateDMG(const std::string& src_dir,
           cmCPackLogger(cmCPackLog::LOG_ERROR, languages[i]
                           << " is not a recognized language" << std::endl);
         }
-        char* iso_language_cstr = (char*)malloc(65);
+        char* iso_language_cstr = static_cast<char*>(malloc(65));
         CFStringGetCString(iso_language, iso_language_cstr, 64,
                            kCFStringEncodingMacRoman);
         LangCode lang = 0;
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 4fd10a4..6fdfd44 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2065,7 +2065,7 @@ void cmSystemTools::FindCMakeResources(const char* argv0)
 #undef CM_EXE_PATH_LOCAL_SIZE
   char* exe_path = exe_path_local;
   if (_NSGetExecutablePath(exe_path, &exe_path_size) < 0) {
-    exe_path = (char*)malloc(exe_path_size);
+    exe_path = static_cast<char*>(malloc(exe_path_size));
     _NSGetExecutablePath(exe_path, &exe_path_size);
   }
   exe_dir =

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bb0ad1bea81f60cbbb2c66c2c0ab24ee12db0026
commit bb0ad1bea81f60cbbb2c66c2c0ab24ee12db0026
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 15:54:08 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:40 2017 -0400

    Fix some occurrences using string by value rather than by const&
    
    Fix issues diagnosed by clang-tidy
     - performance-unnecessary-value-param
     - performance-unnecessary-copy-initialization
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/CPack/cmCPackDragNDropGenerator.cxx b/Source/CPack/cmCPackDragNDropGenerator.cxx
index 88204c8..4fbd194 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.cxx
+++ b/Source/CPack/cmCPackDragNDropGenerator.cxx
@@ -769,7 +769,8 @@ std::string cmCPackDragNDropGenerator::GetComponentInstallDirNameSuffix(
 
 bool cmCPackDragNDropGenerator::WriteLicense(
   cmGeneratedFileStream& outputStream, int licenseNumber,
-  std::string licenseLanguage, std::string licenseFile, std::string* error)
+  std::string licenseLanguage, const std::string& licenseFile,
+  std::string* error)
 {
   if (!licenseFile.empty() && !singleLicense) {
     licenseNumber = 5002;
diff --git a/Source/CPack/cmCPackDragNDropGenerator.h b/Source/CPack/cmCPackDragNDropGenerator.h
index 8565c68..d8c5c83 100644
--- a/Source/CPack/cmCPackDragNDropGenerator.h
+++ b/Source/CPack/cmCPackDragNDropGenerator.h
@@ -45,8 +45,8 @@ private:
   bool singleLicense;
 
   bool WriteLicense(cmGeneratedFileStream& outputStream, int licenseNumber,
-                    std::string licenseLanguage, std::string licenseFile,
-                    std::string* error);
+                    std::string licenseLanguage,
+                    const std::string& licenseFile, std::string* error);
   bool BreakLongLine(const std::string& line, std::vector<std::string>& lines,
                      std::string* error);
   void EscapeQuotesAndBackslashes(std::string& line);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e9950d9..a1bec6b 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -573,7 +573,7 @@ void cmGlobalXCodeGenerator::ClearXCodeObjects()
 void cmGlobalXCodeGenerator::addObject(cmXCodeObject* obj)
 {
   if (obj->GetType() == cmXCodeObject::OBJECT) {
-    std::string id = obj->GetId();
+    const std::string& id = obj->GetId();
 
     // If this is a duplicate id, it's an error:
     //
@@ -2748,7 +2748,7 @@ bool cmGlobalXCodeGenerator::CreateGroups(
 }
 
 cmXCodeObject* cmGlobalXCodeGenerator::CreatePBXGroup(cmXCodeObject* parent,
-                                                      std::string name)
+                                                      const std::string& name)
 {
   cmXCodeObject* parentChildren = nullptr;
   if (parent)
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index 81d1bd0..e9ca91c 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -106,7 +106,8 @@ protected:
 private:
   cmXCodeObject* CreateOrGetPBXGroup(cmGeneratorTarget* gtgt,
                                      cmSourceGroup* sg);
-  cmXCodeObject* CreatePBXGroup(cmXCodeObject* parent, std::string name);
+  cmXCodeObject* CreatePBXGroup(cmXCodeObject* parent,
+                                const std::string& name);
   bool CreateGroups(std::vector<cmLocalGenerator*>& generators);
   std::string XCodeEscapePath(const std::string& p);
   std::string RelativeToSource(const char* p);
diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx
index 957adb4..457f913 100644
--- a/Source/cmXCodeObject.cxx
+++ b/Source/cmXCodeObject.cxx
@@ -130,7 +130,7 @@ void cmXCodeObject::Print(std::ostream& out)
 }
 
 void cmXCodeObject::PrintAttribute(std::ostream& out, const int level,
-                                   const std::string separator,
+                                   const std::string& separator,
                                    const int factor, const std::string& name,
                                    const cmXCodeObject* object,
                                    const cmXCodeObject* parent)
diff --git a/Source/cmXCodeObject.h b/Source/cmXCodeObject.h
index b51aac7..ceed601 100644
--- a/Source/cmXCodeObject.h
+++ b/Source/cmXCodeObject.h
@@ -95,7 +95,7 @@ public:
   static void Indent(int level, std::ostream& out);
   void Print(std::ostream& out);
   void PrintAttribute(std::ostream& out, const int level,
-                      const std::string separator, const int factor,
+                      const std::string& separator, const int factor,
                       const std::string& name, const cmXCodeObject* object,
                       const cmXCodeObject* parent);
   virtual void PrintComment(std::ostream&) {}
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index f460365..98e814b 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -91,7 +91,7 @@ void cmXCodeScheme::WriteBuildAction(cmXMLWriter& xout,
 }
 
 void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
-                                    std::string configuration,
+                                    const std::string& configuration,
                                     const std::string& container)
 {
   xout.StartElement("TestAction");
@@ -127,7 +127,7 @@ void cmXCodeScheme::WriteTestAction(cmXMLWriter& xout,
 }
 
 void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
-                                      std::string configuration,
+                                      const std::string& configuration,
                                       const std::string& container)
 {
   xout.StartElement("LaunchAction");
@@ -164,7 +164,7 @@ void cmXCodeScheme::WriteLaunchAction(cmXMLWriter& xout,
 }
 
 void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
-                                       std::string configuration)
+                                       const std::string& configuration)
 {
   xout.StartElement("ProfileAction");
   xout.BreakAttributes();
@@ -177,7 +177,7 @@ void cmXCodeScheme::WriteProfileAction(cmXMLWriter& xout,
 }
 
 void cmXCodeScheme::WriteAnalyzeAction(cmXMLWriter& xout,
-                                       std::string configuration)
+                                       const std::string& configuration)
 {
   xout.StartElement("AnalyzeAction");
   xout.BreakAttributes();
@@ -186,7 +186,7 @@ void cmXCodeScheme::WriteAnalyzeAction(cmXMLWriter& xout,
 }
 
 void cmXCodeScheme::WriteArchiveAction(cmXMLWriter& xout,
-                                       std::string configuration)
+                                       const std::string& configuration)
 {
   xout.StartElement("ArchiveAction");
   xout.BreakAttributes();
diff --git a/Source/cmXCodeScheme.h b/Source/cmXCodeScheme.h
index def75b1..e5e501a 100644
--- a/Source/cmXCodeScheme.h
+++ b/Source/cmXCodeScheme.h
@@ -37,13 +37,13 @@ private:
   void WriteXCodeXCScheme(std::ostream& fout, const std::string& container);
 
   void WriteBuildAction(cmXMLWriter& xout, const std::string& container);
-  void WriteTestAction(cmXMLWriter& xout, std::string configuration,
+  void WriteTestAction(cmXMLWriter& xout, const std::string& configuration,
                        const std::string& container);
-  void WriteLaunchAction(cmXMLWriter& xout, std::string configuration,
+  void WriteLaunchAction(cmXMLWriter& xout, const std::string& configuration,
                          const std::string& container);
-  void WriteProfileAction(cmXMLWriter& xout, std::string configuration);
-  void WriteAnalyzeAction(cmXMLWriter& xout, std::string configuration);
-  void WriteArchiveAction(cmXMLWriter& xout, std::string configuration);
+  void WriteProfileAction(cmXMLWriter& xout, const std::string& configuration);
+  void WriteAnalyzeAction(cmXMLWriter& xout, const std::string& configuration);
+  void WriteArchiveAction(cmXMLWriter& xout, const std::string& configuration);
 
   void WriteBuildableReference(cmXMLWriter& xout, const cmXCodeObject* xcObj,
                                const std::string& container);

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8cc33aeaec2798c9ff5a3af23e361ee22fa2ba95
commit 8cc33aeaec2798c9ff5a3af23e361ee22fa2ba95
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Wed Sep 20 22:50:20 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:40 2017 -0400

    Replace several occurrences of empty string comparisons by string::empty()
    
    Fix issues diagnosed by clang-tidy [readability-container-size-empty]
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9375f60..e9950d9 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1280,7 +1280,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateBuildPhase(
   const char* name, const char* name2, cmGeneratorTarget* target,
   const std::vector<cmCustomCommand>& commands)
 {
-  if (commands.size() == 0 && strcmp(name, "CMake ReRun") != 0) {
+  if (commands.empty() && strcmp(name, "CMake ReRun") != 0) {
     return nullptr;
   }
   cmXCodeObject* buildPhase =
@@ -2651,7 +2651,7 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
       std::string linkDirs;
       for (std::vector<std::string>::const_iterator libDir = libDirs.begin();
            libDir != libDirs.end(); ++libDir) {
-        if (libDir->size() && *libDir != "/usr/lib") {
+        if (!libDir->empty() && *libDir != "/usr/lib") {
           // Now add the same one but append
           // $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) to it:
           linkDirs += " ";
@@ -2814,7 +2814,7 @@ cmXCodeObject* cmGlobalXCodeGenerator::CreateOrGetPBXGroup(
   // If it's the default source group (empty name) then put the source file
   // directly in the tgroup...
   //
-  if (std::string(sg->GetFullName()) == "") {
+  if (std::string(sg->GetFullName()).empty()) {
     this->GroupNameMap[s] = tgroup;
     return tgroup;
   }
@@ -3253,7 +3253,7 @@ void cmGlobalXCodeGenerator::CreateXCodeDependHackTarget(
 void cmGlobalXCodeGenerator::OutputXCodeProject(
   cmLocalGenerator* root, std::vector<cmLocalGenerator*>& generators)
 {
-  if (generators.size() == 0) {
+  if (generators.empty()) {
     return;
   }
   // Skip local generators that are excluded from this project.
diff --git a/Source/cmXCodeScheme.cxx b/Source/cmXCodeScheme.cxx
index bca39af..f460365 100644
--- a/Source/cmXCodeScheme.cxx
+++ b/Source/cmXCodeScheme.cxx
@@ -223,7 +223,7 @@ std::string cmXCodeScheme::FindConfiguration(const std::string& name)
   //
   if (std::find(this->ConfigList.begin(), this->ConfigList.end(), name) ==
         this->ConfigList.end() &&
-      this->ConfigList.size() > 0)
+      !this->ConfigList.empty())
     return this->ConfigList[0];
 
   return name;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ffefdb2c084e1e2d46c4d8133dd7aa7bcef79b85
commit ffefdb2c084e1e2d46c4d8133dd7aa7bcef79b85
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 15:23:54 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:23:39 2017 -0400

    clang-tidy: Make .clang-tidy a build-time dependency
    
    Currently a change to the clang-tidy configuration remains unnoticed for
    incremental builds in the way that it won't trigger a rebuild. This can be
    considered a missing dependency that this patch fixes by introducing a
    compile time definition (-DCLANG_TIDY_SHA1) that triggers a rebuild upon
    change. Currently this only applies to the target CMakeLib.
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c578ec3..f14f62f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -250,6 +250,12 @@ if(CMake_RUN_CLANG_TIDY)
     message(FATAL_ERROR "CMake_RUN_CLANG_TIDY is ON but clang-tidy is not found!")
   endif()
   set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_COMMAND}")
+
+  # provide definitions for targets that require a rebuild once .clang-tidy changes
+  file(SHA1 ${CMAKE_CURRENT_SOURCE_DIR}/.clang-tidy clang_tidy_sha1)
+  set(CLANG_TIDY_DEFINITIONS "CLANG_TIDY_SHA1=${clang_tidy_sha1}")
+  unset(clang_tidy_sha1)
+
 endif()
 configure_file(.clang-tidy .clang-tidy COPYONLY)
 
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index fdc6476..a4dd918 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -779,6 +779,8 @@ if(WIN32 AND NOT UNIX)
   target_link_libraries(CMakeLib rpcrt4 crypt32)
 endif()
 
+target_compile_definitions(CMakeLib PUBLIC ${CLANG_TIDY_DEFINITIONS})
+
 #
 # CTestLib
 #

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7cf089fcbf527e13446a856b1c1e49542040f080
commit 7cf089fcbf527e13446a856b1c1e49542040f080
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Sep 28 07:19:27 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Sep 28 07:19:27 2017 -0400

    clang-tidy: exclude 'modernize-use-noexcept' introduced in 5.0.0
    
    We still support compiling CMake on VS 2013 that does not support
    `noexcept`, so disable the clang-tidy diagnostic for now.

diff --git a/.clang-tidy b/.clang-tidy
index 3c400a3..8d79b0c 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -16,6 +16,7 @@ modernize-*,\
 -modernize-use-emplace,\
 -modernize-use-equals-default,\
 -modernize-use-equals-delete,\
+-modernize-use-noexcept,\
 -modernize-use-transparent-functors,\
 -modernize-use-using,\
 performance-*,\

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=ff6a51254a77ece4ec741c8cf061c01fcfe0f62d
commit ff6a51254a77ece4ec741c8cf061c01fcfe0f62d
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Wed Sep 27 11:25:23 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 12:34:27 2017 +0200

    Autogen: Doc: Add examples to the SKIP_AUTO* documentations

diff --git a/Help/prop_sf/SKIP_AUTOGEN.rst b/Help/prop_sf/SKIP_AUTOGEN.rst
index 6bf2409..f31185a 100644
--- a/Help/prop_sf/SKIP_AUTOGEN.rst
+++ b/Help/prop_sf/SKIP_AUTOGEN.rst
@@ -4,5 +4,14 @@ SKIP_AUTOGEN
 Exclude the source file from :prop_tgt:`AUTOMOC`, :prop_tgt:`AUTOUIC` and
 :prop_tgt:`AUTORCC` processing (for Qt projects).
 
-For finer control see :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC` and
-:prop_sf:`SKIP_AUTORCC`.
+For finer exclusion control see :prop_sf:`SKIP_AUTOMOC`,
+:prop_sf:`SKIP_AUTOUIC` and :prop_sf:`SKIP_AUTORCC`.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(SOURCE file.h PROPERTY SKIP_AUTOGEN ON)
+  # ...
diff --git a/Help/prop_sf/SKIP_AUTOMOC.rst b/Help/prop_sf/SKIP_AUTOMOC.rst
index 2245ca6..a929448 100644
--- a/Help/prop_sf/SKIP_AUTOMOC.rst
+++ b/Help/prop_sf/SKIP_AUTOMOC.rst
@@ -3,4 +3,13 @@ SKIP_AUTOMOC
 
 Exclude the source file from :prop_tgt:`AUTOMOC` processing (for Qt projects).
 
-For broader control see :prop_sf:`SKIP_AUTOGEN`
+For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(SOURCE file.h PROPERTY SKIP_AUTOMOC ON)
+  # ...
diff --git a/Help/prop_sf/SKIP_AUTORCC.rst b/Help/prop_sf/SKIP_AUTORCC.rst
index 394d8f8..bccccfc 100644
--- a/Help/prop_sf/SKIP_AUTORCC.rst
+++ b/Help/prop_sf/SKIP_AUTORCC.rst
@@ -3,4 +3,13 @@ SKIP_AUTORCC
 
 Exclude the source file from :prop_tgt:`AUTORCC` processing (for Qt projects).
 
-For broader control see :prop_sf:`SKIP_AUTOGEN`
+For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(SOURCE file.qrc PROPERTY SKIP_AUTORCC ON)
+  # ...
diff --git a/Help/prop_sf/SKIP_AUTOUIC.rst b/Help/prop_sf/SKIP_AUTOUIC.rst
index 50f78ef..4eda726 100644
--- a/Help/prop_sf/SKIP_AUTOUIC.rst
+++ b/Help/prop_sf/SKIP_AUTOUIC.rst
@@ -3,4 +3,13 @@ SKIP_AUTOUIC
 
 Exclude the source file from :prop_tgt:`AUTOUIC` processing (for Qt projects).
 
-For broader control see :prop_sf:`SKIP_AUTOGEN`
+For broader exclusion control see :prop_sf:`SKIP_AUTOGEN`.
+
+EXAMPLE
+^^^^^^^
+
+.. code-block:: cmake
+
+  # ...
+  set_property(SOURCE file.h PROPERTY SKIP_AUTOUIC ON)
+  # ...

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8831818f1403bfb77362e8c14666e275bda7b75d
commit 8831818f1403bfb77362e8c14666e275bda7b75d
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Tue Sep 26 17:46:33 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 12:34:27 2017 +0200

    Autogen: Doc: Update CMP0071 description

diff --git a/Help/policy/CMP0071.rst b/Help/policy/CMP0071.rst
index 61f14dc..ee33aa1 100644
--- a/Help/policy/CMP0071.rst
+++ b/Help/policy/CMP0071.rst
@@ -4,16 +4,15 @@ CMP0071
 Let :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process
 :prop_sf:`GENERATED` files.
 
-CMake 3.10 and newer process regular *and* :prop_sf:`GENERATED` source files
-in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
-In CMake 3.9 and lower, only regular source files were processed in
-:prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`,
-:prop_sf:`GENERATED` source files were ignored.
+Since version 3.10, CMake processes **regular** and :prop_sf:`GENERATED`
+source files in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
+In earlier CMake versions, only **regular** source files were processed.
+:prop_sf:`GENERATED` source files were ignored silently.
 
-This policy affects how :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` process
-source files that are :prop_sf:`GENERATED`.
+This policy affects how source files that are :prop_sf:`GENERATED`
+get treated in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
 
-The ``OLD`` behavior for this policy is to *ignore* :prop_sf:`GENERATED`
+The ``OLD`` behavior for this policy is to ignore :prop_sf:`GENERATED`
 source files in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`.
 
 The ``NEW`` behavior for this policy is to process :prop_sf:`GENERATED`
@@ -21,10 +20,19 @@ source files in :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` just like regular
 source files.
 
 .. note::
-  To exclude source files from :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC`
-  processing, the boolean source file properties
-  :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC` and :prop_sf:`SKIP_AUTOGEN`
-  can be set accordingly.
+
+  To silence the CMP0071 warning source files can be excluded from
+  :prop_tgt:`AUTOMOC` and :prop_tgt:`AUTOUIC` processing by setting the
+  source file properties :prop_sf:`SKIP_AUTOMOC`, :prop_sf:`SKIP_AUTOUIC` or
+  :prop_sf:`SKIP_AUTOGEN`.
+
+Source skip example::
+
+  # ...
+  set_property(SOURCE /path/to/file1.h PROPERTY SKIP_AUTOMOC ON)
+  set_property(SOURCE /path/to/file2.h PROPERTY SKIP_AUTOUIC ON)
+  set_property(SOURCE /path/to/file3.h PROPERTY SKIP_AUTOGEN ON)
+  # ...
 
 This policy was introduced in CMake version 3.10.  CMake version
 |release| warns when the policy is not set and uses ``OLD`` behavior.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b0775c751b62784320a1e998f21c2ae40af688b4
commit b0775c751b62784320a1e998f21c2ae40af688b4
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Tue Sep 26 18:28:46 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 12:34:26 2017 +0200

    Autogen: Offer solution for CMP0071 in warning message

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 9befd65..1ce350f 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -662,23 +662,24 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
   {
     std::vector<std::string> toolNames;
     if (digest.MocEnabled) {
-      toolNames.push_back("MOC");
+      toolNames.emplace_back("MOC");
     }
     if (digest.UicEnabled) {
-      toolNames.push_back("UIC");
+      toolNames.emplace_back("UIC");
     }
     if (digest.RccEnabled) {
-      toolNames.push_back("RCC");
+      toolNames.emplace_back("RCC");
     }
 
-    std::string tools = toolNames[0];
+    std::string tools = toolNames.front();
     toolNames.erase(toolNames.begin());
-    while (toolNames.size() > 1) {
-      tools += ", " + toolNames[0];
-      toolNames.erase(toolNames.begin());
-    }
-    if (toolNames.size() == 1) {
-      tools += " and " + toolNames[0];
+    if (!toolNames.empty()) {
+      while (toolNames.size() > 1) {
+        tools += ", ";
+        tools += toolNames.front();
+        toolNames.erase(toolNames.begin());
+      }
+      tools += " and " + toolNames.front();
     }
     autogenComment = "Automatic " + tools + " for target " + target->GetName();
   }
@@ -809,27 +810,35 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
         msg += cmPolicies::GetPolicyWarning(cmPolicies::CMP0071);
         msg += "\n";
         std::string tools;
-        if (digest.MocEnabled) {
-          tools += "AUTOMOC";
-        }
-        if (digest.UicEnabled) {
-          if (!tools.empty()) {
-            tools += ",";
-          }
-          tools += "AUTOUIC";
+        std::string property;
+        if (digest.MocEnabled && digest.UicEnabled) {
+          tools = "AUTOMOC and AUTOUIC";
+          property = "SKIP_AUTOGEN";
+        } else if (digest.MocEnabled) {
+          tools = "AUTOMOC";
+          property = "SKIP_AUTOMOC";
+        } else if (digest.UicEnabled) {
+          tools = "AUTOUIC";
+          property = "SKIP_AUTOUIC";
         }
-        if (!generatedHeaders.empty()) {
-          msg.append(tools).append(": Ignoring GENERATED header file(s):\n");
-          for (std::string const& absFile : generatedHeaders) {
-            msg.append("  ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
-          }
+        msg += "For compatibility, CMake is excluding the GENERATED source "
+               "file(s):\n";
+        for (const std::string& absFile : generatedHeaders) {
+          msg.append("  ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
         }
-        if (!generatedSources.empty()) {
-          msg.append(tools).append(": Ignoring GENERATED source file(s):\n");
-          for (std::string const& absFile : generatedSources) {
-            msg.append("  ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
-          }
+        for (const std::string& absFile : generatedSources) {
+          msg.append("  ").append(cmQtAutoGen::Quoted(absFile)).append("\n");
         }
+        msg += "from processing by ";
+        msg += tools;
+        msg +=
+          ". If any of the files should be processed, set CMP0071 to NEW. "
+          "If any of the files should not be processed, "
+          "explicitly exclude them by setting the source file property ";
+        msg += property;
+        msg += ":\n  set_property(SOURCE file.h PROPERTY ";
+        msg += property;
+        msg += " ON)\n";
         makefile->IssueMessage(cmake::AUTHOR_WARNING, msg);
       }
     }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=93c8d55d049cacaa884d71b6c3177ce3757ab817
commit 93c8d55d049cacaa884d71b6c3177ce3757ab817
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Sep 25 21:22:14 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 09:21:44 2017 +0200

    Autogen: Update (CMAKE_)AUTOMOC_MACRO_NAMES release notes

diff --git a/Help/release/dev/autogen-macro-names.rst b/Help/release/dev/autogen-macro-names.rst
index 736dd3a..6471295 100644
--- a/Help/release/dev/autogen-macro-names.rst
+++ b/Help/release/dev/autogen-macro-names.rst
@@ -1,12 +1,14 @@
 autogen-macro-names
 -------------------
 
-* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``
-  and ``Q_OBJECT`` in a source file to determine if it needs to be ``moc``
-  processed. The new variable :variable:`CMAKE_AUTOMOC_MACRO_NAMES` allows to
-  register additional strings (macro names) so search for.
+* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``,
+  ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs
+  to be ``moc`` processed. The new variable
+  :variable:`CMAKE_AUTOMOC_MACRO_NAMES` allows to register additional
+  strings (macro names) so search for.
 
-* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``
-  and ``Q_OBJECT`` in a source file to determine if it needs to be ``moc``
-  processed. The new target property :prop_tgt:`AUTOMOC_MACRO_NAMES` allows to
-  register additional strings (macro names) so search for.
+* When using :prop_tgt:`AUTOMOC`, CMake searches for the strings ``Q_OBJECT``,
+  ``Q_GADGET`` or ``Q_NAMESPACE`` in a source file to determine if it needs
+  to be ``moc`` processed. The new target property
+  :prop_tgt:`AUTOMOC_MACRO_NAMES` allows to register additional strings
+  (macro names) so search for.

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=084ace47b6492245c2eb85ced45baccebac8111e
commit 084ace47b6492245c2eb85ced45baccebac8111e
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Sep 25 20:10:26 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 09:21:44 2017 +0200

    Autogen: Tests: Update AUTOMOC_MACRO_NAMES test

diff --git a/Tests/QtAutogen/CMakeLists.txt b/Tests/QtAutogen/CMakeLists.txt
index 81ab734..ec35b89 100644
--- a/Tests/QtAutogen/CMakeLists.txt
+++ b/Tests/QtAutogen/CMakeLists.txt
@@ -66,15 +66,6 @@ set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
 target_link_libraries(mocOnly ${QT_LIBRARIES})
 
 # -- Test
-# MOC AUTOMOC_MACRO_NAMES
-if (NOT QT_TEST_VERSION STREQUAL 4)
-  add_executable(mocMacroName mocMacroName/main.cpp mocMacroName/MacroName.cpp)
-  set_property(TARGET mocMacroName PROPERTY AUTOMOC ON)
-  set_property(TARGET mocMacroName PROPERTY AUTOMOC_MACRO_NAMES "QO_ALIAS")
-  target_link_libraries(mocMacroName ${QT_LIBRARIES})
-endif()
-
-# -- Test
 # UIC only
 if(ALLOW_WRAP_CPP)
   qtx_wrap_cpp(uicOnlyMoc uicOnlySource/uiconly.h)
@@ -188,8 +179,10 @@ set_property(TARGET skipRccB PROPERTY AUTOMOC ON)
 target_link_libraries(skipRccB ${QT_LIBRARIES})
 
 # -- Test
-# Source files with the same basename in different subdirectories
-add_subdirectory(sameName)
+# MOC AUTOMOC_MACRO_NAMES
+if (NOT QT_TEST_VERSION STREQUAL 4)
+  add_subdirectory(mocMacroName)
+endif()
 
 # -- Test
 # Tests AUTOMOC with generated sources
@@ -217,5 +210,9 @@ add_subdirectory(uicInclude)
 add_subdirectory(objectLibrary)
 
 # -- Test
+# Source files with the same basename in different subdirectories
+add_subdirectory(sameName)
+
+# -- Test
 # Complex test case
 add_subdirectory(complex)
diff --git a/Tests/QtAutogen/mocMacroName/CMakeLists.txt b/Tests/QtAutogen/mocMacroName/CMakeLists.txt
new file mode 100644
index 0000000..08e6803
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/CMakeLists.txt
@@ -0,0 +1,8 @@
+cmake_minimum_required(VERSION 3.9)
+
+list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "QO1_ALIAS")
+
+add_executable(mmn main.cpp Gadget.cpp Object.cpp Object1Aliased.cpp Object2Aliased.cpp)
+set_property(TARGET mmn PROPERTY AUTOMOC ON)
+set_property(TARGET mmn APPEND PROPERTY AUTOMOC_MACRO_NAMES "QO2_ALIAS")
+target_link_libraries(mmn ${QT_LIBRARIES})
diff --git a/Tests/QtAutogen/mocMacroName/CustomMacros.hpp b/Tests/QtAutogen/mocMacroName/CustomMacros.hpp
new file mode 100644
index 0000000..93e5bfd
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/CustomMacros.hpp
@@ -0,0 +1,8 @@
+#ifndef CUSTOM_MACROS_HPP
+#define CUSTOM_MACROS_HPP
+
+#include <QObject>
+#define QO1_ALIAS Q_OBJECT
+#define QO2_ALIAS Q_OBJECT
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/Gadget.cpp b/Tests/QtAutogen/mocMacroName/Gadget.cpp
new file mode 100644
index 0000000..167faeb
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Gadget.cpp
@@ -0,0 +1,6 @@
+#include "Gadget.hpp"
+
+Gadget::Gadget()
+  : test(0)
+{
+}
diff --git a/Tests/QtAutogen/mocMacroName/Gadget.hpp b/Tests/QtAutogen/mocMacroName/Gadget.hpp
new file mode 100644
index 0000000..2587ed2
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Gadget.hpp
@@ -0,0 +1,15 @@
+#ifndef GADGET_HPP
+#define GADGET_HPP
+
+#include <QMetaType>
+
+class Gadget
+{
+  Q_GADGET
+  Q_PROPERTY(int test MEMBER test)
+public:
+  Gadget();
+  int test;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp b/Tests/QtAutogen/mocMacroName/MacroAlias.hpp
deleted file mode 100644
index cf06f2a..0000000
--- a/Tests/QtAutogen/mocMacroName/MacroAlias.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef MACROALIAS_HPP
-#define MACROALIAS_HPP
-
-#include <QObject>
-#define QO_ALIAS Q_OBJECT
-
-#endif
diff --git a/Tests/QtAutogen/mocMacroName/MacroName.cpp b/Tests/QtAutogen/mocMacroName/MacroName.cpp
deleted file mode 100644
index 78d04a8..0000000
--- a/Tests/QtAutogen/mocMacroName/MacroName.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-#include "MacroName.hpp"
-
-MacroName::MacroName()
-{
-}
-
-void MacroName::aSlot()
-{
-}
diff --git a/Tests/QtAutogen/mocMacroName/MacroName.hpp b/Tests/QtAutogen/mocMacroName/MacroName.hpp
deleted file mode 100644
index b6c7306..0000000
--- a/Tests/QtAutogen/mocMacroName/MacroName.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef MACRONAME_HPP
-#define MACRONAME_HPP
-
-#include "MacroAlias.hpp"
-
-// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
-class MacroName : public QObject
-{
-  QO_ALIAS
-public:
-  MacroName();
-
-signals:
-  void aSignal();
-
-public slots:
-  void aSlot();
-};
-
-#endif
diff --git a/Tests/QtAutogen/mocMacroName/Object.cpp b/Tests/QtAutogen/mocMacroName/Object.cpp
new file mode 100644
index 0000000..c0b4f33
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Object.cpp
@@ -0,0 +1,9 @@
+#include "Object.hpp"
+
+Object::Object()
+{
+}
+
+void Object::aSlot()
+{
+}
diff --git a/Tests/QtAutogen/mocMacroName/Object.hpp b/Tests/QtAutogen/mocMacroName/Object.hpp
new file mode 100644
index 0000000..0c40824
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Object.hpp
@@ -0,0 +1,19 @@
+#ifndef OBJECT_HPP
+#define OBJECT_HPP
+
+#include <QObject>
+
+class Object : public QObject
+{
+  Q_OBJECT
+  Q_PROPERTY(int test MEMBER test)
+public:
+  Object();
+
+  Q_SLOT
+  void aSlot();
+
+  int test;
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp b/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp
new file mode 100644
index 0000000..b8b4806
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Object1Aliased.cpp
@@ -0,0 +1,9 @@
+#include "Object1Aliased.hpp"
+
+Object1Aliased::Object1Aliased()
+{
+}
+
+void Object1Aliased::aSlot()
+{
+}
diff --git a/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp b/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp
new file mode 100644
index 0000000..6c6bb40
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Object1Aliased.hpp
@@ -0,0 +1,20 @@
+#ifndef OBJECTALIASED_HPP
+#define OBJECTALIASED_HPP
+
+#include "CustomMacros.hpp"
+
+// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
+class Object1Aliased : public QObject
+{
+  QO1_ALIAS
+public:
+  Object1Aliased();
+
+signals:
+  void aSignal();
+
+public slots:
+  void aSlot();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp b/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp
new file mode 100644
index 0000000..4b09dd1
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Object2Aliased.cpp
@@ -0,0 +1,9 @@
+#include "Object2Aliased.hpp"
+
+Object2Aliased::Object2Aliased()
+{
+}
+
+void Object2Aliased::aSlot()
+{
+}
diff --git a/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp b/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp
new file mode 100644
index 0000000..b9bdc12
--- /dev/null
+++ b/Tests/QtAutogen/mocMacroName/Object2Aliased.hpp
@@ -0,0 +1,20 @@
+#ifndef OBJECT2ALIASED_HPP
+#define OBJECT2ALIASED_HPP
+
+#include "CustomMacros.hpp"
+
+// Test Qt object macro hidden in a macro (AUTOMOC_MACRO_NAMES)
+class Object2Aliased : public QObject
+{
+  QO2_ALIAS
+public:
+  Object2Aliased();
+
+signals:
+  void aSignal();
+
+public slots:
+  void aSlot();
+};
+
+#endif
diff --git a/Tests/QtAutogen/mocMacroName/main.cpp b/Tests/QtAutogen/mocMacroName/main.cpp
index 67ee81f..3b45d04 100644
--- a/Tests/QtAutogen/mocMacroName/main.cpp
+++ b/Tests/QtAutogen/mocMacroName/main.cpp
@@ -1,7 +1,13 @@
-#include "MacroName.hpp"
+#include "Gadget.hpp"
+#include "Object.hpp"
+#include "Object1Aliased.hpp"
+#include "Object2Aliased.hpp"
 
 int main(int argv, char** args)
 {
-  MacroName macroName;
+  Gadget gadget;
+  Object object;
+  Object1Aliased object1Aliased;
+  Object2Aliased object2Aliased;
   return 0;
 }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08041dd15e7a4a030b2458e70018b50e1bbc0939
commit 08041dd15e7a4a030b2458e70018b50e1bbc0939
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Sep 25 19:52:11 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 09:21:44 2017 +0200

    Autogen: Doc: Update documentation for (CMAKE_)AUTOMOC_MACRO_NAMES

diff --git a/Help/manual/cmake-qt.7.rst b/Help/manual/cmake-qt.7.rst
index 79e7e79..cafeae1 100644
--- a/Help/manual/cmake-qt.7.rst
+++ b/Help/manual/cmake-qt.7.rst
@@ -59,9 +59,10 @@ The :prop_tgt:`AUTOMOC` target property controls whether :manual:`cmake(1)`
 inspects the C++ files in the target to determine if they require ``moc`` to
 be run, and to create rules to execute ``moc`` at the appropriate time.
 
-If a ``Q_OBJECT`` or ``Q_GADGET`` macro is found in a header file, ``moc``
-will be run on the file.  The result will be put into a file named according
-to ``moc_<basename>.cpp``.  If the macro is found in a C++ implementation
+If a macro from :prop_tgt:`AUTOMOC_MACRO_NAMES` is found in a header file,
+``moc`` will be run on the file.  The result will be put into a file named
+according to ``moc_<basename>.cpp``.
+If the macro is found in a C++ implementation
 file, the moc output will be put into a file named according to
 ``<basename>.moc``, following the Qt conventions.  The ``<basename>.moc`` must
 be included by the user in the C++ implementation file with a preprocessor
@@ -95,9 +96,7 @@ following targets by setting the :variable:`CMAKE_AUTOMOC` variable.  The
 options to pass to ``moc``. The :variable:`CMAKE_AUTOMOC_MOC_OPTIONS`
 variable may be populated to pre-set the options for all following targets.
 
-The appearance of the strings ``Q_OBJECT`` or ``Q_GADGET`` in a source file
-determines if it needs to be ``moc`` processed. To search for additional
-strings, list them in :prop_tgt:`AUTOMOC_MACRO_NAMES`.
+Additional macro names to search for can be added to :prop_tgt:`AUTOMOC_MACRO_NAMES`.
 
 Additional ``moc`` dependency file names can be extracted from source code
 by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`.
diff --git a/Help/prop_tgt/AUTOMOC.rst b/Help/prop_tgt/AUTOMOC.rst
index 4542401..641ac09 100644
--- a/Help/prop_tgt/AUTOMOC.rst
+++ b/Help/prop_tgt/AUTOMOC.rst
@@ -12,8 +12,8 @@ When this property is set ``ON``, CMake will scan the header and
 source files at build time and invoke moc accordingly.
 
 * If an ``#include`` statement like ``#include "moc_<basename>.cpp"`` is found,
-  the ``Q_OBJECT`` or ``Q_GADGET`` macros are expected in an otherwise empty
-  line of the ``<basename>.h(xx)`` header file. ``moc`` is run on the header
+  a macro from :prop_tgt:`AUTOMOC_MACRO_NAMES` is expected to appear in the
+  ``<basename>.h(xx)`` header file. ``moc`` is run on the header
   file to generate ``moc_<basename>.cpp`` in the
   ``<AUTOGEN_BUILD_DIR>/include`` directory which is automatically added
   to the target's :prop_tgt:`INCLUDE_DIRECTORIES`.
@@ -26,11 +26,12 @@ source files at build time and invoke moc accordingly.
   * See :prop_tgt:`AUTOGEN_BUILD_DIR`.
 
 * If an ``#include`` statement like ``#include "<basename>.moc"`` is found,
-  then ``Q_OBJECT`` or ``Q_GADGET`` macros are expected in the current source
-  file and ``moc`` is run on the source file itself.
+  a macro from :prop_tgt:`AUTOMOC_MACRO_NAMES` is expected to appear in the
+  source file and ``moc`` is run on the source file itself.
 
 * Header files that are not included by an ``#include "moc_<basename>.cpp"``
-  statement are nonetheless scanned for ``Q_OBJECT`` or ``Q_GADGET`` macros.
+  statement are nonetheless scanned for a macro out of
+  :prop_tgt:`AUTOMOC_MACRO_NAMES`.
   The resulting ``moc_<basename>.cpp`` files are generated in custom
   directories and automatically included in a generated
   ``<AUTOGEN_BUILD_DIR>/mocs_compilation.cpp`` file,
@@ -44,8 +45,9 @@ source files at build time and invoke moc accordingly.
 
 * Additionally, header files with the same base name as a source file,
   (like ``<basename>.h``) or ``_p`` appended to the base name (like
-  ``<basename>_p.h``), are parsed for ``Q_OBJECT`` or ``Q_GADGET`` macros,
-  and if found, ``moc`` is also executed on those files.
+  ``<basename>_p.h``), are scanned for a macro out of
+  :prop_tgt:`AUTOMOC_MACRO_NAMES`, and if found, ``moc``
+  is also executed on those files.
 
 * ``AUTOMOC`` always checks multiple header alternative extensions,
   such as ``hpp``, ``hxx``, etc. when searching for headers.
@@ -69,9 +71,7 @@ automoc targets together in an IDE, e.g.  in MSVS.
 The global property :prop_gbl:`AUTOGEN_SOURCE_GROUP` can be used to group
 files generated by :prop_tgt:`AUTOMOC` together in an IDE, e.g.  in MSVS.
 
-The appearance of the strings ``Q_OBJECT`` or ``Q_GADGET`` in a source file
-determines if it needs to be ``moc`` processed. To search for additional
-strings, list them in :prop_tgt:`AUTOMOC_MACRO_NAMES`.
+Additional macro names to search for can be added to :prop_tgt:`AUTOMOC_MACRO_NAMES`.
 
 Additional ``moc`` dependency file names can be extracted from source code
 by using :prop_tgt:`AUTOMOC_DEPEND_FILTERS`.
diff --git a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
index 0639bc8..0535fde 100644
--- a/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
+++ b/Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst
@@ -1,20 +1,23 @@
 AUTOMOC_MACRO_NAMES
 -------------------
 
-Additional macro names used by :prop_tgt:`AUTOMOC`
-to determine if a C++ file needs to be processed by ``moc``.
+A :ref:`;-list <CMake Language Lists>` list of macro names used by
+:prop_tgt:`AUTOMOC` to determine if a C++ file needs to be processed by ``moc``.
 
 This property is only used if the :prop_tgt:`AUTOMOC` property is ``ON``
 for this target.
 
-CMake searches for the strings ``Q_OBJECT`` and ``Q_GADGET`` to
-determine if a file needs to be processed by ``moc``.
-:prop_tgt:`AUTOMOC_MACRO_NAMES` allows to add additional strings to the
-search list. This is useful for cases where the ``Q_OBJECT`` or ``Q_GADGET``
-macro is hidden inside another macro.
+When running :prop_tgt:`AUTOMOC`, CMake searches for the strings listed in
+:prop_tgt:`AUTOMOC_MACRO_NAMES` in C++ source and header files.
+If any of the strings is found
+
+- as the first non space string on a new line or
+- as the first non space string after a ``{`` on a new line,
+
+then the file will be processed by ``moc``.
 
 By default :prop_tgt:`AUTOMOC_MACRO_NAMES` is initialized from
-:variable:`CMAKE_AUTOMOC_MACRO_NAMES`, which is empty by default.
+:variable:`CMAKE_AUTOMOC_MACRO_NAMES`.
 
 See the :manual:`cmake-qt(7)` manual for more information on using CMake
 with Qt.
@@ -25,4 +28,4 @@ In this case the the ``Q_OBJECT`` macro is hidden inside an other macro
 called ``CUSTOM_MACRO``. To let CMake know that source files, that contain
 ``CUSTOM_MACRO``, need to be ``moc`` processed, we call::
 
-  set_property(TARGET tgt PROPERTY AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
+  set_property(TARGET tgt APPEND PROPERTY AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
diff --git a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
index 7ed3445..5b79c40 100644
--- a/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
+++ b/Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst
@@ -1,14 +1,15 @@
 CMAKE_AUTOMOC_MACRO_NAMES
 ----------------------------
 
-Additional macro names used by :variable:`CMAKE_AUTOMOC`
-to determine if a C++ file needs to be processed by ``moc``.
+A :ref:`;-list <CMake Language Lists>` list of macro names used by
+:variable:`CMAKE_AUTOMOC` to determine if a C++ file needs to be
+processed by ``moc``.
 
 This variable is used to initialize the :prop_tgt:`AUTOMOC_MACRO_NAMES`
 property on all the targets. See that target property for additional
 information.
 
-By default it is empty.
+The default value is ``Q_OBJECT;Q_GADGET;Q_NAMESPACE``.
 
 Example
 -------
@@ -16,4 +17,4 @@ Let CMake know that source files that contain ``CUSTOM_MACRO`` must be ``moc``
 processed as well::
 
   set(CMAKE_AUTOMOC ON)
-  set(CMAKE_AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")
+  list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "CUSTOM_MACRO")

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7b33d67bc53446e89eb27d750d80e4b639f8d3e5
commit 7b33d67bc53446e89eb27d750d80e4b639f8d3e5
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Thu Sep 28 09:21:11 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Thu Sep 28 09:21:44 2017 +0200

    Autogen: Create info file directory before writing

diff --git a/Source/cmQtAutoGeneratorInitializer.cxx b/Source/cmQtAutoGeneratorInitializer.cxx
index 9befd65..bcd5dd2 100644
--- a/Source/cmQtAutoGeneratorInitializer.cxx
+++ b/Source/cmQtAutoGeneratorInitializer.cxx
@@ -613,6 +613,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
   cmGlobalGenerator* globalGen = localGen->GetGlobalGenerator();
 
   std::string const autogenTargetName = GetAutogenTargetName(target);
+  std::string const autogenInfoDir = GetAutogenTargetFilesDir(target);
   std::string const autogenBuildDir = GetAutogenTargetBuildDir(target);
   std::string const workingDirectory =
     cmSystemTools::CollapseFullPath("", makefile->GetCurrentBinaryDirectory());
@@ -630,8 +631,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
   AddCleanFile(makefile, autogenBuildDir);
   // Remove old settings on cleanup
   {
-    std::string base = GetAutogenTargetFilesDir(target);
-    base += "/AutogenOldSettings";
+    std::string base = autogenInfoDir + "/AutogenOldSettings";
     if (multiConfig == cmQtAutoGen::SINGLE) {
       AddCleanFile(makefile, base.append(".cmake"));
     } else {
@@ -652,7 +652,7 @@ void cmQtAutoGeneratorInitializer::InitializeAutogenTarget(
     currentLine.push_back(cmSystemTools::GetCMakeCommand());
     currentLine.push_back("-E");
     currentLine.push_back("cmake_autogen");
-    currentLine.push_back(GetAutogenTargetFilesDir(target));
+    currentLine.push_back(autogenInfoDir);
     currentLine.push_back("$<CONFIGURATION>");
     commandLines.push_back(currentLine);
   }
@@ -1088,8 +1088,13 @@ void cmQtAutoGeneratorInitializer::SetupAutoGenerateTarget(
 
   // Generate info file
   {
-    std::string infoFile = GetAutogenTargetFilesDir(target);
-    infoFile += "/AutogenInfo.cmake";
+    std::string const infoDir = GetAutogenTargetFilesDir(target);
+    if (!cmSystemTools::MakeDirectory(infoDir)) {
+      std::string emsg = ("Could not create directory: ");
+      emsg += cmQtAutoGen::Quoted(infoDir);
+      cmSystemTools::Error(emsg.c_str());
+    }
+    std::string const infoFile = infoDir + "/AutogenInfo.cmake";
     {
       std::string infoFileIn = cmSystemTools::GetCMakeRoot();
       infoFileIn += "/Modules/AutogenInfo.cmake.in";

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=76c634c4ac0f2d95babe04fa04e85d4c9fdeae23
commit 76c634c4ac0f2d95babe04fa04e85d4c9fdeae23
Author:     Matthias Maennich <matthias at maennich.net>
AuthorDate: Tue Sep 19 15:23:33 2017 +0200
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 27 15:25:40 2017 -0400

    clang-tidy: exclude 'modernize-return-braced-init-list' introduced in 5.0.0
    
    Due to many occurrences and as I am not sure about the coding guide lines
    in regards to this, I blacklist it.
    
    Signed-off-by: Matthias Maennich <matthias at maennich.net>

diff --git a/.clang-tidy b/.clang-tidy
index a6e2597..3c400a3 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -10,6 +10,7 @@ modernize-*,\
 -modernize-deprecated-headers,\
 -modernize-pass-by-value,\
 -modernize-raw-string-literal,\
+-modernize-return-braced-init-list,\
 -modernize-use-auto,\
 -modernize-use-default-member-init,\
 -modernize-use-emplace,\

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=786b5be03bf992fe78a9a6450d5665ab7233a815
commit 786b5be03bf992fe78a9a6450d5665ab7233a815
Author:     Sebastian Holtermann <sebholt at xwmw.org>
AuthorDate: Mon Sep 25 19:47:54 2017 +0200
Commit:     Sebastian Holtermann <sebholt at xwmw.org>
CommitDate: Wed Sep 27 14:13:12 2017 +0200

    Autogen: Define all macro names in CMAKE_AUTOMOC_MACRO_NAMES
    
    Instead of adding `Q_OBJECT` and `Q_GADGET` to the macro search list
    in `Source/cmQtAutoGenerators.cxx`, add them in
    `Modules/CMakeGenericSystem.cmake` to the default value of
    `CMAKE_AUTOMOC_MACRO_NAMES`.
    Also add `Q_NAMESPACE` to `CMAKE_AUTOMOC_MACRO_NAMES`
    which closes #17299.

diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 9c38f6e..3951b2c 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -23,6 +23,7 @@ set(CMAKE_DL_LIBS "dl")
 
 set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
 set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
+set(CMAKE_AUTOMOC_MACRO_NAMES "Q_OBJECT" "Q_GADGET" "Q_NAMESPACE")
 
 # basically all general purpose OSs support shared libs
 set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index bd0fb9a..f13312f 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -149,12 +149,6 @@ cmQtAutoGenerators::cmQtAutoGenerators()
     }
   }
 
-  // Moc macro filters
-  this->MocMacroFilters.emplace_back(
-    "Q_OBJECT", "[\n][ \t]*{?[ \t]*Q_OBJECT[^a-zA-Z0-9_]");
-  this->MocMacroFilters.emplace_back(
-    "Q_GADGET", "[\n][ \t]*{?[ \t]*Q_GADGET[^a-zA-Z0-9_]");
-
   // Precompile regular expressions
   this->MocRegExpInclude.compile(
     "[\n][ \t]*#[ \t]*include[ \t]+"
@@ -326,7 +320,7 @@ bool cmQtAutoGenerators::InitInfoFile(cmMakefile* makefile,
         InfoGetList("AM_MOC_MACRO_NAMES");
       for (std::string const& item : MocMacroNames) {
         this->MocMacroFilters.emplace_back(
-          item, ("[^a-zA-Z0-9_]" + item).append("[^a-zA-Z0-9_]"));
+          item, ("[\n][ \t]*{?[ \t]*" + item).append("[^a-zA-Z0-9_]"));
       }
     }
     {

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a245f850bc4f4f209e759b6eab5b48c0693e38af
commit a245f850bc4f4f209e759b6eab5b48c0693e38af
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Sep 26 12:56:33 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Sep 27 06:56:10 2017 -0400

    FindMatlab: Fix extraction of quoted version number
    
    The version string in recent Matlab versions has changed.
    Now the version number is inside two `'`.
    
    Patch-by: nama on gitlab.kitware.com
    Fixes: #17308

diff --git a/Modules/FindMatlab.cmake b/Modules/FindMatlab.cmake
index 7493281..d287688 100644
--- a/Modules/FindMatlab.cmake
+++ b/Modules/FindMatlab.cmake
@@ -681,12 +681,12 @@ function(matlab_get_version_from_matlab_run matlab_binary_program matlab_list_ve
 
     string(SUBSTRING ${_matlab_version_from_cmd} ${index} -1 substring_ans)
     string(
-      REGEX MATCHALL "ans[\r\n\t ]*=[\r\n\t ]*([0-9]+(\\.[0-9]+)?)"
+      REGEX MATCHALL "ans[\r\n\t ]*=[\r\n\t ]*'?([0-9]+(\\.[0-9]+)?)"
       matlab_versions_regex
       ${substring_ans})
     foreach(match IN LISTS matlab_versions_regex)
       string(
-        REGEX MATCH "ans[\r\n\t ]*=[\r\n\t ]*(([0-9]+)(\\.([0-9]+))?)"
+        REGEX MATCH "ans[\r\n\t ]*=[\r\n\t ]*'?(([0-9]+)(\\.([0-9]+))?)"
         current_match ${match})
 
       list(APPEND matlab_list_of_all_versions_tmp ${CMAKE_MATCH_1})

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

Summary of changes:
 .clang-tidy                                        |    2 +
 CMakeLists.txt                                     |    6 +
 Help/dev/source.rst                                |    8 -
 Help/manual/cmake-qt.7.rst                         |   11 +-
 Help/policy/CMP0071.rst                            |   32 +-
 Help/prop_sf/SKIP_AUTOGEN.rst                      |   13 +-
 Help/prop_sf/SKIP_AUTOMOC.rst                      |   11 +-
 Help/prop_sf/SKIP_AUTORCC.rst                      |   11 +-
 Help/prop_sf/SKIP_AUTOUIC.rst                      |   11 +-
 Help/prop_tgt/AUTOMOC.rst                          |   20 +-
 Help/prop_tgt/AUTOMOC_MACRO_NAMES.rst              |   21 +-
 Help/release/dev/autogen-macro-names.rst           |   18 +-
 Help/variable/CMAKE_AUTOMOC_MACRO_NAMES.rst        |    9 +-
 Modules/CMakeGenericSystem.cmake                   |    1 +
 Modules/FindMatlab.cmake                           |    4 +-
 Source/CMakeLists.txt                              |    2 +
 Source/CPack/cmCPackBundleGenerator.cxx            |    7 +-
 Source/CPack/cmCPackDragNDropGenerator.cxx         |   42 ++-
 Source/CPack/cmCPackDragNDropGenerator.h           |    4 +-
 Source/CPack/cmCPackPKGGenerator.cxx               |    4 +-
 Source/CPack/cmCPackPackageMakerGenerator.cxx      |    3 +-
 Source/CPack/cmCPackProductBuildGenerator.cxx      |    2 +-
 Source/CTest/cmCTestBuildHandler.cxx               |    1 +
 Source/CTest/cmCTestGIT.cxx                        |    1 +
 Source/CTest/cmCTestP4.cxx                         |    1 +
 Source/CTest/cmCTestVC.cxx                         |    1 +
 Source/Checks/cm_cxx_eq_delete.cxx                 |   14 -
 Source/Checks/cm_cxx_features.cmake                |    1 -
 Source/cmCTest.cxx                                 |    2 +
 Source/cmCommonTargetGenerator.cxx                 |    1 +
 Source/cmConfigure.cmake.h.in                      |   12 +-
 Source/cmFileCommand.cxx                           |    5 +-
 Source/cmFileTimeComparison.cxx                    |   24 +-
 Source/cmFindLibraryCommand.cxx                    |    2 +-
 Source/cmGlobalXCodeGenerator.cxx                  |  393 +++++++++-----------
 Source/cmGlobalXCodeGenerator.h                    |    3 +-
 Source/cmInstalledFile.cxx                         |    4 +-
 Source/cmLocalXCodeGenerator.cxx                   |   18 +-
 Source/cmLocalXCodeGenerator.h                     |   16 +-
 Source/cmMachO.cxx                                 |    9 +-
 Source/cmQtAutoGeneratorInitializer.cxx            |   80 ++--
 Source/cmQtAutoGenerators.cxx                      |    8 +-
 Source/cmServerProtocol.cxx                        |    3 +-
 Source/cmSourceFileLocation.h                      |    3 +-
 Source/cmStateDirectory.cxx                        |    1 +
 Source/cmSystemTools.cxx                           |   29 +-
 Source/cmXCode21Object.cxx                         |    8 +-
 Source/cmXCode21Object.h                           |    2 +-
 Source/cmXCodeObject.cxx                           |   15 +-
 Source/cmXCodeObject.h                             |    8 +-
 Source/cmXCodeScheme.cxx                           |   18 +-
 Source/cmXCodeScheme.h                             |   10 +-
 Source/cmcmd.cxx                                   |    1 +
 Source/ctest.cxx                                   |    1 +
 Tests/QtAutogen/CMakeLists.txt                     |   19 +-
 Tests/QtAutogen/mocMacroName/CMakeLists.txt        |    8 +
 Tests/QtAutogen/mocMacroName/CustomMacros.hpp      |    8 +
 Tests/QtAutogen/mocMacroName/Gadget.cpp            |    6 +
 Tests/QtAutogen/mocMacroName/Gadget.hpp            |   15 +
 Tests/QtAutogen/mocMacroName/MacroAlias.hpp        |    7 -
 Tests/QtAutogen/mocMacroName/MacroName.cpp         |    9 -
 Tests/QtAutogen/mocMacroName/MacroName.hpp         |   20 -
 Tests/QtAutogen/mocMacroName/Object.cpp            |    9 +
 .../Object.hpp}                                    |    7 +-
 Tests/QtAutogen/mocMacroName/Object1Aliased.cpp    |    9 +
 Tests/QtAutogen/mocMacroName/Object1Aliased.hpp    |   20 +
 Tests/QtAutogen/mocMacroName/Object2Aliased.cpp    |    9 +
 Tests/QtAutogen/mocMacroName/Object2Aliased.hpp    |   20 +
 Tests/QtAutogen/mocMacroName/main.cpp              |   10 +-
 bootstrap                                          |    1 -
 70 files changed, 593 insertions(+), 521 deletions(-)
 delete mode 100644 Source/Checks/cm_cxx_eq_delete.cxx
 create mode 100644 Tests/QtAutogen/mocMacroName/CMakeLists.txt
 create mode 100644 Tests/QtAutogen/mocMacroName/CustomMacros.hpp
 create mode 100644 Tests/QtAutogen/mocMacroName/Gadget.cpp
 create mode 100644 Tests/QtAutogen/mocMacroName/Gadget.hpp
 delete mode 100644 Tests/QtAutogen/mocMacroName/MacroAlias.hpp
 delete mode 100644 Tests/QtAutogen/mocMacroName/MacroName.cpp
 delete mode 100644 Tests/QtAutogen/mocMacroName/MacroName.hpp
 create mode 100644 Tests/QtAutogen/mocMacroName/Object.cpp
 copy Tests/QtAutogen/{mocDepends/object_valid.hpp.in => mocMacroName/Object.hpp} (62%)
 create mode 100644 Tests/QtAutogen/mocMacroName/Object1Aliased.cpp
 create mode 100644 Tests/QtAutogen/mocMacroName/Object1Aliased.hpp
 create mode 100644 Tests/QtAutogen/mocMacroName/Object2Aliased.cpp
 create mode 100644 Tests/QtAutogen/mocMacroName/Object2Aliased.hpp


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list