[Cmake-commits] CMake branch, next, updated. v3.6.0-rc3-607-gd4342c4

Brad King brad.king at kitware.com
Wed Jun 29 09:26:48 EDT 2016


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, next has been updated
       via  d4342c4143c6f58019f5900f897336fadaaa013a (commit)
       via  b33f276ed81bdbcf25ee6c5e3a7f051c5c2773ee (commit)
      from  a10cf4ec311bbb17f20d334ed5d7530cf3fe247f (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=d4342c4143c6f58019f5900f897336fadaaa013a
commit d4342c4143c6f58019f5900f897336fadaaa013a
Merge: a10cf4e b33f276
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 29 09:26:45 2016 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Jun 29 09:26:45 2016 -0400

    Merge topic 'refactor-auto_ptr' into next
    
    b33f276e Revert "Avoid using KWSys auto_ptr and use std::auto_ptr when possible"


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b33f276ed81bdbcf25ee6c5e3a7f051c5c2773ee
commit b33f276ed81bdbcf25ee6c5e3a7f051c5c2773ee
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Jun 29 09:26:18 2016 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Jun 29 09:26:18 2016 -0400

    Revert "Avoid using KWSys auto_ptr and use std::auto_ptr when possible"
    
    This reverts commit d6409f1f4ed7a4aab1ba7f48c9e2c3aabfffc342.

diff --git a/Help/manual/cmake-developer.7.rst b/Help/manual/cmake-developer.7.rst
index afaccc6..7bfdcad 100644
--- a/Help/manual/cmake-developer.7.rst
+++ b/Help/manual/cmake-developer.7.rst
@@ -24,10 +24,9 @@ to build with such toolchains.
 std::auto_ptr
 -------------
 
-The ``std::auto_ptr`` template is deprecated in C++11.  We want to use it
-so we can build on C++98 compilers but we do not want to turn off compiler
-warnings about deprecated interfaces in general.  Use the ``CM_AUTO_PTR``
-macro instead.
+Some implementations have a ``std::auto_ptr`` which can not be used as a
+return value from a function. ``std::auto_ptr`` may not be used. Use
+``cmsys::auto_ptr`` instead.
 
 size_t
 ------
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index d49ebbb..fd73984 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -364,7 +364,6 @@ set(SRCS
   cmake.cxx
   cmake.h
 
-  cm_auto_ptr.hxx
   cm_get_date.h
   cm_get_date.c
   cm_sha2.h
diff --git a/Source/CPack/WiX/cmCPackWIXGenerator.cxx b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
index 97216c3..b5b364d 100644
--- a/Source/CPack/WiX/cmCPackWIXGenerator.cxx
+++ b/Source/CPack/WiX/cmCPackWIXGenerator.cxx
@@ -1044,7 +1044,7 @@ std::string cmCPackWIXGenerator::CreateNewIdForPath(std::string const& path)
 std::string cmCPackWIXGenerator::CreateHashedId(
   std::string const& path, std::string const& normalizedFilename)
 {
-  CM_AUTO_PTR<cmCryptoHash> sha1 = cmCryptoHash::New("SHA1");
+  cmsys::auto_ptr<cmCryptoHash> sha1 = cmCryptoHash::New("SHA1");
   std::string hash = sha1->HashString(path.c_str());
 
   std::string identifier;
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index df8bb0f..914d0dc 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -624,7 +624,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
         cm.AddCMakePaths();
         cm.SetProgressCallback(cmCPackGeneratorProgress, this);
         cmGlobalGenerator gg(&cm);
-        CM_AUTO_PTR<cmMakefile> mf(
+        cmsys::auto_ptr<cmMakefile> mf(
           new cmMakefile(&gg, cm.GetCurrentSnapshot()));
         if (!installSubDirectory.empty() && installSubDirectory != "/") {
           tempInstallDirectory += installSubDirectory;
diff --git a/Source/CPack/cpack.cxx b/Source/CPack/cpack.cxx
index 771519c..b4a2c6f 100644
--- a/Source/CPack/cpack.cxx
+++ b/Source/CPack/cpack.cxx
@@ -185,7 +185,7 @@ int main(int argc, char const* const* argv)
   cminst.GetCurrentSnapshot().SetDefaultDefinitions();
   cminst.GetState()->RemoveUnscriptableCommands();
   cmGlobalGenerator cmgg(&cminst);
-  CM_AUTO_PTR<cmMakefile> globalMF(
+  cmsys::auto_ptr<cmMakefile> globalMF(
     new cmMakefile(&cmgg, cminst.GetCurrentSnapshot()));
 #if defined(__CYGWIN__)
   globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");
diff --git a/Source/CTest/cmCTestLaunch.cxx b/Source/CTest/cmCTestLaunch.cxx
index 3eed79e..477f16e 100644
--- a/Source/CTest/cmCTestLaunch.cxx
+++ b/Source/CTest/cmCTestLaunch.cxx
@@ -612,7 +612,7 @@ int cmCTestLaunch::Main(int argc, const char* const argv[])
 #include "cmGlobalGenerator.h"
 #include "cmMakefile.h"
 #include "cmake.h"
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 void cmCTestLaunch::LoadConfig()
 {
   cmake cm;
@@ -620,7 +620,7 @@ void cmCTestLaunch::LoadConfig()
   cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
-  CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
+  cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
   std::string fname = this->LogDir;
   fname += "CTestLaunchConfig.cmake";
   if (cmSystemTools::FileExists(fname.c_str()) &&
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index cd250fb..1b6b442 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1352,7 +1352,7 @@ void cmCTestTestHandler::GetListOfTests()
   cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
-  CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
+  cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
   mf->AddDefinition("CTEST_CONFIGURATION_TYPE",
                     this->CTest->GetConfigType().c_str());
 
diff --git a/Source/CTest/cmCTestUpdateHandler.cxx b/Source/CTest/cmCTestUpdateHandler.cxx
index ac7eb05..8131c90 100644
--- a/Source/CTest/cmCTestUpdateHandler.cxx
+++ b/Source/CTest/cmCTestUpdateHandler.cxx
@@ -30,7 +30,7 @@
 #include "cmCTestSVN.h"
 #include "cmCTestVC.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 //#include <cmsys/RegularExpression.hxx>
 #include <cmsys/Process.h>
@@ -159,7 +159,7 @@ int cmCTestUpdateHandler::ProcessHandler()
                      , this->Quiet);
 
   // Create an object to interact with the VCS tool.
-  CM_AUTO_PTR<cmCTestVC> vc;
+  cmsys::auto_ptr<cmCTestVC> vc;
   switch (this->UpdateType) {
     case e_CVS:
       vc.reset(new cmCTestCVS(this->CTest, ofs));
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index 9950a84..3694f09 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -51,7 +51,7 @@
 #include <math.h>
 #include <stdlib.h>
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 #include <cm_zlib.h>
 #include <cmsys/Base64.h>
@@ -474,7 +474,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
   cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
-  CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
+  cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
   if (!this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(),
                                              mf.get())) {
     cmCTestOptionalLog(
@@ -1165,7 +1165,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
     }
     std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
 
-    CM_AUTO_PTR<cmSystemTools::SaveRestoreEnvironment> saveEnv;
+    cmsys::auto_ptr<cmSystemTools::SaveRestoreEnvironment> saveEnv;
     if (modifyEnv) {
       saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment);
       cmSystemTools::AppendEnv(*environment);
@@ -1193,7 +1193,7 @@ int cmCTest::RunTest(std::vector<const char*> argv, std::string* output,
     *output = "";
   }
 
-  CM_AUTO_PTR<cmSystemTools::SaveRestoreEnvironment> saveEnv;
+  cmsys::auto_ptr<cmSystemTools::SaveRestoreEnvironment> saveEnv;
   if (modifyEnv) {
     saveEnv.reset(new cmSystemTools::SaveRestoreEnvironment);
     cmSystemTools::AppendEnv(*environment);
diff --git a/Source/cmCryptoHash.cxx b/Source/cmCryptoHash.cxx
index 8d60c1f..e54b3c7 100644
--- a/Source/cmCryptoHash.cxx
+++ b/Source/cmCryptoHash.cxx
@@ -15,22 +15,22 @@
 #include <cmsys/FStream.hxx>
 #include <cmsys/MD5.h>
 
-CM_AUTO_PTR<cmCryptoHash> cmCryptoHash::New(const char* algo)
+cmsys::auto_ptr<cmCryptoHash> cmCryptoHash::New(const char* algo)
 {
   if (strcmp(algo, "MD5") == 0) {
-    return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashMD5);
+    return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashMD5);
   } else if (strcmp(algo, "SHA1") == 0) {
-    return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA1);
+    return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA1);
   } else if (strcmp(algo, "SHA224") == 0) {
-    return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA224);
+    return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA224);
   } else if (strcmp(algo, "SHA256") == 0) {
-    return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA256);
+    return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA256);
   } else if (strcmp(algo, "SHA384") == 0) {
-    return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA384);
+    return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA384);
   } else if (strcmp(algo, "SHA512") == 0) {
-    return CM_AUTO_PTR<cmCryptoHash>(new cmCryptoHashSHA512);
+    return cmsys::auto_ptr<cmCryptoHash>(new cmCryptoHashSHA512);
   } else {
-    return CM_AUTO_PTR<cmCryptoHash>(CM_NULLPTR);
+    return cmsys::auto_ptr<cmCryptoHash>(CM_NULLPTR);
   }
 }
 
