summaryrefslogtreecommitdiffstats
path: root/Source/cmake.cxx
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2015-08-02 09:41:51 (GMT)
committerStephen Kelly <steveire@gmail.com>2015-08-28 16:44:39 (GMT)
commitff8ac8ee6ab3ee686621445456a765fa33c1a873 (patch)
tree35e36e25e7211e74f550fd9416f37a33b34074ca /Source/cmake.cxx
parent0bd7279fd9608702b7790822c80f3c284de8e7e4 (diff)
downloadCMake-ff8ac8ee6ab3ee686621445456a765fa33c1a873.zip
CMake-ff8ac8ee6ab3ee686621445456a765fa33c1a873.tar.gz
CMake-ff8ac8ee6ab3ee686621445456a765fa33c1a873.tar.bz2
cmLocalGenerator: Create from already-constructed cmMakefile.
Don't manage the lifetime of the cmMakefile with cmLocalGenerator.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r--Source/cmake.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index ebc38d8..f069481 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -430,7 +430,8 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
cmState::Snapshot snapshot = this->GetCurrentSnapshot();
- cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(snapshot));
+ cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
+ cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get()));
lg->GetMakefile()->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetCurrentSourceDirectory
@@ -472,8 +473,8 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
cmState::Snapshot snapshot = this->GetCurrentSnapshot();
// read in the list file to fill the cache
- cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(snapshot));
- cmMakefile* mf = lg->GetMakefile();
+ cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(gg, snapshot));
+ cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(mf.get()));
mf->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory());
mf->SetCurrentSourceDirectory
@@ -2061,9 +2062,8 @@ int cmake::CheckBuildSystem()
cm.SetHomeDirectory("");
cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm);
- cmsys::auto_ptr<cmLocalGenerator> lg(
- gg.CreateLocalGenerator(cm.GetCurrentSnapshot()));
- cmMakefile* mf = lg->GetMakefile();
+ cmsys::auto_ptr<cmMakefile> mf(new cmMakefile(&gg, cm.GetCurrentSnapshot()));
+ cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator(mf.get()));
if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
cmSystemTools::GetErrorOccuredFlag())
{
@@ -2092,9 +2092,11 @@ int cmake::CheckBuildSystem()
ggd(this->CreateGlobalGenerator(genName));
if(ggd.get())
{
+ cmsys::auto_ptr<cmMakefile> mfd(new cmMakefile(ggd.get(),
+ cm.GetCurrentSnapshot()));
cmsys::auto_ptr<cmLocalGenerator> lgd(
- ggd->CreateLocalGenerator(cm.GetCurrentSnapshot()));
- lgd->ClearDependencies(mf, verbose);
+ ggd->CreateLocalGenerator(mfd.get()));
+ lgd->ClearDependencies(mfd.get(), verbose);
}
}