diff options
author | Brad King <brad.king@kitware.com> | 2016-06-28 14:17:52 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-06-29 13:47:58 (GMT) |
commit | b5ec5b0901177ebcd116d6ddd66ed114549014ec (patch) | |
tree | e1f24c8e619966137f4f8e09d4590b72c6a3c078 /Source/cmake.cxx | |
parent | 8d79375818efbaa06858a8e2d176ab8a251bef63 (diff) | |
download | CMake-b5ec5b0901177ebcd116d6ddd66ed114549014ec.zip CMake-b5ec5b0901177ebcd116d6ddd66ed114549014ec.tar.gz CMake-b5ec5b0901177ebcd116d6ddd66ed114549014ec.tar.bz2 |
Avoid using KWSys auto_ptr by adopting it ourselves
Replace use of cmsys::auto_ptr with a CM_AUTO_PTR macro that maps to
our own implementation adopted from the KWSys auto_ptr implementation.
Later we may be able to map CM_AUTO_PTR to std::auto_ptr on compilers
that do not warn about it.
Automate the client site conversions:
git grep -l auto_ptr -- Source/ | grep -v Source/kwsys/ | xargs sed -i \
's|cmsys::auto_ptr|CM_AUTO_PTR|;s|cmsys/auto_ptr.hxx|cm_auto_ptr.hxx|'
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 79e7c2b..c597605 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(); - cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot)); + CM_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); - cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); + CM_AUTO_PTR<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot())); if (!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || cmSystemTools::GetErrorOccuredFlag()) { if (verbose) { @@ -1764,14 +1764,12 @@ int cmake::CheckBuildSystem() } // Create the generator and use it to clear the dependencies. - cmsys::auto_ptr<cmGlobalGenerator> ggd( - this->CreateGlobalGenerator(genName)); + CM_AUTO_PTR<cmGlobalGenerator> ggd(this->CreateGlobalGenerator(genName)); if (ggd.get()) { cm.GetCurrentSnapshot().SetDefaultDefinitions(); - cmsys::auto_ptr<cmMakefile> mfd( + CM_AUTO_PTR<cmMakefile> mfd( new cmMakefile(ggd.get(), cm.GetCurrentSnapshot())); - cmsys::auto_ptr<cmLocalGenerator> lgd( - ggd->CreateLocalGenerator(mfd.get())); + CM_AUTO_PTR<cmLocalGenerator> lgd(ggd->CreateLocalGenerator(mfd.get())); lgd->ClearDependencies(mfd.get(), verbose); } } @@ -1911,7 +1909,7 @@ void cmake::MarkCliAsUsed(const std::string& variable) void cmake::GenerateGraphViz(const char* fileName) const { #ifdef CMAKE_BUILD_WITH_CMAKE - cmsys::auto_ptr<cmGraphVizWriter> gvWriter( + CM_AUTO_PTR<cmGraphVizWriter> gvWriter( new cmGraphVizWriter(this->GetGlobalGenerator()->GetLocalGenerators())); std::string settingsFile = this->GetHomeOutputDirectory(); @@ -2392,7 +2390,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; } - cmsys::auto_ptr<cmGlobalGenerator> gen( + CM_AUTO_PTR<cmGlobalGenerator> gen( this->CreateGlobalGenerator(cachedGenerator)); if (!gen.get()) { std::cerr << "Error: could create CMAKE_GENERATOR \"" << cachedGenerator |