diff --git a/Source/cmCryptoHash.h b/Source/cmCryptoHash.h
index 6aaaf93..85adf69 100644
--- a/Source/cmCryptoHash.h
+++ b/Source/cmCryptoHash.h
@@ -14,13 +14,13 @@
 
 #include "cmStandardIncludes.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 class cmCryptoHash
 {
 public:
   virtual ~cmCryptoHash() {}
-  static CM_AUTO_PTR<cmCryptoHash> New(const char* algo);
+  static cmsys::auto_ptr<cmCryptoHash> New(const char* algo);
   std::string HashString(const std::string& input);
   std::string HashFile(const std::string& file);
 
diff --git a/Source/cmCustomCommand.cxx b/Source/cmCustomCommand.cxx
index 7533369..2b9248d 100644
--- a/Source/cmCustomCommand.cxx
+++ b/Source/cmCustomCommand.cxx
@@ -13,7 +13,7 @@
 
 #include "cmMakefile.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 cmCustomCommand::cmCustomCommand()
   : Backtrace()
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index 6165bcf..315a1b6 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -66,7 +66,7 @@ std::string cmCustomCommandGenerator::GetCommand(unsigned int c) const
     }
   }
 
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(argv0);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = this->GE->Parse(argv0);
   std::string exe = cge->Evaluate(this->LG, this->Config);
 
   return exe;
@@ -145,7 +145,7 @@ std::vector<std::string> const& cmCustomCommandGenerator::GetDepends() const
     std::vector<std::string> depends = this->CC.GetDepends();
     for (std::vector<std::string>::const_iterator i = depends.begin();
          i != depends.end(); ++i) {
-      CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
       std::vector<std::string> result;
       cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config),
                                         result);
diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx
index 15755cb..59667cd 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -13,8 +13,8 @@
 
 #include "cmELF.h"
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/FStream.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 // Include the ELF format information system header.
 #if defined(__OpenBSD__)
@@ -107,7 +107,7 @@ public:
   };
 
   // Construct and take ownership of the file stream object.
