[Cmake-commits] CMake branch, master, updated. v3.8.0-949-g74672e2

Kitware Robot kwrobot at kitware.com
Tue Apr 25 09:45:03 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  74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf (commit)
       via  7dca104e14519be4ff28978a1553a3395ecaf6d2 (commit)
       via  959ad1d5e8bbd07b4111630c347ca3d69353f48b (commit)
       via  594d3d6fffac33062629bafb819a5df7c1326824 (commit)
       via  d6f0006c0b12c74df2d93170262a017f15949320 (commit)
       via  4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1 (commit)
      from  31f7dc4b11f92467c19a14f1d424538977aad554 (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=74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf
commit 74672e2ffaaa7f6c0efa1884a3f8d239d36ec7bf
Merge: 7dca104 594d3d6
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 25 13:41:14 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Apr 25 09:41:18 2017 -0400

    Merge topic 'ninja-dyndep-response-file'
    
    594d3d6f Ninja: support response file for cmake_ninja_depends on Windows
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !722


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7dca104e14519be4ff28978a1553a3395ecaf6d2
commit 7dca104e14519be4ff28978a1553a3395ecaf6d2
Merge: 959ad1d 4f5bbbe
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 25 13:38:59 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Apr 25 09:39:06 2017 -0400

    Merge topic 'deprecate-policy-old'
    
    4f5bbbea Add deprecation warnings for policies CMP0036 and below
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !743


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=959ad1d5e8bbd07b4111630c347ca3d69353f48b
commit 959ad1d5e8bbd07b4111630c347ca3d69353f48b
Merge: 31f7dc4 d6f0006
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Apr 25 13:35:44 2017 +0000
Commit:     Kitware Robot <kwrobot at kitware.com>
CommitDate: Tue Apr 25 09:36:01 2017 -0400

    Merge topic 'use-disable-copy'
    
    d6f0006c Use CM_DISABLE_COPY
    
    Acked-by: Kitware Robot <kwrobot at kitware.com>
    Merge-request: !754


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=594d3d6fffac33062629bafb819a5df7c1326824
commit 594d3d6fffac33062629bafb819a5df7c1326824
Author:     Bernhard Burgermeister <bburgerm at googlemail.com>
AuthorDate: Tue Feb 7 16:50:47 2017 +0100
Commit:     Bernhard Burgermeister <bburgerm at googlemail.com>
CommitDate: Tue Apr 25 09:32:50 2017 +0200

    Ninja: support response file for cmake_ninja_depends on Windows
    
    The internal tool "cmake_ninja_depends" now supports reading the list of ddi
    files from a reponse file to circumvent Windows command line length limits.
    
    Use this response file for dyndep rule on Windows.

diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index e61cbd9..092cead 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -1823,10 +1823,14 @@ bool cmGlobalNinjaGenerator::WriteDyndepFile(
 int cmcmd_cmake_ninja_dyndep(std::vector<std::string>::const_iterator argBeg,
                              std::vector<std::string>::const_iterator argEnd)
 {
+  std::vector<std::string> arg_full =
+    cmSystemTools::HandleResponseFile(argBeg, argEnd);
+
   std::string arg_dd;
   std::string arg_tdi;
   std::vector<std::string> arg_ddis;
-  for (std::vector<std::string>::const_iterator a = argBeg; a != argEnd; ++a) {
+  for (std::vector<std::string>::const_iterator a = arg_full.begin();
+       a != arg_full.end(); ++a) {
     std::string const& arg = *a;
     if (cmHasLiteralPrefix(arg, "--tdi=")) {
       arg_tdi = arg.substr(6);
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 7c417a4..c83b48a 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -557,13 +557,26 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     // Write the rule for ninja dyndep file generation.
     std::vector<std::string> ddCmds;
 
+#ifdef _WIN32
+    // Windows command line length is limited -> use response file for dyndep
+    // rules
+    std::string ddRspFile = "$out.rsp";
+    std::string ddRspContent = "$in";
+    std::string ddInput = "@" + ddRspFile;
+#else
+    std::string ddRspFile;
+    std::string ddRspContent;
+    std::string ddInput = "$in";
+#endif
+
     // Run CMake dependency scanner on preprocessed output.
     std::string const cmake = this->GetLocalGenerator()->ConvertToOutputFormat(
       cmSystemTools::GetCMakeCommand(), cmLocalGenerator::SHELL);
     ddCmds.push_back(cmake + " -E cmake_ninja_dyndep"
                              " --tdi=" +
                      tdi + " --dd=$out"
-                           " $in");
+                           " " +
+                     ddInput);
 
     std::string const ddCmdLine =
       this->GetLocalGenerator()->BuildCommandLine(ddCmds);
@@ -575,9 +588,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang)
     this->GetGlobalGenerator()->AddRule(
       this->LanguageDyndepRule(lang), ddCmdLine, ddDesc.str(), ddComment.str(),
       /*depfile*/ "",
-      /*deps*/ "",
-      /*rspfile*/ "",
-      /*rspcontent*/ "",
+      /*deps*/ "", ddRspFile, ddRspContent,
       /*restat*/ "",
       /*generator*/ false);
   }
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 39625ae..42aae77 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -505,6 +505,39 @@ void cmSystemTools::ParseUnixCommandLine(const char* command,
   argv.Store(args);
 }
 
+std::vector<std::string> cmSystemTools::HandleResponseFile(
+  std::vector<std::string>::const_iterator argBeg,
+  std::vector<std::string>::const_iterator argEnd)
+{
+  std::vector<std::string> arg_full;
+  for (std::vector<std::string>::const_iterator a = argBeg; a != argEnd; ++a) {
+    std::string const& arg = *a;
+    if (cmHasLiteralPrefix(arg, "@")) {
+      cmsys::ifstream responseFile(arg.substr(1).c_str(), std::ios::in);
+      if (!responseFile) {
+        std::string error = "failed to open for reading (";
+        error += cmSystemTools::GetLastSystemError();
+        error += "):\n  ";
+        error += arg.substr(1);
+        cmSystemTools::Error(error.c_str());
+      } else {
+        std::string line;
+        cmSystemTools::GetLineFromStream(responseFile, line);
+        std::vector<std::string> args2;
+#ifdef _WIN32
+        cmSystemTools::ParseWindowsCommandLine(line.c_str(), args2);
+#else
+        cmSystemTools::ParseUnixCommandLine(line.c_str(), args2);
+#endif
+        arg_full.insert(arg_full.end(), args2.begin(), args2.end());
+      }
+    } else {
+      arg_full.push_back(arg);
+    }
+  }
+  return arg_full;
+}
+
 std::vector<std::string> cmSystemTools::ParseArguments(const char* command)
 {
   std::vector<std::string> args;
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index a8a9995..255f608 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -253,6 +253,13 @@ public:
   static void ParseUnixCommandLine(const char* command,
                                    std::vector<std::string>& args);
 
+  /**
+   * Handle response file in an argument list and return a new argument list
+   * **/
+  static std::vector<std::string> HandleResponseFile(
+    std::vector<std::string>::const_iterator argBeg,
+    std::vector<std::string>::const_iterator argEnd);
+
   static size_t CalculateCommandLineLengthLimit();
 
   static void EnableMessages() { s_DisableMessages = false; }

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d6f0006c0b12c74df2d93170262a017f15949320
commit d6f0006c0b12c74df2d93170262a017f15949320
Author:     Daniel Pfeifer <daniel at pfeifer-mail.de>
AuthorDate: Sun Apr 23 22:50:47 2017 +0200
Commit:     Daniel Pfeifer <daniel at pfeifer-mail.de>
CommitDate: Mon Apr 24 22:03:06 2017 +0200

    Use CM_DISABLE_COPY

diff --git a/Source/CursesDialog/cmCursesBoolWidget.h b/Source/CursesDialog/cmCursesBoolWidget.h
index 45f01aa..90bcc22 100644
--- a/Source/CursesDialog/cmCursesBoolWidget.h
+++ b/Source/CursesDialog/cmCursesBoolWidget.h
@@ -12,6 +12,8 @@ class cmCursesMainForm;
 
 class cmCursesBoolWidget : public cmCursesWidget
 {
+  CM_DISABLE_COPY(cmCursesBoolWidget)
+
 public:
   cmCursesBoolWidget(int width, int height, int left, int top);
 
@@ -25,10 +27,6 @@ public:
   // Set/Get the value (on/off).
   void SetValueAsBool(bool value);
   bool GetValueAsBool();
-
-protected:
-  cmCursesBoolWidget(const cmCursesBoolWidget& from);
-  void operator=(const cmCursesBoolWidget&);
 };
 
 #endif // cmCursesBoolWidget_h
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
index cdde1a3..d071c91 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.cxx
@@ -14,7 +14,6 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-#include "cmConfigure.h"
 #include <assert.h>
 #include <vector>
 
diff --git a/Source/CursesDialog/cmCursesCacheEntryComposite.h b/Source/CursesDialog/cmCursesCacheEntryComposite.h
index 1dbcfa4..3c50078 100644
--- a/Source/CursesDialog/cmCursesCacheEntryComposite.h
+++ b/Source/CursesDialog/cmCursesCacheEntryComposite.h
@@ -3,7 +3,7 @@
 #ifndef cmCursesCacheEntryComposite_h
 #define cmCursesCacheEntryComposite_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <string>
 
@@ -13,6 +13,8 @@ class cmake;
 
 class cmCursesCacheEntryComposite
 {
+  CM_DISABLE_COPY(cmCursesCacheEntryComposite)
+
 public:
   cmCursesCacheEntryComposite(const std::string& key, int labelwidth,
                               int entrywidth);
@@ -24,9 +26,6 @@ public:
   friend class cmCursesMainForm;
 
 protected:
-  cmCursesCacheEntryComposite(const cmCursesCacheEntryComposite& from);
-  void operator=(const cmCursesCacheEntryComposite&);
-
   cmCursesLabelWidget* Label;
   cmCursesLabelWidget* IsNewLabel;
   cmCursesWidget* Entry;
diff --git a/Source/CursesDialog/cmCursesDummyWidget.h b/Source/CursesDialog/cmCursesDummyWidget.h
index 0381f25..d9bb6ba 100644
--- a/Source/CursesDialog/cmCursesDummyWidget.h
+++ b/Source/CursesDialog/cmCursesDummyWidget.h
@@ -12,6 +12,8 @@ class cmCursesMainForm;
 
 class cmCursesDummyWidget : public cmCursesWidget
 {
+  CM_DISABLE_COPY(cmCursesDummyWidget)
+
 public:
   cmCursesDummyWidget(int width, int height, int left, int top);
 
@@ -20,10 +22,6 @@ public:
   // when this widget has focus. Returns true if the input was
   // handled.
   bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) CM_OVERRIDE;
-
-protected:
-  cmCursesDummyWidget(const cmCursesDummyWidget& from);
-  void operator=(const cmCursesDummyWidget&);
 };
 
 #endif // cmCursesDummyWidget_h
diff --git a/Source/CursesDialog/cmCursesFilePathWidget.h b/Source/CursesDialog/cmCursesFilePathWidget.h
index b4c04cb..6ad535b 100644
--- a/Source/CursesDialog/cmCursesFilePathWidget.h
+++ b/Source/CursesDialog/cmCursesFilePathWidget.h
@@ -3,18 +3,16 @@
 #ifndef cmCursesFilePathWidget_h
 #define cmCursesFilePathWidget_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmCursesPathWidget.h"
 
 class cmCursesFilePathWidget : public cmCursesPathWidget
 {
+  CM_DISABLE_COPY(cmCursesFilePathWidget)
+
 public:
   cmCursesFilePathWidget(int width, int height, int left, int top);
-
-protected:
-  cmCursesFilePathWidget(const cmCursesFilePathWidget& from);
-  void operator=(const cmCursesFilePathWidget&);
 };
 
 #endif // cmCursesFilePathWidget_h
diff --git a/Source/CursesDialog/cmCursesForm.cxx b/Source/CursesDialog/cmCursesForm.cxx
index 12e5d75..06c1e9c 100644
--- a/Source/CursesDialog/cmCursesForm.cxx
+++ b/Source/CursesDialog/cmCursesForm.cxx
@@ -2,8 +2,6 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCursesForm.h"
 
-#include "cmConfigure.h"
-
 cmsys::ofstream cmCursesForm::DebugFile;
 bool cmCursesForm::Debug = false;
 
diff --git a/Source/CursesDialog/cmCursesForm.h b/Source/CursesDialog/cmCursesForm.h
index 7eb94a8..553105c 100644
--- a/Source/CursesDialog/cmCursesForm.h
+++ b/Source/CursesDialog/cmCursesForm.h
@@ -3,7 +3,7 @@
 #ifndef cmCursesForm_h
 #define cmCursesForm_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmCursesStandardIncludes.h"
 
@@ -11,6 +11,8 @@
 
 class cmCursesForm
 {
+  CM_DISABLE_COPY(cmCursesForm)
+
 public:
   cmCursesForm();
   virtual ~cmCursesForm();
@@ -55,9 +57,6 @@ protected:
   static cmsys::ofstream DebugFile;
   static bool Debug;
 
-  cmCursesForm(const cmCursesForm& form);
-  void operator=(const cmCursesForm&);
-
   FORM* Form;
 };
 
diff --git a/Source/CursesDialog/cmCursesLabelWidget.h b/Source/CursesDialog/cmCursesLabelWidget.h
index a0de4c6..267de7c 100644
--- a/Source/CursesDialog/cmCursesLabelWidget.h
+++ b/Source/CursesDialog/cmCursesLabelWidget.h
@@ -14,6 +14,8 @@ class cmCursesMainForm;
 
 class cmCursesLabelWidget : public cmCursesWidget
 {
+  CM_DISABLE_COPY(cmCursesLabelWidget)
+
 public:
   cmCursesLabelWidget(int width, int height, int left, int top,
                       const std::string& name);
@@ -24,10 +26,6 @@ public:
   // when this widget has focus. Returns true if the input was
   // handled
   bool HandleInput(int& key, cmCursesMainForm* fm, WINDOW* w) CM_OVERRIDE;
-
-protected:
-  cmCursesLabelWidget(const cmCursesLabelWidget& from);
-  void operator=(const cmCursesLabelWidget&);
 };
 
 #endif // cmCursesLabelWidget_h
diff --git a/Source/CursesDialog/cmCursesLongMessageForm.h b/Source/CursesDialog/cmCursesLongMessageForm.h
index ab49c07..cd8e095 100644
--- a/Source/CursesDialog/cmCursesLongMessageForm.h
+++ b/Source/CursesDialog/cmCursesLongMessageForm.h
@@ -13,6 +13,8 @@
 
 class cmCursesLongMessageForm : public cmCursesForm
 {
+  CM_DISABLE_COPY(cmCursesLongMessageForm)
+
 public:
   cmCursesLongMessageForm(std::vector<std::string> const& messages,
                           const char* title);
@@ -38,9 +40,6 @@ public:
   void UpdateStatusBar() CM_OVERRIDE;
 
 protected:
-  cmCursesLongMessageForm(const cmCursesLongMessageForm& from);
-  void operator=(const cmCursesLongMessageForm&);
-
   std::string Messages;
   std::string Title;
 
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index b91211e..e35cf3e 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -23,6 +23,8 @@ class cmake;
  */
 class cmCursesMainForm : public cmCursesForm
 {
+  CM_DISABLE_COPY(cmCursesMainForm)
+
 public:
   cmCursesMainForm(std::vector<std::string> const& args, int initwidth);
   ~cmCursesMainForm() CM_OVERRIDE;
@@ -103,9 +105,6 @@ public:
   static void UpdateProgress(const char* msg, float prog, void*);
 
 protected:
-  cmCursesMainForm(const cmCursesMainForm& from);
-  void operator=(const cmCursesMainForm&);
-
   // Copy the cache values from the user interface to the actual
   // cache.
   void FillCacheManagerFromUI();
diff --git a/Source/CursesDialog/cmCursesOptionsWidget.h b/Source/CursesDialog/cmCursesOptionsWidget.h
index 4b2e8b4..7f4416f 100644
--- a/Source/CursesDialog/cmCursesOptionsWidget.h
+++ b/Source/CursesDialog/cmCursesOptionsWidget.h
@@ -15,6 +15,8 @@ class cmCursesMainForm;
 
 class cmCursesOptionsWidget : public cmCursesWidget
 {
+  CM_DISABLE_COPY(cmCursesOptionsWidget)
+
 public:
   cmCursesOptionsWidget(int width, int height, int left, int top);
 
@@ -29,8 +31,6 @@ public:
   void PreviousOption();
 
 protected:
-  cmCursesOptionsWidget(const cmCursesOptionsWidget& from);
-  void operator=(const cmCursesOptionsWidget&);
   std::vector<std::string> Options;
   std::vector<std::string>::size_type CurrentOption;
 };
diff --git a/Source/CursesDialog/cmCursesPathWidget.h b/Source/CursesDialog/cmCursesPathWidget.h
index 097eeca..ae6c16d 100644
--- a/Source/CursesDialog/cmCursesPathWidget.h
+++ b/Source/CursesDialog/cmCursesPathWidget.h
@@ -14,6 +14,8 @@ class cmCursesMainForm;
 
 class cmCursesPathWidget : public cmCursesStringWidget
 {
+  CM_DISABLE_COPY(cmCursesPathWidget)
+
 public:
   cmCursesPathWidget(int width, int height, int left, int top);
 
@@ -26,9 +28,6 @@ public:
   void OnType(int& key, cmCursesMainForm* fm, WINDOW* w) CM_OVERRIDE;
 
 protected:
-  cmCursesPathWidget(const cmCursesPathWidget& from);
-  void operator=(const cmCursesPathWidget&);
-
   std::string LastString;
   std::string LastGlob;
   bool Cycle;
diff --git a/Source/CursesDialog/cmCursesStringWidget.h b/Source/CursesDialog/cmCursesStringWidget.h
index c07bfce..5eb3366 100644
--- a/Source/CursesDialog/cmCursesStringWidget.h
+++ b/Source/CursesDialog/cmCursesStringWidget.h
@@ -20,6 +20,8 @@ class cmCursesMainForm;
 
 class cmCursesStringWidget : public cmCursesWidget
 {
+  CM_DISABLE_COPY(cmCursesStringWidget)
+
 public:
   cmCursesStringWidget(int width, int height, int left, int top);
 
@@ -60,9 +62,6 @@ public:
   bool PrintKeys() CM_OVERRIDE;
 
 protected:
-  cmCursesStringWidget(const cmCursesStringWidget& from);
-  void operator=(const cmCursesStringWidget&);
-
   // true if the widget is in edit mode
   bool InEdit;
   char* OriginalString;
diff --git a/Source/CursesDialog/cmCursesWidget.cxx b/Source/CursesDialog/cmCursesWidget.cxx
index 229a050..054f27e 100644
--- a/Source/CursesDialog/cmCursesWidget.cxx
+++ b/Source/CursesDialog/cmCursesWidget.cxx
@@ -2,8 +2,6 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmCursesWidget.h"
 
-#include "cmConfigure.h"
-
 cmCursesWidget::cmCursesWidget(int width, int height, int left, int top)
 {
   this->Field = new_field(height, width, top, left, 0, 0);
diff --git a/Source/CursesDialog/cmCursesWidget.h b/Source/CursesDialog/cmCursesWidget.h
index 5ce8a75..3470d70 100644
--- a/Source/CursesDialog/cmCursesWidget.h
+++ b/Source/CursesDialog/cmCursesWidget.h
@@ -3,7 +3,7 @@
 #ifndef cmCursesWidget_h
 #define cmCursesWidget_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmCursesStandardIncludes.h"
 #include "cmStateTypes.h"
@@ -14,6 +14,8 @@ class cmCursesMainForm;
 
 class cmCursesWidget
 {
+  CM_DISABLE_COPY(cmCursesWidget)
+
 public:
   cmCursesWidget(int width, int height, int left, int top);
   virtual ~cmCursesWidget();
@@ -59,9 +61,6 @@ public:
   friend class cmCursesMainForm;
 
 protected:
-  cmCursesWidget(const cmCursesWidget& from);
-  void operator=(const cmCursesWidget&);
-
   cmStateEnums::CacheEntryType Type;
   std::string Value;
   FIELD* Field;
diff --git a/Source/cmCLocaleEnvironmentScope.h b/Source/cmCLocaleEnvironmentScope.h
index 1e7c42a..e956cb2 100644
--- a/Source/cmCLocaleEnvironmentScope.h
+++ b/Source/cmCLocaleEnvironmentScope.h
@@ -3,21 +3,20 @@
 #ifndef cmCLocaleEnvironmentScope_h
 #define cmCLocaleEnvironmentScope_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <map>
 #include <string>
 
 class cmCLocaleEnvironmentScope
 {
+  CM_DISABLE_COPY(cmCLocaleEnvironmentScope)
+
 public:
   cmCLocaleEnvironmentScope();
   ~cmCLocaleEnvironmentScope();
 
 private:
-  cmCLocaleEnvironmentScope(cmCLocaleEnvironmentScope const&);
-  cmCLocaleEnvironmentScope& operator=(cmCLocaleEnvironmentScope const&);
-
   std::string GetEnv(std::string const& key);
   void SetEnv(std::string const& key, std::string const& value);
 
diff --git a/Source/cmCPackPropertiesGenerator.h b/Source/cmCPackPropertiesGenerator.h
index 107ccf9..48f4c10 100644
--- a/Source/cmCPackPropertiesGenerator.h
+++ b/Source/cmCPackPropertiesGenerator.h
@@ -3,7 +3,7 @@
 #ifndef cmCPackPropertiesGenerator_h
 #define cmCPackPropertiesGenerator_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmScriptGenerator.h"
 
@@ -20,6 +20,8 @@ class cmLocalGenerator;
  */
 class cmCPackPropertiesGenerator : public cmScriptGenerator
 {
+  CM_DISABLE_COPY(cmCPackPropertiesGenerator)
+
 public:
   cmCPackPropertiesGenerator(cmLocalGenerator* lg,
                              cmInstalledFile const& installedFile,
diff --git a/Source/cmCommand.h b/Source/cmCommand.h
index f4a75d5..62eced0 100644
--- a/Source/cmCommand.h
+++ b/Source/cmCommand.h
@@ -24,6 +24,8 @@ struct cmListFileArgument;
  */
 class cmCommand
 {
+  CM_DISABLE_COPY(cmCommand)
+
 public:
   /**
    * Construct the command. By default it has no makefile.
@@ -103,10 +105,6 @@ public:
    */
   void SetError(const std::string& e);
 
-private:
-  cmCommand(cmCommand const&);            // = delete;
-  cmCommand& operator=(cmCommand const&); // = delete;
-
 protected:
   cmMakefile* Makefile;
 
diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx
index 153efc4..4eb4531 100644
--- a/Source/cmCommandArgumentParserHelper.cxx
+++ b/Source/cmCommandArgumentParserHelper.cxx
@@ -8,7 +8,6 @@
 #include "cmSystemTools.h"
 #include "cmake.h"
 
-#include "cmConfigure.h"
 #include <iostream>
 #include <sstream>
 #include <string.h>
diff --git a/Source/cmCommandArgumentParserHelper.h b/Source/cmCommandArgumentParserHelper.h
index c0c1cd9..465ca9e 100644
--- a/Source/cmCommandArgumentParserHelper.h
+++ b/Source/cmCommandArgumentParserHelper.h
@@ -3,7 +3,7 @@
 #ifndef cmCommandArgumentParserHelper_h
 #define cmCommandArgumentParserHelper_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <string>
 #include <vector>
@@ -12,6 +12,8 @@ class cmMakefile;
 
 class cmCommandArgumentParserHelper
 {
+  CM_DISABLE_COPY(cmCommandArgumentParserHelper)
+
 public:
   struct ParserType
   {
@@ -60,10 +62,6 @@ public:
   char BSLASHVariable[3];
 
 private:
-  cmCommandArgumentParserHelper(cmCommandArgumentParserHelper const&);
-  cmCommandArgumentParserHelper& operator=(
-    cmCommandArgumentParserHelper const&);
-
   std::string::size_type InputBufferPos;
   std::string InputBuffer;
   std::vector<char> OutputBuffer;
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index ac92c48..c380d85 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -3,7 +3,7 @@
 #ifndef cmCryptoHash_h
 #define cmCryptoHash_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <stddef.h>
 #include <string>
@@ -16,6 +16,8 @@
  */
 class cmCryptoHash
 {
+  CM_DISABLE_COPY(cmCryptoHash)
+
 public:
   enum Algo
   {
@@ -78,9 +80,6 @@ public:
   std::string FinalizeHex();
 
 private:
-  cmCryptoHash(cmCryptoHash const&);
-  cmCryptoHash& operator=(cmCryptoHash const&);
-
   unsigned int Id;
   struct rhash_context* CTX;
 };
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index a80b585..b33feb9 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -24,6 +24,8 @@ class cmLocalGenerator;
  */
 class cmDepends
 {
+  CM_DISABLE_COPY(cmDepends)
+
 public:
   /** Instances need to know the build directory name and the relative
       path from the build directory to the target file.  */
@@ -116,10 +118,6 @@ protected:
   std::vector<std::string> IncludePath;
 
   void SetIncludePathFromLanguage(const std::string& lang);
-
-private:
-  cmDepends(cmDepends const&);      // Purposely not implemented.
-  void operator=(cmDepends const&); // Purposely not implemented.
 };
 
 #endif
diff --git a/Source/cmDependsC.h b/Source/cmDependsC.h
index 4f52826..250d40f 100644
--- a/Source/cmDependsC.h
+++ b/Source/cmDependsC.h
@@ -22,6 +22,8 @@ class cmLocalGenerator;
  */
 class cmDependsC : public cmDepends
 {
+  CM_DISABLE_COPY(cmDependsC)
+
 public:
   /** Checking instances need to know the build directory name and the
       relative path from the build directory to the target file.  */
@@ -93,10 +95,6 @@ protected:
 
   void WriteCacheFile() const;
   void ReadCacheFile();
-
-private:
-  cmDependsC(cmDependsC const&);     // Purposely not implemented.
-  void operator=(cmDependsC const&); // Purposely not implemented.
 };
 
 #endif
diff --git a/Source/cmDependsFortran.h b/Source/cmDependsFortran.h
index a9a1ed3..ec208af3 100644
--- a/Source/cmDependsFortran.h
+++ b/Source/cmDependsFortran.h
@@ -21,6 +21,8 @@ class cmLocalGenerator;
  */
 class cmDependsFortran : public cmDepends
 {
+  CM_DISABLE_COPY(cmDependsFortran)
+
 public:
   /** Checking instances need to know the build directory name and the
       relative path from the build directory to the target file.  */
@@ -77,9 +79,6 @@ protected:
   cmDependsFortranInternals* Internal;
 
 private:
-  cmDependsFortran(cmDependsFortran const&); // Purposely not implemented.
-  void operator=(cmDependsFortran const&);   // Purposely not implemented.
-
   std::string MaybeConvertToRelativePath(std::string const& base,
                                          std::string const& path);
 };
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index 6efa51a..a07bf09 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -17,6 +17,8 @@
  */
 class cmDependsJava : public cmDepends
 {
+  CM_DISABLE_COPY(cmDependsJava)
+
 public:
   /** Checking instances need to know the build directory name and the
       relative path from the build directory to the target file.  */
@@ -33,10 +35,6 @@ protected:
   bool CheckDependencies(
     std::istream& internalDepends, const char* internalDependsFileName,
     std::map<std::string, DependencyVector>& validDeps) CM_OVERRIDE;
-
-private:
-  cmDependsJava(cmDependsJava const&);  // Purposely not implemented.
-  void operator=(cmDependsJava const&); // Purposely not implemented.
 };
 
 #endif
diff --git a/Source/cmDynamicLoader.cxx b/Source/cmDynamicLoader.cxx
index 76a4a29..f530ba7 100644
--- a/Source/cmDynamicLoader.cxx
+++ b/Source/cmDynamicLoader.cxx
@@ -2,8 +2,6 @@
    file Copyright.txt or https://cmake.org/licensing for details.  */
 #include "cmDynamicLoader.h"
 
-#include "cmConfigure.h"
-
 #include <map>
 #include <string>
 #include <utility>
diff --git a/Source/cmDynamicLoader.h b/Source/cmDynamicLoader.h
index dd69b40..7c46dd5 100644
--- a/Source/cmDynamicLoader.h
+++ b/Source/cmDynamicLoader.h
@@ -8,12 +8,14 @@
 #ifndef cmDynamicLoader_h
 #define cmDynamicLoader_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmsys/DynamicLoader.hxx" // IWYU pragma: export
 
 class cmDynamicLoader
 {
+  CM_DISABLE_COPY(cmDynamicLoader)
+
 public:
   // Description:
   // Load a dynamic library into the current process.
@@ -28,10 +30,6 @@ public:
 protected:
   cmDynamicLoader() {}
   ~cmDynamicLoader() {}
-
-private:
-  cmDynamicLoader(const cmDynamicLoader&); // Not implemented.
-  void operator=(const cmDynamicLoader&);  // Not implemented.
 };
 
 #endif
diff --git a/Source/cmFileLock.h b/Source/cmFileLock.h
index 8f996cf..ccef508 100644
--- a/Source/cmFileLock.h
+++ b/Source/cmFileLock.h
@@ -3,7 +3,7 @@
 #ifndef cmFileLock_h
 #define cmFileLock_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <string>
 
@@ -21,6 +21,8 @@ class cmFileLockResult;
   */
 class cmFileLock
 {
+  CM_DISABLE_COPY(cmFileLock)
+
 public:
   cmFileLock();
   ~cmFileLock();
@@ -44,9 +46,6 @@ public:
   bool IsLocked(const std::string& filename) const;
 
 private:
-  cmFileLock(const cmFileLock&);
-  cmFileLock& operator=(const cmFileLock&);
-
   cmFileLockResult OpenFile();
   cmFileLockResult LockWithoutTimeout();
   cmFileLockResult LockWithTimeout(unsigned long timeoutSec);
diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h
index 09c984c..689ddd7 100644
--- a/Source/cmFileLockPool.h
+++ b/Source/cmFileLockPool.h
@@ -3,7 +3,7 @@
 #ifndef cmFileLockPool_h
 #define cmFileLockPool_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <list>
 #include <string>
@@ -13,6 +13,8 @@ class cmFileLockResult;
 
 class cmFileLockPool
 {
+  CM_DISABLE_COPY(cmFileLockPool)
+
 public:
   cmFileLockPool();
   ~cmFileLockPool();
@@ -52,13 +54,12 @@ public:
   cmFileLockResult Release(const std::string& filename);
 
 private:
-  cmFileLockPool(const cmFileLockPool&);
-  cmFileLockPool& operator=(const cmFileLockPool&);
-
   bool IsAlreadyLocked(const std::string& filename) const;
 
   class ScopePool
   {
+    CM_DISABLE_COPY(ScopePool)
+
   public:
     ScopePool();
     ~ScopePool();
@@ -69,9 +70,6 @@ private:
     bool IsAlreadyLocked(const std::string& filename) const;
 
   private:
-    ScopePool(const ScopePool&);
-    ScopePool& operator=(const ScopePool&);
-
     typedef std::list<cmFileLock*> List;
     typedef List::iterator It;
     typedef List::const_iterator CIt;
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 694ce8a..34516f5 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -31,6 +31,8 @@ struct cmGeneratorExpressionEvaluator;
  */
 class cmGeneratorExpression
 {
+  CM_DISABLE_COPY(cmGeneratorExpression)
+
 public:
   /** Construct. */
   cmGeneratorExpression(
@@ -61,14 +63,13 @@ public:
   static std::string StripEmptyListElements(const std::string& input);
 
 private:
-  cmGeneratorExpression(const cmGeneratorExpression&);
-  void operator=(const cmGeneratorExpression&);
-
   cmListFileBacktrace Backtrace;
 };
 
 class cmCompiledGeneratorExpression
 {
+  CM_DISABLE_COPY(cmCompiledGeneratorExpression)
+
 public:
   const char* Evaluate(
     cmLocalGenerator* lg, const std::string& config, bool quiet = false,
@@ -133,9 +134,6 @@ private:
 
   friend class cmGeneratorExpression;
 
-  cmCompiledGeneratorExpression(const cmCompiledGeneratorExpression&);
-  void operator=(const cmCompiledGeneratorExpression&);
-
   cmListFileBacktrace Backtrace;
   std::vector<cmGeneratorExpressionEvaluator*> Evaluators;
   const std::string Input;
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index a6a341b..a0a826a 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -30,8 +30,7 @@ struct cmGeneratorExpressionEvaluator
                                cmGeneratorExpressionDAGChecker*) const = 0;
 
 private:
-  cmGeneratorExpressionEvaluator(const cmGeneratorExpressionEvaluator&);
-  void operator=(const cmGeneratorExpressionEvaluator&);
+  CM_DISABLE_COPY(cmGeneratorExpressionEvaluator)
 };
 
 struct TextContent : public cmGeneratorExpressionEvaluator
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index ae12f97..13b6b73 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -27,6 +27,8 @@ class cmTarget;
 
 class cmGeneratorTarget
 {
+  CM_DISABLE_COPY(cmGeneratorTarget)
+
 public:
   cmGeneratorTarget(cmTarget*, cmLocalGenerator* lg);
   ~cmGeneratorTarget();
@@ -701,9 +703,6 @@ private:
   void CheckPropertyCompatibility(cmComputeLinkInformation* info,
                                   const std::string& config) const;
 
-  cmGeneratorTarget(cmGeneratorTarget const&);
-  void operator=(cmGeneratorTarget const&);
-
   struct LinkImplClosure : public std::vector<cmGeneratorTarget const*>
   {
     LinkImplClosure()
diff --git a/Source/cmInstallGenerator.h b/Source/cmInstallGenerator.h
index bb1dd54..de19f98 100644
--- a/Source/cmInstallGenerator.h
+++ b/Source/cmInstallGenerator.h
@@ -21,6 +21,8 @@ class cmMakefile;
  */
 class cmInstallGenerator : public cmScriptGenerator
 {
+  CM_DISABLE_COPY(cmInstallGenerator)
+
 public:
   enum MessageLevel
   {
diff --git a/Source/cmLinkLineComputer.h b/Source/cmLinkLineComputer.h
index d8dacf3..27b8adb 100644
--- a/Source/cmLinkLineComputer.h
+++ b/Source/cmLinkLineComputer.h
@@ -4,7 +4,7 @@
 #ifndef cmLinkLineComputer_h
 #define cmLinkLineComputer_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <string>
 
@@ -16,6 +16,8 @@ class cmOutputConverter;
 
 class cmLinkLineComputer
 {
+  CM_DISABLE_COPY(cmLinkLineComputer)
+
 public:
   cmLinkLineComputer(cmOutputConverter* outputConverter,
                      cmStateDirectory stateDir);
@@ -41,9 +43,6 @@ public:
                                         std::string const& config);
 
 protected:
-  cmLinkLineComputer(cmLinkLineComputer const&);
-  cmLinkLineComputer& operator=(cmLinkLineComputer const&);
-
   std::string ComputeLinkLibs(cmComputeLinkInformation& cli);
   std::string ComputeRPath(cmComputeLinkInformation& cli);
 
diff --git a/Source/cmLinkLineDeviceComputer.h b/Source/cmLinkLineDeviceComputer.h
index a827b06..e9e98ac 100644
--- a/Source/cmLinkLineDeviceComputer.h
+++ b/Source/cmLinkLineDeviceComputer.h
@@ -18,6 +18,8 @@ class cmStateDirectory;
 
 class cmLinkLineDeviceComputer : public cmLinkLineComputer
 {
+  CM_DISABLE_COPY(cmLinkLineDeviceComputer)
+
 public:
   cmLinkLineDeviceComputer(cmOutputConverter* outputConverter,
                            cmStateDirectory stateDir);
@@ -33,6 +35,8 @@ public:
 
 class cmNinjaLinkLineDeviceComputer : public cmLinkLineDeviceComputer
 {
+  CM_DISABLE_COPY(cmNinjaLinkLineDeviceComputer)
+
 public:
   cmNinjaLinkLineDeviceComputer(cmOutputConverter* outputConverter,
                                 cmStateDirectory stateDir,
diff --git a/Source/cmLocale.h b/Source/cmLocale.h
index 086f448..9f90a3a 100644
--- a/Source/cmLocale.h
+++ b/Source/cmLocale.h
@@ -10,6 +10,8 @@
 
 class cmLocaleRAII
 {
+  CM_DISABLE_COPY(cmLocaleRAII)
+
 public:
   cmLocaleRAII()
     : OldLocale(setlocale(LC_CTYPE, CM_NULLPTR))
@@ -19,9 +21,6 @@ public:
   ~cmLocaleRAII() { setlocale(LC_CTYPE, this->OldLocale.c_str()); }
 
 private:
-  cmLocaleRAII(cmLocaleRAII const&);
-  cmLocaleRAII& operator=(cmLocaleRAII const&);
-
   std::string OldLocale;
 };
 
diff --git a/Source/cmMSVC60LinkLineComputer.h b/Source/cmMSVC60LinkLineComputer.h
index 612658c..e494060 100644
--- a/Source/cmMSVC60LinkLineComputer.h
+++ b/Source/cmMSVC60LinkLineComputer.h
@@ -15,6 +15,8 @@ class cmStateDirectory;
 
 class cmMSVC60LinkLineComputer : public cmLinkLineComputer
 {
+  CM_DISABLE_COPY(cmMSVC60LinkLineComputer)
+
 public:
   cmMSVC60LinkLineComputer(cmOutputConverter* outputConverter,
                            cmStateDirectory stateDir);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 2f4cea6..52a6498 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -54,6 +54,8 @@ class cmVariableWatch;
  */
 class cmMakefile
 {
+  CM_DISABLE_COPY(cmMakefile)
+
 public:
   /* Mark a variable as used */
   void MarkVariableAsUsed(const std::string& var);
@@ -709,6 +711,7 @@ public:
   /** Helper class to push and pop scopes automatically.  */
   class ScopePushPop
   {
+    CM_DISABLE_COPY(ScopePushPop)
   public:
     ScopePushPop(cmMakefile* m)
       : Makefile(m)
@@ -717,8 +720,6 @@ public:
     }
     ~ScopePushPop() { this->Makefile->PopScope(); }
   private:
-    ScopePushPop(ScopePushPop const&);
-    ScopePushPop& operator=(ScopePushPop const&);
     cmMakefile* Makefile;
   };
 
@@ -831,9 +832,6 @@ protected:
                          cmExecutionStatus& status);
 
 private:
-  cmMakefile(const cmMakefile& mf);
-  cmMakefile& operator=(const cmMakefile& mf);
-
   cmStateSnapshot StateSnapshot;
   cmListFileBacktrace Backtrace;
 
diff --git a/Source/cmNinjaLinkLineComputer.h b/Source/cmNinjaLinkLineComputer.h
index db6d4a8..e612e88 100644
--- a/Source/cmNinjaLinkLineComputer.h
+++ b/Source/cmNinjaLinkLineComputer.h
@@ -16,6 +16,8 @@ class cmStateDirectory;
 
 class cmNinjaLinkLineComputer : public cmLinkLineComputer
 {
+  CM_DISABLE_COPY(cmNinjaLinkLineComputer)
+
 public:
   cmNinjaLinkLineComputer(cmOutputConverter* outputConverter,
                           cmStateDirectory stateDir,
diff --git a/Source/cmScriptGenerator.cxx b/Source/cmScriptGenerator.cxx
index 3cf2537..753a1ba 100644
--- a/Source/cmScriptGenerator.cxx
+++ b/Source/cmScriptGenerator.cxx
@@ -4,8 +4,6 @@
 
 #include "cmSystemTools.h"
 
-#include "cmConfigure.h"
-
 cmScriptGenerator::cmScriptGenerator(
   const std::string& config_var,
   std::vector<std::string> const& configurations)
diff --git a/Source/cmScriptGenerator.h b/Source/cmScriptGenerator.h
index 4023f3e..d0879c6 100644
--- a/Source/cmScriptGenerator.h
+++ b/Source/cmScriptGenerator.h
@@ -3,7 +3,7 @@
 #ifndef cmScriptGenerator_h
 #define cmScriptGenerator_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include <ostream>
 #include <string>
@@ -47,6 +47,8 @@ inline std::ostream& operator<<(std::ostream& os,
  */
 class cmScriptGenerator
 {
+  CM_DISABLE_COPY(cmScriptGenerator)
+
 public:
   cmScriptGenerator(const std::string& config_var,
                     std::vector<std::string> const& configurations);
@@ -87,9 +89,6 @@ protected:
   bool ActionsPerConfig;
 
 private:
-  cmScriptGenerator(cmScriptGenerator const&);
-  cmScriptGenerator& operator=(cmScriptGenerator const&);
-
   void GenerateScriptActionsOnce(std::ostream& os, Indent indent);
   void GenerateScriptActionsPerConfig(std::ostream& os, Indent indent);
 };
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index 3ba2c22..d0902b1 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -3,7 +3,7 @@
 #ifndef cmSystemTools_h
 #define cmSystemTools_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmProcessOutput.h"
 #include "cmsys/Process.h"
@@ -379,14 +379,12 @@ public:
       original environment. */
   class SaveRestoreEnvironment
   {
+    CM_DISABLE_COPY(SaveRestoreEnvironment)
   public:
     SaveRestoreEnvironment();
     ~SaveRestoreEnvironment();
 
   private:
-    SaveRestoreEnvironment(SaveRestoreEnvironment const&);
-    SaveRestoreEnvironment& operator=(SaveRestoreEnvironment const&);
-
     std::vector<std::string> Env;
   };
 #endif
diff --git a/Source/cmTestGenerator.h b/Source/cmTestGenerator.h
index 9a25e33..b227305 100644
--- a/Source/cmTestGenerator.h
+++ b/Source/cmTestGenerator.h
@@ -3,7 +3,7 @@
 #ifndef cmTestGenerator_h
 #define cmTestGenerator_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmScriptGenerator.h"
 
@@ -20,6 +20,8 @@ class cmTest;
  */
 class cmTestGenerator : public cmScriptGenerator
 {
+  CM_DISABLE_COPY(cmTestGenerator)
+
 public:
   cmTestGenerator(cmTest* test,
                   std::vector<std::string> const& configurations =
diff --git a/Source/cmXMLWriter.h b/Source/cmXMLWriter.h
index 14c82b1..ed76a88 100644
--- a/Source/cmXMLWriter.h
+++ b/Source/cmXMLWriter.h
@@ -3,7 +3,7 @@
 #ifndef cmXMLWiter_h
 #define cmXMLWiter_h
 
-#include "cmConfigure.h" // IWYU pragma: keep
+#include "cmConfigure.h"
 
 #include "cmXMLSafe.h"
 
@@ -14,6 +14,8 @@
 
 class cmXMLWriter
 {
+  CM_DISABLE_COPY(cmXMLWriter)
+
 public:
   cmXMLWriter(std::ostream& output, std::size_t level = 0);
   ~cmXMLWriter();
@@ -63,9 +65,6 @@ public:
   void SetIndentationElement(std::string const& element);
 
 private:
-  cmXMLWriter(const cmXMLWriter&);
-  cmXMLWriter& operator=(const cmXMLWriter&);
-
   void ConditionalLineBreak(bool condition, std::size_t indent);
 
   void PreAttribute();
diff --git a/Source/cmake.h b/Source/cmake.h
index 6a6beb4..16a2830 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -55,6 +55,8 @@ struct cmDocumentationEntry;
 
 class cmake
 {
+  CM_DISABLE_COPY(cmake)
+
 public:
   enum MessageType
   {
@@ -460,8 +462,6 @@ protected:
   cmVariableWatch* VariableWatch;
 
 private:
-  cmake(const cmake&);          // Not implemented.
-  void operator=(const cmake&); // Not implemented.
   ProgressCallbackType ProgressCallback;
   void* ProgressCallbackClientData;
   bool InTryCompile;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1
commit 4f5bbbeab9bbe7dd3aa3bd9be5d201ed2447bad1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Fri Apr 21 14:29:27 2017 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Fri Apr 21 15:04:33 2017 -0400

    Add deprecation warnings for policies CMP0036 and below
    
    The OLD behaviors of all policies are deprecated, but only by
    documentation.  Add an explicit deprecation diagnostic for some policies
    to encourage projects to port away from setting policies to OLD.

diff --git a/Help/release/dev/deprecate-policy-old.rst b/Help/release/dev/deprecate-policy-old.rst
new file mode 100644
index 0000000..9ae30e6
--- /dev/null
+++ b/Help/release/dev/deprecate-policy-old.rst
@@ -0,0 +1,7 @@
+deprecate-policy-old
+--------------------
+
+* An explicit deprecation diagnostic was added for policies ``CMP0036``
+  and below.  The :manual:`cmake-policies(7)` manual explains that the
+  OLD behaviors of all policies are deprecated and that projects should
+  port to the NEW behaviors.
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 4ed76c7..b8a5293 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4002,6 +4002,13 @@ bool cmMakefile::SetPolicy(cmPolicies::PolicyID id,
     return false;
   }
 
+  // Deprecate old policies, especially those that require a lot
+  // of code to maintain the old behavior.
+  if (status == cmPolicies::OLD && id <= cmPolicies::CMP0036) {
+    this->IssueMessage(cmake::DEPRECATION_WARNING,
+                       cmPolicies::GetPolicyDeprecatedWarning(id));
+  }
+
   this->StateSnapshot.SetPolicy(id, status);
   return true;
 }
diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx
index 837557b..da3edd4 100644
--- a/Source/cmPolicies.cxx
+++ b/Source/cmPolicies.cxx
@@ -275,6 +275,22 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id)
   return msg.str();
 }
 
+std::string cmPolicies::GetPolicyDeprecatedWarning(cmPolicies::PolicyID id)
+{
+  std::ostringstream msg;
+  /* clang-format off */
+  msg <<
+    "The OLD behavior for policy " << idToString(id) << " "
+    "will be removed from a future version of CMake.\n"
+    "The cmake-policies(7) manual explains that the OLD behaviors of all "
+    "policies are deprecated and that a policy should be set to OLD only "
+    "under specific short-term circumstances.  Projects should be ported "
+    "to the NEW behavior and not rely on setting a policy to OLD."
+    ;
+  /* clang-format on */
+  return msg.str();
+}
+
 ///! return an error string for when a required policy is unspecified
 std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id)
 {
diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h
index 120beb6..69cbc18 100644
--- a/Source/cmPolicies.h
+++ b/Source/cmPolicies.h
@@ -279,6 +279,7 @@ public:
 
   ///! return a warning string for a given policy
   static std::string GetPolicyWarning(cmPolicies::PolicyID id);
+  static std::string GetPolicyDeprecatedWarning(cmPolicies::PolicyID id);
 
   ///! return an error string for when a required policy is unspecified
   static std::string GetRequiredPolicyError(cmPolicies::PolicyID id);
diff --git a/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
new file mode 100644
index 0000000..048762d
--- /dev/null
+++ b/Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0019-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0019 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
new file mode 100644
index 0000000..edeb337
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0026-CONFIG-LOCATION-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0026 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
new file mode 100644
index 0000000..32ff698
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0026-LOCATION-CONFIG-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0026 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
new file mode 100644
index 0000000..b3f79fc
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0026-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0026 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
new file mode 100644
index 0000000..157a046
--- /dev/null
+++ b/Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at clear-cached-information.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0026 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt
new file mode 100644
index 0000000..b7a0755
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0028-OLD-iface.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0028 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt
new file mode 100644
index 0000000..586a876
--- /dev/null
+++ b/Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0028-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0028 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt
new file mode 100644
index 0000000..430c865
--- /dev/null
+++ b/Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0029-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0029 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$
diff --git a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt
index e95e16f..d00b827 100644
--- a/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt
+++ b/Tests/RunCMake/DisallowedCommands/CMP0030-OLD-stderr.txt
@@ -1,4 +1,15 @@
-^CMake Error at CMP0030-OLD.cmake:2 \(use_mangled_mesa\):
+^CMake Deprecation Warning at CMP0030-OLD.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0030 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)
++
+CMake Error at CMP0030-OLD.cmake:2 \(use_mangled_mesa\):
   use_mangled_mesa called with incorrect number of arguments
 Call Stack \(most recent call first\):
   CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt
new file mode 100644
index 0000000..d7ccedb
--- /dev/null
+++ b/Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt
@@ -0,0 +1,10 @@
+^CMake Deprecation Warning at CMP0026-LOCATION.cmake:[0-9]+ \(cmake_policy\):
+  The OLD behavior for policy CMP0026 will be removed from a future version
+  of CMake.
+
+  The cmake-policies\(7\) manual explains that the OLD behaviors of all
+  policies are deprecated and that a policy should be set to OLD only under
+  specific short-term circumstances.  Projects should be ported to the NEW
+  behavior and not rely on setting a policy to OLD.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:[0-9]+ \(include\)$

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

Summary of changes:
 Help/release/dev/deprecate-policy-old.rst          |    7 +++++
 Source/CursesDialog/cmCursesBoolWidget.h           |    6 ++--
 .../CursesDialog/cmCursesCacheEntryComposite.cxx   |    1 -
 Source/CursesDialog/cmCursesCacheEntryComposite.h  |    7 ++---
 Source/CursesDialog/cmCursesDummyWidget.h          |    6 ++--
 Source/CursesDialog/cmCursesFilePathWidget.h       |    8 ++---
 Source/CursesDialog/cmCursesForm.cxx               |    2 --
 Source/CursesDialog/cmCursesForm.h                 |    7 ++---
 Source/CursesDialog/cmCursesLabelWidget.h          |    6 ++--
 Source/CursesDialog/cmCursesLongMessageForm.h      |    5 ++-
 Source/CursesDialog/cmCursesMainForm.h             |    5 ++-
 Source/CursesDialog/cmCursesOptionsWidget.h        |    4 +--
 Source/CursesDialog/cmCursesPathWidget.h           |    5 ++-
 Source/CursesDialog/cmCursesStringWidget.h         |    5 ++-
 Source/CursesDialog/cmCursesWidget.cxx             |    2 --
 Source/CursesDialog/cmCursesWidget.h               |    7 ++---
 Source/cmCLocaleEnvironmentScope.h                 |    7 ++---
 Source/cmCPackPropertiesGenerator.h                |    4 ++-
 Source/cmCommand.h                                 |    6 ++--
 Source/cmCommandArgumentParserHelper.cxx           |    1 -
 Source/cmCommandArgumentParserHelper.h             |    8 ++---
 Source/cmCryptoHash.h                              |    7 ++---
 Source/cmDepends.h                                 |    6 ++--
 Source/cmDependsC.h                                |    6 ++--
 Source/cmDependsFortran.h                          |    5 ++-
 Source/cmDependsJava.h                             |    6 ++--
 Source/cmDynamicLoader.cxx                         |    2 --
 Source/cmDynamicLoader.h                           |    8 ++---
 Source/cmFileLock.h                                |    7 ++---
 Source/cmFileLockPool.h                            |   12 +++----
 Source/cmGeneratorExpression.h                     |   10 +++---
 Source/cmGeneratorExpressionEvaluator.h            |    3 +-
 Source/cmGeneratorTarget.h                         |    5 ++-
 Source/cmGlobalNinjaGenerator.cxx                  |    6 +++-
 Source/cmInstallGenerator.h                        |    2 ++
 Source/cmLinkLineComputer.h                        |    7 ++---
 Source/cmLinkLineDeviceComputer.h                  |    4 +++
 Source/cmLocale.h                                  |    5 ++-
 Source/cmMSVC60LinkLineComputer.h                  |    2 ++
 Source/cmMakefile.cxx                              |    7 +++++
 Source/cmMakefile.h                                |    8 ++---
 Source/cmNinjaLinkLineComputer.h                   |    2 ++
 Source/cmNinjaTargetGenerator.cxx                  |   19 ++++++++---
 Source/cmPolicies.cxx                              |   16 ++++++++++
 Source/cmPolicies.h                                |    1 +
 Source/cmScriptGenerator.cxx                       |    2 --
 Source/cmScriptGenerator.h                         |    7 ++---
 Source/cmSystemTools.cxx                           |   33 ++++++++++++++++++++
 Source/cmSystemTools.h                             |   13 +++++---
 Source/cmTestGenerator.h                           |    4 ++-
 Source/cmXMLWriter.h                               |    7 ++---
 Source/cmake.h                                     |    4 +--
 Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt      |   10 ++++++
 .../CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt |   10 ++++++
 .../CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt |   10 ++++++
 Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt      |   10 ++++++
 .../CMP0026/clear-cached-information-stderr.txt    |   10 ++++++
 .../RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt  |   10 ++++++
 Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt      |   10 ++++++
 .../DisallowedCommands/CMP0029-OLD-stderr.txt      |   10 ++++++
 .../DisallowedCommands/CMP0030-OLD-stderr.txt      |   13 +++++++-
 .../TargetSources/CMP0026-LOCATION-stderr.txt      |   10 ++++++
 62 files changed, 292 insertions(+), 146 deletions(-)
 create mode 100644 Help/release/dev/deprecate-policy-old.rst
 create mode 100644 Tests/RunCMake/CMP0019/CMP0019-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0026/CMP0026-CONFIG-LOCATION-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0026/CMP0026-LOCATION-CONFIG-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0026/CMP0026-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0026/clear-cached-information-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0028/CMP0028-OLD-iface-stderr.txt
 create mode 100644 Tests/RunCMake/CMP0028/CMP0028-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/DisallowedCommands/CMP0029-OLD-stderr.txt
 create mode 100644 Tests/RunCMake/TargetSources/CMP0026-LOCATION-stderr.txt


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list