-  cmELFInternal(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin,
+  cmELFInternal(cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin,
                 ByteOrderType order)
     : External(external)
     , Stream(*fin.release())
@@ -237,7 +237,7 @@ public:
   typedef typename Types::tagtype tagtype;
 
   // Construct with a stream and byte swap indicator.
-  cmELFInternalImpl(cmELF* external, CM_AUTO_PTR<cmsys::ifstream>& fin,
+  cmELFInternalImpl(cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin,
                     ByteOrderType order);
 
   // Return the number of sections as specified by the ELF header.
@@ -537,9 +537,8 @@ private:
 };
 
 template <class Types>
-cmELFInternalImpl<Types>::cmELFInternalImpl(cmELF* external,
-                                            CM_AUTO_PTR<cmsys::ifstream>& fin,
-                                            ByteOrderType order)
+cmELFInternalImpl<Types>::cmELFInternalImpl(
+  cmELF* external, cmsys::auto_ptr<cmsys::ifstream>& fin, ByteOrderType order)
   : cmELFInternal(external, fin, order)
 {
   // Read the main header.
@@ -756,7 +755,7 @@ cmELF::cmELF(const char* fname)
   : Internal(CM_NULLPTR)
 {
   // Try to open the file.
-  CM_AUTO_PTR<cmsys::ifstream> fin(new cmsys::ifstream(fname));
+  cmsys::auto_ptr<cmsys::ifstream> fin(new cmsys::ifstream(fname));
 
   // Quit now if the file could not be opened.
   if (!fin.get() || !*fin) {
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index d93e406..736c7da 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -25,8 +25,8 @@
 #include "cmVersion.h"
 
 #include <assert.h>
-#include <cm_auto_ptr.hxx>
 #include <cmsys/FStream.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 static std::string cmExportFileGeneratorEscape(std::string const& str)
 {
@@ -69,15 +69,15 @@ const char* cmExportFileGenerator::GetMainExportFileName() const
 bool cmExportFileGenerator::GenerateImportFile()
 {
   // Open the output file to generate it.
-  CM_AUTO_PTR<cmsys::ofstream> foutPtr;
+  cmsys::auto_ptr<cmsys::ofstream> foutPtr;
   if (this->AppendMode) {
     // Open for append.
-    CM_AUTO_PTR<cmsys::ofstream> ap(
+    cmsys::auto_ptr<cmsys::ofstream> ap(
       new cmsys::ofstream(this->MainImportFile.c_str(), std::ios::app));
     foutPtr = ap;
   } else {
     // Generate atomically and with copy-if-different.
-    CM_AUTO_PTR<cmGeneratedFileStream> ap(
+    cmsys::auto_ptr<cmGeneratedFileStream> ap(
       new cmGeneratedFileStream(this->MainImportFile.c_str(), true));
     ap->SetCopyIfDifferent(true);
     foutPtr = ap;
@@ -393,7 +393,7 @@ void cmExportFileGenerator::PopulateIncludeDirectoriesInterface(
   std::string dirs = cmGeneratorExpression::Preprocess(
     tei->InterfaceIncludeDirectories, preprocessRule, true);
   this->ReplaceInstallPrefix(dirs);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(dirs);
   std::string exportDirs =
     cge->Evaluate(target->GetLocalGenerator(), "", false, target);
 
diff --git a/Source/cmExportLibraryDependenciesCommand.cxx b/Source/cmExportLibraryDependenciesCommand.cxx
index c8272cb..ab43aa8 100644
--- a/Source/cmExportLibraryDependenciesCommand.cxx
+++ b/Source/cmExportLibraryDependenciesCommand.cxx
@@ -16,7 +16,7 @@
 #include "cmVersion.h"
 #include "cmake.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 bool cmExportLibraryDependenciesCommand::InitialPass(
   std::vector<std::string> const& args, cmExecutionStatus&)
@@ -53,13 +53,13 @@ void cmExportLibraryDependenciesCommand::FinalPass()
 void cmExportLibraryDependenciesCommand::ConstFinalPass() const
 {
   // Use copy-if-different if not appending.
-  CM_AUTO_PTR<cmsys::ofstream> foutPtr;
+  cmsys::auto_ptr<cmsys::ofstream> foutPtr;
   if (this->Append) {
-    CM_AUTO_PTR<cmsys::ofstream> ap(
+    cmsys::auto_ptr<cmsys::ofstream> ap(
       new cmsys::ofstream(this->Filename.c_str(), std::ios::app));
     foutPtr = ap;
   } else {
-    CM_AUTO_PTR<cmGeneratedFileStream> ap(
+    cmsys::auto_ptr<cmGeneratedFileStream> ap(
       new cmGeneratedFileStream(this->Filename.c_str(), true));
     ap->SetCopyIfDifferent(true);
     foutPtr = ap;
diff --git a/Source/cmExportTryCompileFileGenerator.cxx b/Source/cmExportTryCompileFileGenerator.cxx
index 2916e6b..fdc0760 100644
--- a/Source/cmExportTryCompileFileGenerator.cxx
+++ b/Source/cmExportTryCompileFileGenerator.cxx
@@ -66,7 +66,7 @@ std::string cmExportTryCompileFileGenerator::FindTargets(
   cmGeneratorExpressionDAGChecker dagChecker(tgt->GetName(), propName,
                                              CM_NULLPTR, CM_NULLPTR);
 
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
 
   cmTarget dummyHead;
   dummyHead.SetType(cmState::EXECUTABLE, "try_compile_dummy_exe");
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 5a1238b..4aecf7c 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -34,12 +34,12 @@
 // include sys/stat.h after sys/types.h
 #include <sys/stat.h>
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/Directory.hxx>
 #include <cmsys/Encoding.hxx>
 #include <cmsys/FStream.hxx>
 #include <cmsys/Glob.hxx>
 #include <cmsys/RegularExpression.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 // Table of permissions flags.
 #if defined(_WIN32) && !defined(__CYGWIN__)
@@ -330,7 +330,7 @@ bool cmFileCommand::HandleHashCommand(std::vector<std::string> const& args)
     return false;
   }
 
-  CM_AUTO_PTR<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
+  cmsys::auto_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
   if (hash.get()) {
     std::string out = hash->HashFile(args[1]);
     if (!out.empty()) {
@@ -2478,7 +2478,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
   const char* cainfo = this->Makefile->GetDefinition("CMAKE_TLS_CAINFO");
   std::string expectedHash;
   std::string hashMatchMSG;
-  CM_AUTO_PTR<cmCryptoHash> hash;
+  cmsys::auto_ptr<cmCryptoHash> hash;
   bool showProgress = false;
 
   while (i != args.end()) {
@@ -2534,7 +2534,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
         this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5.");
         return false;
       }
-      hash = CM_AUTO_PTR<cmCryptoHash>(cmCryptoHash::New("MD5"));
+      hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New("MD5"));
       hashMatchMSG = "MD5 sum";
       expectedHash = cmSystemTools::LowerCase(*i);
     } else if (*i == "SHOW_PROGRESS") {
@@ -2555,7 +2555,7 @@ bool cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
       }
       std::string algo = i->substr(0, pos);
       expectedHash = cmSystemTools::LowerCase(i->substr(pos + 1));
-      hash = CM_AUTO_PTR<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
+      hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
       if (!hash.get()) {
         std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
         err += algo;
@@ -2971,11 +2971,11 @@ void cmFileCommand::AddEvaluationFile(const std::string& inputName,
   cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
 
   cmGeneratorExpression outputGe(lfbt);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> outputCge =
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> outputCge =
     outputGe.Parse(outputExpr);
 
   cmGeneratorExpression conditionGe(lfbt);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> conditionCge =
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> conditionCge =
     conditionGe.Parse(condition);
 
   this->Makefile->AddEvaluationFile(inputName, outputCge, conditionCge,
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index d5fd75d..09fa795 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -1500,9 +1500,9 @@ void cmFindPackageCommand::StoreVersionFound()
   this->Makefile->AddDefinition(ver + "_COUNT", buf);
 }
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/Glob.hxx>
 #include <cmsys/String.h>
+#include <cmsys/auto_ptr.hxx>
 
 class cmFileList;
 class cmFileListGeneratorBase
@@ -1515,10 +1515,10 @@ protected:
 private:
   bool Search(cmFileList&);
   virtual bool Search(std::string const& parent, cmFileList&) = 0;
-  virtual CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const = 0;
+  virtual cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const = 0;
   friend class cmFileList;
   cmFileListGeneratorBase* SetNext(cmFileListGeneratorBase const& next);
-  CM_AUTO_PTR<cmFileListGeneratorBase> Next;
+  cmsys::auto_ptr<cmFileListGeneratorBase> Next;
 };
 
 class cmFileList
@@ -1551,7 +1551,7 @@ public:
 private:
   virtual bool Visit(std::string const& fullPath) = 0;
   friend class cmFileListGeneratorBase;
-  CM_AUTO_PTR<cmFileListGeneratorBase> First;
+  cmsys::auto_ptr<cmFileListGeneratorBase> First;
   cmFileListGeneratorBase* Last;
 };
 
@@ -1621,9 +1621,9 @@ private:
     std::string fullPath = parent + this->String;
     return this->Consider(fullPath, lister);
   }
-  CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
+  cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
   {
-    CM_AUTO_PTR<cmFileListGeneratorBase> g(
+    cmsys::auto_ptr<cmFileListGeneratorBase> g(
       new cmFileListGeneratorFixed(*this));
     return g;
   }
@@ -1655,9 +1655,9 @@ private:
     }
     return false;
   }
-  CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
+  cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
   {
-    CM_AUTO_PTR<cmFileListGeneratorBase> g(
+    cmsys::auto_ptr<cmFileListGeneratorBase> g(
       new cmFileListGeneratorEnumerate(*this));
     return g;
   }
@@ -1706,9 +1706,9 @@ private:
     }
     return false;
   }
-  CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
+  cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
   {
-    CM_AUTO_PTR<cmFileListGeneratorBase> g(
+    cmsys::auto_ptr<cmFileListGeneratorBase> g(
       new cmFileListGeneratorProject(*this));
     return g;
   }
@@ -1763,9 +1763,9 @@ private:
     }
     return false;
   }
-  CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
+  cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
   {
-    CM_AUTO_PTR<cmFileListGeneratorBase> g(
+    cmsys::auto_ptr<cmFileListGeneratorBase> g(
       new cmFileListGeneratorMacProject(*this));
     return g;
   }
@@ -1807,9 +1807,9 @@ private:
     }
     return false;
   }
-  CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
+  cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
   {
-    CM_AUTO_PTR<cmFileListGeneratorBase> g(
+    cmsys::auto_ptr<cmFileListGeneratorBase> g(
       new cmFileListGeneratorCaseInsensitive(*this));
     return g;
   }
@@ -1853,9 +1853,10 @@ private:
     }
     return false;
   }
-  CM_AUTO_PTR<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
+  cmsys::auto_ptr<cmFileListGeneratorBase> Clone() const CM_OVERRIDE
   {
-    CM_AUTO_PTR<cmFileListGeneratorBase> g(new cmFileListGeneratorGlob(*this));
+    cmsys::auto_ptr<cmFileListGeneratorBase> g(
+      new cmFileListGeneratorGlob(*this));
     return g;
   }
 };
diff --git a/Source/cmForEachCommand.cxx b/Source/cmForEachCommand.cxx
index c6e5f06..daf43e6 100644
--- a/Source/cmForEachCommand.cxx
+++ b/Source/cmForEachCommand.cxx
@@ -11,7 +11,7 @@
 ============================================================================*/
 #include "cmForEachCommand.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 cmForEachFunctionBlocker::cmForEachFunctionBlocker(cmMakefile* mf)
   : Makefile(mf)
@@ -36,7 +36,8 @@ bool cmForEachFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
     // if this is the endofreach for this statement
     if (!this->Depth) {
       // Remove the function blocker for this scope or bail.
-      CM_AUTO_PTR<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(this, lff));
+      cmsys::auto_ptr<cmFunctionBlocker> fb(
+        mf.RemoveFunctionBlocker(this, lff));
       if (!fb.get()) {
         return false;
       }
@@ -183,7 +184,7 @@ bool cmForEachCommand::InitialPass(std::vector<std::string> const& args,
 
 bool cmForEachCommand::HandleInMode(std::vector<std::string> const& args)
 {
-  CM_AUTO_PTR<cmForEachFunctionBlocker> f(
+  cmsys::auto_ptr<cmForEachFunctionBlocker> f(
     new cmForEachFunctionBlocker(this->Makefile));
   f->Args.push_back(args[0]);
 
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 983bfb4..53243b8 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -26,14 +26,14 @@ cmGeneratorExpression::cmGeneratorExpression(
 {
 }
 
-CM_AUTO_PTR<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
+cmsys::auto_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
   std::string const& input)
 {
-  return CM_AUTO_PTR<cmCompiledGeneratorExpression>(
+  return cmsys::auto_ptr<cmCompiledGeneratorExpression>(
     new cmCompiledGeneratorExpression(this->Backtrace, input));
 }
 
-CM_AUTO_PTR<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
+cmsys::auto_ptr<cmCompiledGeneratorExpression> cmGeneratorExpression::Parse(
   const char* input)
 {
   return this->Parse(std::string(input ? input : ""));
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 2f91608..5d02427 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -17,8 +17,8 @@
 
 #include "cmListFileCache.h"
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/RegularExpression.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 class cmGeneratorTarget;
 class cmLocalGenerator;
@@ -47,8 +47,9 @@ public:
     cmListFileBacktrace const& backtrace = cmListFileBacktrace());
   ~cmGeneratorExpression();
 
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> Parse(std::string const& input);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> Parse(const char* input);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(
+    std::string const& input);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> Parse(const char* input);
 
   enum PreprocessContext
   {
diff --git a/Source/cmGeneratorExpressionEvaluationFile.cxx b/Source/cmGeneratorExpressionEvaluationFile.cxx
index c01c4fc..f9dbc2d 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.cxx
+++ b/Source/cmGeneratorExpressionEvaluationFile.cxx
@@ -23,8 +23,9 @@
 
 cmGeneratorExpressionEvaluationFile::cmGeneratorExpressionEvaluationFile(
   const std::string& input,
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr,
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent)
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
+  bool inputIsContent)
   : Input(input)
   , OutputFileExpr(outputFileExpr)
   , Condition(condition)
@@ -134,7 +135,7 @@ void cmGeneratorExpressionEvaluationFile::Generate(cmLocalGenerator* lg)
 
   cmListFileBacktrace lfbt = this->OutputFileExpr->GetBacktrace();
   cmGeneratorExpression contentGE(lfbt);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> inputExpression =
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> inputExpression =
     contentGE.Parse(inputContent);
 
   std::map<std::string, std::string> outputFiles;
diff --git a/Source/cmGeneratorExpressionEvaluationFile.h b/Source/cmGeneratorExpressionEvaluationFile.h
index 52ba2d8..bfd6add 100644
--- a/Source/cmGeneratorExpressionEvaluationFile.h
+++ b/Source/cmGeneratorExpressionEvaluationFile.h
@@ -14,7 +14,7 @@
 
 #include "cmGeneratorExpression.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 #include <sys/types.h>
 
 class cmLocalGenerator;
@@ -24,8 +24,9 @@ class cmGeneratorExpressionEvaluationFile
 public:
   cmGeneratorExpressionEvaluationFile(
     const std::string& input,
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> outputFileExpr,
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> outputFileExpr,
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
+    bool inputIsContent);
 
   void Generate(cmLocalGenerator* lg);
 
@@ -41,8 +42,8 @@ private:
 
 private:
   const std::string Input;
-  const CM_AUTO_PTR<cmCompiledGeneratorExpression> OutputFileExpr;
-  const CM_AUTO_PTR<cmCompiledGeneratorExpression> Condition;
+  const cmsys::auto_ptr<cmCompiledGeneratorExpression> OutputFileExpr;
+  const cmsys::auto_ptr<cmCompiledGeneratorExpression> Condition;
   std::vector<std::string> Files;
   const bool InputIsContent;
 };
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index ca7250b..830979f 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -24,7 +24,7 @@ std::string cmGeneratorExpressionNode::EvaluateDependentExpression(
   cmGeneratorExpressionDAGChecker* dagChecker)
 {
   cmGeneratorExpression ge(context->Backtrace);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(prop);
   cge->SetEvaluateForBuildsystem(context->EvaluateForBuildsystem);
   std::string result =
     cge->Evaluate(lg, context->Config, context->Quiet, headTarget,
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index c9cbd00..c7dd3e4 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -42,13 +42,13 @@ class cmGeneratorTarget::TargetPropertyEntry
   static cmLinkImplItem NoLinkImplItem;
 
 public:
-  TargetPropertyEntry(CM_AUTO_PTR<cmCompiledGeneratorExpression> cge,
+  TargetPropertyEntry(cmsys::auto_ptr<cmCompiledGeneratorExpression> cge,
                       cmLinkImplItem const& item = NoLinkImplItem)
     : ge(cge)
     , LinkImplItem(item)
   {
   }
-  const CM_AUTO_PTR<cmCompiledGeneratorExpression> ge;
+  const cmsys::auto_ptr<cmCompiledGeneratorExpression> ge;
   cmLinkImplItem const& LinkImplItem;
 };
 cmLinkImplItem cmGeneratorTarget::TargetPropertyEntry::NoLinkImplItem;
@@ -253,7 +253,7 @@ void CreatePropertyGeneratorExpressions(
   for (std::vector<std::string>::const_iterator it = entries.begin();
        it != entries.end(); ++it, ++btIt) {
     cmGeneratorExpression ge(*btIt);
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*it);
     cge->SetEvaluateForBuildsystem(evaluateForBuildsystem);
     items.push_back(new cmGeneratorTarget::TargetPropertyEntry(cge));
   }
@@ -443,7 +443,7 @@ std::string cmGeneratorTarget::GetOutputName(const std::string& config,
 
     // Now evaluate genex and update the previously-prepared map entry.
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outName);
     i->second = cge->Evaluate(this->LocalGenerator, config);
   } else if (i->second.empty()) {
     // An empty map entry indicates we have been called recursively
@@ -461,7 +461,7 @@ void cmGeneratorTarget::AddSource(const std::string& src)
   this->Target->AddSource(src);
   cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
   cmGeneratorExpression ge(lfbt);
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(src);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(src);
   cge->SetEvaluateForBuildsystem(true);
   this->SourceEntries.push_back(new TargetPropertyEntry(cge));
   this->SourceFilesMap.clear();
@@ -477,7 +477,7 @@ void cmGeneratorTarget::AddTracedSources(std::vector<std::string> const& srcs)
     this->LinkImplementationLanguageIsContextDependent = true;
     cmListFileBacktrace lfbt = this->Makefile->GetBacktrace();
     cmGeneratorExpression ge(lfbt);
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(srcFiles);
     cge->SetEvaluateForBuildsystem(true);
     this->SourceEntries.push_back(
       new cmGeneratorTarget::TargetPropertyEntry(cge));
@@ -862,7 +862,7 @@ static void AddInterfaceEntries(
       if (it->Target) {
         std::string genex = "$<TARGET_PROPERTY:" + *it + "," + prop + ">";
         cmGeneratorExpression ge(it->Backtrace);
-        CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(genex);
         cge->SetEvaluateForBuildsystem(true);
         entries.push_back(
           new cmGeneratorTarget::TargetPropertyEntry(cge, *it));
@@ -2119,7 +2119,8 @@ void cmTargetTraceDependencies::CheckCustomCommand(cmCustomCommand const& cc)
     // Check for target references in generator expressions.
     for (cmCustomCommandLine::const_iterator cli = cit->begin();
          cli != cit->end(); ++cli) {
-      const CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(*cli);
+      const cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+        ge.Parse(*cli);
       cge->Evaluate(this->GeneratorTarget->GetLocalGenerator(), "", true);
       std::set<cmGeneratorTarget*> geTargets = cge->GetTargets();
       targets.insert(geTargets.begin(), geTargets.end());
@@ -2404,7 +2405,7 @@ std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
       libDir = frameworkCheck.match(1);
 
       cmGeneratorExpression ge;
-      CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
         ge.Parse(libDir.c_str());
       linkInterfaceIncludeDirectoriesEntries.push_back(
         new cmGeneratorTarget::TargetPropertyEntry(cge));
@@ -2628,7 +2629,7 @@ void cmGeneratorTarget::GetCompileDefinitions(
         }
         case cmPolicies::OLD: {
           cmGeneratorExpression ge;
-          CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+          cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
             ge.Parse(configProp);
           linkInterfaceCompileDefinitionsEntries.push_back(
             new cmGeneratorTarget::TargetPropertyEntry(cge));
@@ -3980,7 +3981,7 @@ void cmGeneratorTarget::ExpandLinkItems(
     dagChecker.SetTransitivePropertiesOnly();
   }
   std::vector<std::string> libs;
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(value);
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(value);
   cmSystemTools::ExpandListArgument(cge->Evaluate(this->LocalGenerator, config,
                                                   false, headTarget, this,
                                                   &dagChecker),
@@ -4245,7 +4246,8 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
   if (const char* config_outdir = this->GetProperty(configProp)) {
     // Use the user-specified per-configuration output directory.
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(config_outdir);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+      ge.Parse(config_outdir);
     out = cge->Evaluate(this->LocalGenerator, config);
 
     // Skip per-configuration subdirectory.
@@ -4253,7 +4255,7 @@ bool cmGeneratorTarget::ComputeOutputDir(const std::string& config,
   } else if (const char* outdir = this->GetProperty(propertyName)) {
     // Use the user-specified output directory.
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(outdir);
     out = cge->Evaluate(this->LocalGenerator, config);
 
     // Skip per-configuration subdirectory if the value contained a
@@ -4988,7 +4990,7 @@ void cmGeneratorTarget::ComputeLinkImplementationLibraries(
     cmGeneratorExpressionDAGChecker dagChecker(
       this->GetName(), "LINK_LIBRARIES", CM_NULLPTR, CM_NULLPTR);
     cmGeneratorExpression ge(*btIt);
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> const cge = ge.Parse(*le);
     std::string const evaluated =
       cge->Evaluate(this->LocalGenerator, config, false, head, &dagChecker);
     cmSystemTools::ExpandListArgument(evaluated, llibs);
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index 262909f..a33bd8b 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -674,7 +674,7 @@ std::set<std::string> cmGlobalVisualStudio7Generator::IsPartOfDefaultBuild(
           target->Target->GetMakefile()->GetDefinition(
             "CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD");
         cmGeneratorExpression ge;
-        CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+        cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
           ge.Parse(propertyValue);
         if (cmSystemTools::IsOn(
               cge->Evaluate(target->GetLocalGenerator(), *i))) {
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index e65ca09..e82cb16 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -24,7 +24,7 @@
 #include "cmXCodeObject.h"
 #include "cmake.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #include "cmXMLParser.h"
@@ -175,7 +175,7 @@ cmGlobalGenerator* cmGlobalXCodeGenerator::Factory::CreateGlobalGenerator(
     parser.ParseFile(
       "/Developer/Applications/Xcode.app/Contents/version.plist");
   }
-  CM_AUTO_PTR<cmGlobalXCodeGenerator> gg(
+  cmsys::auto_ptr<cmGlobalXCodeGenerator> gg(
     new cmGlobalXCodeGenerator(cm, parser.Version));
   if (gg->XcodeVersion == 20) {
     cmSystemTools::Message("Xcode 2.0 not really supported by cmake, "
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index adb9936..ed35ecd 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -64,8 +64,9 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
   cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator ggi(&cm);
-  CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&ggi, cm.GetCurrentSnapshot()));
-  CM_AUTO_PTR<cmLocalGenerator> lg(ggi.CreateLocalGenerator(mf.get()));
+  cmsys::auto_ptr<cmMakefile> mf(
+    new cmMakefile(&ggi, cm.GetCurrentSnapshot()));
+  cmsys::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator(mf.get()));
 
   const char* inFileName = settingsFileName;
 
diff --git a/Source/cmIfCommand.cxx b/Source/cmIfCommand.cxx
index dd04136..cb5ba76 100644
--- a/Source/cmIfCommand.cxx
+++ b/Source/cmIfCommand.cxx
@@ -46,7 +46,8 @@ bool cmIfFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
     // if this is the endif for this if statement, then start executing
     if (!this->ScopeDepth) {
       // Remove the function blocker for this scope or bail.
-      CM_AUTO_PTR<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(this, lff));
+      cmsys::auto_ptr<cmFunctionBlocker> fb(
+        mf.RemoveFunctionBlocker(this, lff));
       if (!fb.get()) {
         return false;
       }
diff --git a/Source/cmInstallDirectoryGenerator.cxx b/Source/cmInstallDirectoryGenerator.cxx
index 3928231..a637b25 100644
--- a/Source/cmInstallDirectoryGenerator.cxx
+++ b/Source/cmInstallDirectoryGenerator.cxx
@@ -69,7 +69,7 @@ void cmInstallDirectoryGenerator::GenerateScriptForConfig(
   cmGeneratorExpression ge;
   for (std::vector<std::string>::const_iterator i = this->Directories.begin();
        i != this->Directories.end(); ++i) {
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
     cmSystemTools::ExpandListArgument(
       cge->Evaluate(this->LocalGenerator, config), dirs);
   }
diff --git a/Source/cmInstallFilesGenerator.cxx b/Source/cmInstallFilesGenerator.cxx
index 93a740c..8885ef2 100644
--- a/Source/cmInstallFilesGenerator.cxx
+++ b/Source/cmInstallFilesGenerator.cxx
@@ -90,7 +90,7 @@ void cmInstallFilesGenerator::GenerateScriptForConfig(
   cmGeneratorExpression ge;
   for (std::vector<std::string>::const_iterator i = this->Files.begin();
        i != this->Files.end(); ++i) {
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge = ge.Parse(*i);
     cmSystemTools::ExpandListArgument(
       cge->Evaluate(this->LocalGenerator, config), files);
   }
diff --git a/Source/cmInstalledFile.h b/Source/cmInstalledFile.h
index 00ff611..d000891 100644
--- a/Source/cmInstalledFile.h
+++ b/Source/cmInstalledFile.h
@@ -22,7 +22,7 @@
 class cmInstalledFile
 {
 public:
-  typedef CM_AUTO_PTR<cmCompiledGeneratorExpression>
+  typedef cmsys::auto_ptr<cmCompiledGeneratorExpression>
     CompiledGeneratorExpressionPtrType;
 
   typedef std::vector<cmCompiledGeneratorExpression*> ExpressionVectorType;
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 7597077..c6cfa88 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -30,8 +30,8 @@
 #include "cmDependsJava.h"
 #endif
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/Terminal.h>
+#include <cmsys/auto_ptr.hxx>
 
 #include <algorithm>
 #include <queue>
@@ -121,7 +121,7 @@ void cmLocalUnixMakefileGenerator3::Generate()
     if ((*t)->GetType() == cmState::INTERFACE_LIBRARY) {
       continue;
     }
-    CM_AUTO_PTR<cmMakefileTargetGenerator> tg(
+    cmsys::auto_ptr<cmMakefileTargetGenerator> tg(
       cmMakefileTargetGenerator::New(*t));
     if (tg.get()) {
       tg->WriteRuleFiles();
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index c38e99c..2f6bf07 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1850,7 +1850,7 @@ void cmLocalVisualStudio7Generator::OutputTargetRules(
   if (!addedPrelink) {
     event.Write(target->GetPreLinkCommands());
   }
-  CM_AUTO_PTR<cmCustomCommand> pcc(
+  cmsys::auto_ptr<cmCustomCommand> pcc(
     this->MaybeCreateImplibDir(target, configName, this->FortranProject));
   if (pcc.get()) {
     event.Write(*pcc);
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index bdb1c2b..85ab615 100644
--- a/Source/cmLocalVisualStudioGenerator.cxx
+++ b/Source/cmLocalVisualStudioGenerator.cxx
@@ -74,12 +74,12 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames(
   }
 }
 
-CM_AUTO_PTR<cmCustomCommand>
+cmsys::auto_ptr<cmCustomCommand>
 cmLocalVisualStudioGenerator::MaybeCreateImplibDir(cmGeneratorTarget* target,
                                                    const std::string& config,
                                                    bool isFortran)
 {
-  CM_AUTO_PTR<cmCustomCommand> pcc;
+  cmsys::auto_ptr<cmCustomCommand> pcc;
 
   // If an executable exports symbols then VS wants to create an
   // import library but forgets to create the output directory.
diff --git a/Source/cmLocalVisualStudioGenerator.h b/Source/cmLocalVisualStudioGenerator.h
index 87acda2..c24d813 100644
--- a/Source/cmLocalVisualStudioGenerator.h
+++ b/Source/cmLocalVisualStudioGenerator.h
@@ -16,7 +16,7 @@
 
 #include "cmGlobalVisualStudioGenerator.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 class cmSourceFile;
 class cmSourceGroup;
@@ -59,9 +59,8 @@ protected:
   virtual bool CustomCommandUseLocal() const { return false; }
 
   /** Construct a custom command to make exe import lib dir.  */
-  CM_AUTO_PTR<cmCustomCommand> MaybeCreateImplibDir(cmGeneratorTarget* target,
-                                                    const std::string& config,
-                                                    bool isFortran);
+  cmsys::auto_ptr<cmCustomCommand> MaybeCreateImplibDir(
+    cmGeneratorTarget* target, const std::string& config, bool isFortran);
 };
 
 #endif
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 0d550dd..eae4258 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -35,10 +35,10 @@
 #include "cmake.h"
 #include <stdlib.h> // required for atoi
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/FStream.hxx>
 #include <cmsys/RegularExpression.hxx>
 #include <cmsys/SystemTools.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 #include <assert.h>
 #include <ctype.h> // for isspace
@@ -262,7 +262,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff,
   // Lookup the command prototype.
   if (cmCommand* proto = this->GetState()->GetCommand(name)) {
     // Clone the prototype.
-    CM_AUTO_PTR<cmCommand> pcmd(proto->Clone());
+    cmsys::auto_ptr<cmCommand> pcmd(proto->Clone());
     pcmd->SetMakefile(this);
 
     // Decide whether to invoke the command.
@@ -589,8 +589,9 @@ void cmMakefile::EnforceDirectoryLevelRules() const
 
 void cmMakefile::AddEvaluationFile(
   const std::string& inputFile,
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> outputName,
-  CM_AUTO_PTR<cmCompiledGeneratorExpression> condition, bool inputIsContent)
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> outputName,
+  cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
+  bool inputIsContent)
 {
   this->EvaluationFiles.push_back(new cmGeneratorExpressionEvaluationFile(
     inputFile, outputName, condition, inputIsContent));
@@ -2889,7 +2890,7 @@ void cmMakefile::PopFunctionBlockerBarrier(bool reportError)
   FunctionBlockersType::size_type barrier =
     this->FunctionBlockerBarriers.back();
   while (this->FunctionBlockers.size() > barrier) {
-    CM_AUTO_PTR<cmFunctionBlocker> fb(this->FunctionBlockers.back());
+    cmsys::auto_ptr<cmFunctionBlocker> fb(this->FunctionBlockers.back());
     this->FunctionBlockers.pop_back();
     if (reportError) {
       // Report the context in which the unclosed block was opened.
@@ -3026,7 +3027,7 @@ void cmMakefile::AddFunctionBlocker(cmFunctionBlocker* fb)
   this->FunctionBlockers.push_back(fb);
 }
 
-CM_AUTO_PTR<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
+cmsys::auto_ptr<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
   cmFunctionBlocker* fb, const cmListFileFunction& lff)
 {
   // Find the function blocker stack barrier for the current scope.
@@ -3059,11 +3060,11 @@ CM_AUTO_PTR<cmFunctionBlocker> cmMakefile::RemoveFunctionBlocker(
       }
       cmFunctionBlocker* b = *pos;
       this->FunctionBlockers.erase(pos);
-      return CM_AUTO_PTR<cmFunctionBlocker>(b);
+      return cmsys::auto_ptr<cmFunctionBlocker>(b);
     }
   }
 
-  return CM_AUTO_PTR<cmFunctionBlocker>();
+  return cmsys::auto_ptr<cmFunctionBlocker>();
 }
 
 const char* cmMakefile::GetHomeDirectory() const
@@ -3691,7 +3692,7 @@ cmTarget* cmMakefile::AddImportedTarget(const std::string& name,
                                         cmState::TargetType type, bool global)
 {
   // Create the target.
-  CM_AUTO_PTR<cmTarget> target(new cmTarget);
+  cmsys::auto_ptr<cmTarget> target(new cmTarget);
   target->SetType(type, name);
   target->MarkAsImported(global);
   target->SetMakefile(this);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index d07b4e1..642b691 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -28,8 +28,8 @@
 #include "cmSourceGroup.h"
 #endif
 
-#include <cm_auto_ptr.hxx>
 #include <cmsys/RegularExpression.hxx>
+#include <cmsys/auto_ptr.hxx>
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #ifdef CMake_HAVE_CXX_UNORDERED_MAP
 #include <unordered_map>
@@ -97,7 +97,7 @@ public:
    * Remove the function blocker whose scope ends with the given command.
    * This returns ownership of the function blocker object.
    */
-  CM_AUTO_PTR<cmFunctionBlocker> RemoveFunctionBlocker(
+  cmsys::auto_ptr<cmFunctionBlocker> RemoveFunctionBlocker(
     cmFunctionBlocker* fb, const cmListFileFunction& lff);
 
   /**
@@ -771,10 +771,11 @@ public:
 
   void EnforceDirectoryLevelRules() const;
 
-  void AddEvaluationFile(const std::string& inputFile,
-                         CM_AUTO_PTR<cmCompiledGeneratorExpression> outputName,
-                         CM_AUTO_PTR<cmCompiledGeneratorExpression> condition,
-                         bool inputIsContent);
+  void AddEvaluationFile(
+    const std::string& inputFile,
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> outputName,
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> condition,
+    bool inputIsContent);
   std::vector<cmGeneratorExpressionEvaluationFile*> GetEvaluationFiles() const;
 
   std::vector<cmExportBuildFileGenerator*> GetExportBuildFileGenerators()
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 2f9c4da..e922fbd 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -134,7 +134,7 @@ void cmMakefileTargetGenerator::WriteTargetBuildRules()
   if (const char* additional_clean_files =
         this->Makefile->GetProperty("ADDITIONAL_MAKE_CLEAN_FILES")) {
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
       ge.Parse(additional_clean_files);
 
     cmSystemTools::ExpandListArgument(
diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx
index 4b40c08..7ada431 100644
--- a/Source/cmQtAutoGenerators.cxx
+++ b/Source/cmQtAutoGenerators.cxx
@@ -155,7 +155,7 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
   snapshot.GetDirectory().SetCurrentBinary(targetDirectory);
   snapshot.GetDirectory().SetCurrentSource(targetDirectory);
 
-  CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, snapshot));
+  cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, snapshot));
   gg.SetCurrentMakefile(mf.get());
 
   this->ReadAutogenInfoFile(mf.get(), targetDirectory, config);
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index dce4687..a348aef 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -89,7 +89,7 @@ bool cmStringCommand::HandleHashCommand(std::vector<std::string> const& args)
     return false;
   }
 
-  CM_AUTO_PTR<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
+  cmsys::auto_ptr<cmCryptoHash> hash(cmCryptoHash::New(args[0].c_str()));
   if (hash.get()) {
     std::string out = hash->HashString(args[2]);
     this->Makefile->AddDefinition(args[1], out.c_str());
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 209a729..5829d4f 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -19,7 +19,7 @@
 #include "cmPolicies.h"
 #include "cmPropertyMap.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 #if defined(CMAKE_BUILD_WITH_CMAKE)
 #ifdef CMake_HAVE_CXX_UNORDERED_MAP
 #include <unordered_map>
diff --git a/Source/cmVariableWatch.cxx b/Source/cmVariableWatch.cxx
index 56e2770..11eaa93 100644
--- a/Source/cmVariableWatch.cxx
+++ b/Source/cmVariableWatch.cxx
@@ -13,7 +13,7 @@
 
 #include "cmAlgorithms.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 static const char* const cmVariableWatchAccessStrings[] = {
   "READ_ACCESS",     "UNKNOWN_READ_ACCESS", "UNKNOWN_DEFINED_ACCESS",
@@ -48,7 +48,7 @@ bool cmVariableWatch::AddWatch(const std::string& variable, WatchMethod method,
                                void* client_data /*=0*/,
                                DeleteData delete_data /*=0*/)
 {
-  CM_AUTO_PTR<cmVariableWatch::Pair> p(new cmVariableWatch::Pair);
+  cmsys::auto_ptr<cmVariableWatch::Pair> p(new cmVariableWatch::Pair);
   p->Method = method;
   p->ClientData = client_data;
   p->DeleteDataCall = delete_data;
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 13e7c89..635fad2 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -42,7 +42,7 @@
 #include "cmVisualStudioGeneratorOptions.h"
 #include "windows.h"
 
-#include <cm_auto_ptr.hxx>
+#include <cmsys/auto_ptr.hxx>
 
 cmIDEFlagTable const* cmVisualStudio10TargetGenerator::GetClFlagTable() const
 {
@@ -1229,7 +1229,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
 
     if (!deployContent.empty()) {
       cmGeneratorExpression ge;
-      CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = ge.Parse(deployContent);
+      cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
+        ge.Parse(deployContent);
       // Deployment location cannot be set on a configuration basis
       if (!deployLocation.empty()) {
         this->WriteString("<Link>", 3);
@@ -1683,7 +1684,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
   // copied from cmLocalVisualStudio7Generator.cxx 805
   // TODO: Integrate code below with cmLocalVisualStudio7Generator.
 
-  CM_AUTO_PTR<Options> pOptions(new Options(
+  cmsys::auto_ptr<Options> pOptions(new Options(
     this->LocalGenerator, Options::Compiler, this->GetClFlagTable()));
   Options& clOptions = *pOptions;
 
@@ -1847,7 +1848,7 @@ bool cmVisualStudio10TargetGenerator::ComputeRcOptions()
 bool cmVisualStudio10TargetGenerator::ComputeRcOptions(
   std::string const& configName)
 {
-  CM_AUTO_PTR<Options> pOptions(new Options(
+  cmsys::auto_ptr<Options> pOptions(new Options(
     this->LocalGenerator, Options::ResourceCompiler, this->GetRcFlagTable()));
   Options& rcOptions = *pOptions;
 
@@ -1904,7 +1905,7 @@ bool cmVisualStudio10TargetGenerator::ComputeMasmOptions()
 bool cmVisualStudio10TargetGenerator::ComputeMasmOptions(
   std::string const& configName)
 {
-  CM_AUTO_PTR<Options> pOptions(new Options(
+  cmsys::auto_ptr<Options> pOptions(new Options(
     this->LocalGenerator, Options::MasmCompiler, this->GetMasmFlagTable()));
   Options& masmOptions = *pOptions;
 
@@ -2057,7 +2058,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
   if (const char* nativeLibDirectoriesExpression =
         this->GeneratorTarget->GetProperty("ANDROID_NATIVE_LIB_DIRECTORIES")) {
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
       ge.Parse(nativeLibDirectoriesExpression);
     std::string nativeLibDirs =
       cge->Evaluate(this->LocalGenerator, configName);
@@ -2070,7 +2071,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
         this->GeneratorTarget->GetProperty(
           "ANDROID_NATIVE_LIB_DEPENDENCIES")) {
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
       ge.Parse(nativeLibDependenciesExpression);
     std::string nativeLibDeps =
       cge->Evaluate(this->LocalGenerator, configName);
@@ -2089,7 +2090,7 @@ void cmVisualStudio10TargetGenerator::WriteAntBuildOptions(
   if (const char* jarDirectoriesExpression =
         this->GeneratorTarget->GetProperty("ANDROID_JAR_DIRECTORIES")) {
     cmGeneratorExpression ge;
-    CM_AUTO_PTR<cmCompiledGeneratorExpression> cge =
+    cmsys::auto_ptr<cmCompiledGeneratorExpression> cge =
       ge.Parse(jarDirectoriesExpression);
     std::string jarDirectories =
       cge->Evaluate(this->LocalGenerator, configName);
@@ -2149,7 +2150,7 @@ bool cmVisualStudio10TargetGenerator::ComputeLinkOptions()
 bool cmVisualStudio10TargetGenerator::ComputeLinkOptions(
   std::string const& config)
 {
-  CM_AUTO_PTR<Options> pOptions(new Options(
+  cmsys::auto_ptr<Options> pOptions(new Options(
     this->LocalGenerator, Options::Linker, this->GetLinkFlagTable(), 0, this));
   Options& linkOptions = *pOptions;
 
diff --git a/Source/cmWhileCommand.cxx b/Source/cmWhileCommand.cxx
index 93a6271..bec2861 100644
--- a/Source/cmWhileCommand.cxx
+++ b/Source/cmWhileCommand.cxx
@@ -37,7 +37,8 @@ bool cmWhileFunctionBlocker::IsFunctionBlocked(const cmListFileFunction& lff,
     // if this is the endwhile for this while loop then execute
     if (!this->Depth) {
       // Remove the function blocker for this scope or bail.
-      CM_AUTO_PTR<cmFunctionBlocker> fb(mf.RemoveFunctionBlocker(this, lff));
+      cmsys::auto_ptr<cmFunctionBlocker> fb(
+        mf.RemoveFunctionBlocker(this, lff));
       if (!fb.get()) {
         return false;
       }
diff --git a/Source/cm_auto_ptr.hxx b/Source/cm_auto_ptr.hxx
deleted file mode 100644
index 86ac327..0000000
--- a/Source/cm_auto_ptr.hxx
+++ /dev/null
@@ -1,184 +0,0 @@
-/*============================================================================
-  CMake - Cross Platform Makefile Generator
-  Copyright 2000-2016 Kitware, Inc.
-
-  Distributed under the OSI-approved BSD License (the "License");
-  see accompanying file Copyright.txt for details.
-
-  This software is distributed WITHOUT ANY WARRANTY; without even the
-  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-  See the License for more information.
-============================================================================*/
-#ifndef CM_AUTO_PTR_HXX
-#define CM_AUTO_PTR_HXX
-
-#include <cmsys/Configure.hxx>
-
-#if __cplusplus < 201103L
-#include <memory>
-#define CM_AUTO_PTR std::auto_ptr
-#else
-#define CM_AUTO_PTR cm::auto_ptr
-
-// In C++11, clang will warn about using dynamic exception specifications
-// as they are deprecated.  But as this class is trying to faithfully
-// mimic std::auto_ptr, we want to keep the 'throw()' decorations below.
-// So we suppress the warning.
-#if defined(__clang__) && defined(__has_warning)
-#if __has_warning("-Wdeprecated")
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated"
-#endif
-#endif
-
-namespace cm {
-
-/** C++98 Standard Section 20.4.5 - Template class auto_ptr.  */
-template <class X>
-class auto_ptr
-{
-  template <class Y>
-  struct auto_ptr_ref
-  {
-    Y* p_;
-
-    explicit auto_ptr_ref(Y* p)
-      : p_(p)
-    {
-    }
-  };
-
-  /** The pointer to the object held.  */
-  X* x_;
-
-public:
-  /** The type of object held by the auto_ptr.  */
-  typedef X element_type;
-
-  /** Construct from an auto_ptr holding a compatible object.  This
-      transfers ownership to the newly constructed auto_ptr.  */
-  template <class Y>
-  auto_ptr(auto_ptr<Y>& a) throw()
-    : x_(a.release())
-  {
-  }
-
-  /** Assign from an auto_ptr holding a compatible object.  This
-      transfers ownership to the left-hand-side of the assignment.  */
-  template <class Y>
-  auto_ptr& operator=(auto_ptr<Y>& a) throw()
-  {
-    this->reset(a.release());
-    return *this;
-  }
-
-  /**
-   * Explicitly construct from a raw pointer.  This is typically
-   * called with the result of operator new.  For example:
-   *
-   *   auto_ptr<X> ptr(new X());
-   */
-  explicit auto_ptr(X* p = 0) throw()
-    : x_(p)
-  {
-  }
-
-  /** Construct from another auto_ptr holding an object of the same
-      type.  This transfers ownership to the newly constructed
-      auto_ptr.  */
-  auto_ptr(auto_ptr& a) throw()
-    : x_(a.release())
-  {
-  }
-
-  /** Assign from another auto_ptr holding an object of the same type.
-      This transfers ownership to the newly constructed auto_ptr.  */
-  auto_ptr& operator=(auto_ptr& a) throw()
-  {
-    this->reset(a.release());
-    return *this;
-  }
-
-  /** Destruct and delete the object held.  */
-  ~auto_ptr() throw()
-  {
-    // Assume object destructor is nothrow.
-    delete this->x_;
-  }
-
-  /** Dereference and return a reference to the object held.  */
-  X& operator*() const throw() { return *this->x_; }
-
-  /** Return a pointer to the object held.  */
-  X* operator->() const throw() { return this->x_; }
-
-  /** Return a pointer to the object held.  */
-  X* get() const throw() { return this->x_; }
-
-  /** Return a pointer to the object held and reset to hold no object.
-      This transfers ownership to the caller.  */
-  X* release() throw()
-  {
-    X* x = this->x_;
-    this->x_ = 0;
-    return x;
-  }
-
-  /** Assume ownership of the given object.  The object previously
-      held is deleted.  */
-  void reset(X* p = 0) throw()
-  {
-    if (this->x_ != p) {
-      // Assume object destructor is nothrow.
-      delete this->x_;
-      this->x_ = p;
-    }
-  }
-
-  /** Convert to an auto_ptr holding an object of a compatible type.
-      This transfers ownership to the returned auto_ptr.  */
-  template <class Y>
-  operator auto_ptr<Y>() throw()
-  {
-    return auto_ptr<Y>(this->release());
-  }
-
-  /** Construct from an auto_ptr_ref.  This is used when the
-      constructor argument is a call to a function returning an
-      auto_ptr.  */
-  auto_ptr(auto_ptr_ref<X> r) throw()
-    : x_(r.p_)
-  {
-  }
-
-  /** Assign from an auto_ptr_ref.  This is used when a function
-      returning an auto_ptr is passed on the right-hand-side of an
-      assignment.  */
-  auto_ptr& operator=(auto_ptr_ref<X> r) throw()
-  {
-    this->reset(r.p_);
-    return *this;
-  }
-
-  /** Convert to an auto_ptr_ref.  This is used when a function
-      returning an auto_ptr is the argument to the constructor of
-      another auto_ptr.  */
-  template <class Y>
-  operator auto_ptr_ref<Y>() throw()
-  {
-    return auto_ptr_ref<Y>(this->release());
-  }
-};
-
-} // namespace cm
-
-// Undo warning suppression.
-#if defined(__clang__) && defined(__has_warning)
-#if __has_warning("-Wdeprecated")
-#pragma clang diagnostic pop
-#endif
-#endif
-
-#endif
-
-#endif
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index c597605..79e7c2b 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -397,7 +397,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
     snapshot.GetDirectory().SetCurrentSource(
       cmSystemTools::GetCurrentWorkingDirectory());
     snapshot.SetDefaultDefinitions();
-    CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(gg, snapshot));
+    cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
     if (this->GetWorkingMode() != NORMAL_MODE) {
       std::string file(cmSystemTools::CollapseFullPath(path));
       cmSystemTools::ConvertToUnixSlashes(file);
@@ -1743,7 +1743,7 @@ int cmake::CheckBuildSystem()
   cm.SetHomeOutputDirectory("");
   cm.GetCurrentSnapshot().SetDefaultDefinitions();
   cmGlobalGenerator gg(&cm);
-  CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
+  cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
   if (!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
       cmSystemTools::GetErrorOccuredFlag()) {
     if (verbose) {
@@ -1764,12 +1764,14 @@ int cmake::CheckBuildSystem()
     }
 
     // Create the generator and use it to clear the dependencies.
-    CM_AUTO_PTR<cmGlobalGenerator> ggd(this->CreateGlobalGenerator(genName));
+    cmsys::auto_ptr<cmGlobalGenerator> ggd(
+      this->CreateGlobalGenerator(genName));
     if (ggd.get()) {
       cm.GetCurrentSnapshot().SetDefaultDefinitions();
-      CM_AUTO_PTR<cmMakefile> mfd(
+      cmsys::auto_ptr<cmMakefile> mfd(
         new cmMakefile(ggd.get(), cm.GetCurrentSnapshot()));
-      CM_AUTO_PTR<cmLocalGenerator> lgd(ggd->CreateLocalGenerator(mfd.get()));
+      cmsys::auto_ptr<cmLocalGenerator> lgd(
+        ggd->CreateLocalGenerator(mfd.get()));
       lgd->ClearDependencies(mfd.get(), verbose);
     }
   }
@@ -1909,7 +1911,7 @@ void cmake::MarkCliAsUsed(const std::string& variable)
 void cmake::GenerateGraphViz(const char* fileName) const
 {
 #ifdef CMAKE_BUILD_WITH_CMAKE
-  CM_AUTO_PTR<cmGraphVizWriter> gvWriter(
+  cmsys::auto_ptr<cmGraphVizWriter> gvWriter(
     new cmGraphVizWriter(this->GetGlobalGenerator()->GetLocalGenerators()));
 
   std::string settingsFile = this->GetHomeOutputDirectory();
@@ -2390,7 +2392,7 @@ int cmake::Build(const std::string& dir, const std::string& target,
     std::cerr << "Error: could not find CMAKE_GENERATOR in Cache\n";
     return 1;
   }
-  CM_AUTO_PTR<cmGlobalGenerator> gen(
+  cmsys::auto_ptr<cmGlobalGenerator> gen(
     this->CreateGlobalGenerator(cachedGenerator));
   if (!gen.get()) {
     std::cerr << "Error: could create CMAKE_GENERATOR \"" << cachedGenerator
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index 010a3b2..2427286 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -765,8 +765,9 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
         cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
         snapshot.GetDirectory().SetCurrentBinary(startOutDir);
         snapshot.GetDirectory().SetCurrentSource(startDir);
-        CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(ggd, snapshot));
-        CM_AUTO_PTR<cmLocalGenerator> lgd(ggd->CreateLocalGenerator(mf.get()));
+        cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(ggd, snapshot));
+        cmsys::auto_ptr<cmLocalGenerator> lgd(
+          ggd->CreateLocalGenerator(mf.get()));
 
         // Actually scan dependencies.
         return lgd->UpdateDependencies(depInfo.c_str(), verbose, color) ? 0
diff --git a/bootstrap b/bootstrap
index ad0c8ec..60d63c3 100755
--- a/bootstrap
+++ b/bootstrap
@@ -365,6 +365,7 @@ KWSYS_CXX_SOURCES="\
   SystemTools"
 
 KWSYS_FILES="\
+  auto_ptr.hxx \
   Directory.hxx \
   Encoding.h \
   Encoding.hxx \

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

Summary of changes:
 Help/manual/cmake-developer.7.rst              |    7 +-
 Source/CMakeLists.txt                          |    1 -
 Source/CPack/WiX/cmCPackWIXGenerator.cxx       |    2 +-
 Source/CPack/cmCPackGenerator.cxx              |    2 +-
 Source/CPack/cpack.cxx                         |    2 +-
 Source/CTest/cmCTestLaunch.cxx                 |    4 +-
 Source/CTest/cmCTestTestHandler.cxx            |    2 +-
 Source/CTest/cmCTestUpdateHandler.cxx          |    4 +-
 Source/cmCTest.cxx                             |    8 +-
 Source/cmCryptoHash.cxx                        |   16 +--
 Source/cmCryptoHash.h                          |    4 +-
 Source/cmCustomCommand.cxx                     |    2 +-
 Source/cmCustomCommandGenerator.cxx            |    4 +-
 Source/cmELF.cxx                               |   13 +-
 Source/cmExportFileGenerator.cxx               |   10 +-
 Source/cmExportLibraryDependenciesCommand.cxx  |    8 +-
 Source/cmExportTryCompileFileGenerator.cxx     |    2 +-
 Source/cmFileCommand.cxx                       |   14 +-
 Source/cmFindPackageCommand.cxx                |   33 ++---
 Source/cmForEachCommand.cxx                    |    7 +-
 Source/cmGeneratorExpression.cxx               |    6 +-
 Source/cmGeneratorExpression.h                 |    7 +-
 Source/cmGeneratorExpressionEvaluationFile.cxx |    7 +-
 Source/cmGeneratorExpressionEvaluationFile.h   |   11 +-
 Source/cmGeneratorExpressionNode.cxx           |    2 +-
 Source/cmGeneratorTarget.cxx                   |   30 ++--
 Source/cmGlobalVisualStudio7Generator.cxx      |    2 +-
 Source/cmGlobalXCodeGenerator.cxx              |    4 +-
 Source/cmGraphVizWriter.cxx                    |    5 +-
 Source/cmIfCommand.cxx                         |    3 +-
 Source/cmInstallDirectoryGenerator.cxx         |    2 +-
 Source/cmInstallFilesGenerator.cxx             |    2 +-
 Source/cmInstalledFile.h                       |    2 +-
 Source/cmLocalUnixMakefileGenerator3.cxx       |    4 +-
 Source/cmLocalVisualStudio7Generator.cxx       |    2 +-
 Source/cmLocalVisualStudioGenerator.cxx        |    4 +-
 Source/cmLocalVisualStudioGenerator.h          |    7 +-
 Source/cmMakefile.cxx                          |   19 +--
 Source/cmMakefile.h                            |   13 +-
 Source/cmMakefileTargetGenerator.cxx           |    2 +-
 Source/cmQtAutoGenerators.cxx                  |    2 +-
 Source/cmStringCommand.cxx                     |    2 +-
 Source/cmTarget.h                              |    2 +-
 Source/cmVariableWatch.cxx                     |    4 +-
 Source/cmVisualStudio10TargetGenerator.cxx     |   19 +--
 Source/cmWhileCommand.cxx                      |    3 +-
 Source/cm_auto_ptr.hxx                         |  184 ------------------------
 Source/cmake.cxx                               |   16 ++-
 Source/cmcmd.cxx                               |    5 +-
 bootstrap                                      |    1 +
 50 files changed, 173 insertions(+), 344 deletions(-)
 delete mode 100644 Source/cm_auto_ptr.hxx


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list