cmGlobalGenerator: Remove MakeLocalGenerator method.

Inline implementation to callers.
This commit is contained in:
Stephen Kelly 2015-08-02 11:30:12 +02:00
parent acb006229d
commit 92041eec49
14 changed files with 18 additions and 27 deletions

View File

@ -717,7 +717,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
cm.SetProgressCallback(cmCPackGeneratorProgress, this); cm.SetProgressCallback(cmCPackGeneratorProgress, this);
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmLocalGenerator> lg( cmsys::auto_ptr<cmLocalGenerator> lg(
gg.MakeLocalGenerator(cm.GetCurrentSnapshot())); gg.CreateLocalGenerator(cm.GetCurrentSnapshot()));
cmMakefile *mf = lg->GetMakefile(); cmMakefile *mf = lg->GetMakefile();
std::string realInstallDirectory = tempInstallDirectory; std::string realInstallDirectory = tempInstallDirectory;
if ( !installSubDirectory.empty() && installSubDirectory != "/" ) if ( !installSubDirectory.empty() && installSubDirectory != "/" )

View File

@ -203,7 +203,7 @@ int main (int argc, char const* const* argv)
cminst.GetState()->RemoveUnscriptableCommands(); cminst.GetState()->RemoveUnscriptableCommands();
cmGlobalGenerator cmgg(&cminst); cmGlobalGenerator cmgg(&cminst);
cmsys::auto_ptr<cmLocalGenerator> cmlg( cmsys::auto_ptr<cmLocalGenerator> cmlg(
cmgg.MakeLocalGenerator(cminst.GetCurrentSnapshot())); cmgg.CreateLocalGenerator(cminst.GetCurrentSnapshot()));
cmMakefile* globalMF = cmlg->GetMakefile(); cmMakefile* globalMF = cmlg->GetMakefile();
#if defined(__CYGWIN__) #if defined(__CYGWIN__)
globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0"); globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");

View File

@ -739,7 +739,7 @@ void cmCTestLaunch::LoadConfig()
cm.SetHomeOutputDirectory(""); cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmLocalGenerator> lg( cmsys::auto_ptr<cmLocalGenerator> lg(
gg.MakeLocalGenerator(cm.GetCurrentSnapshot())); gg.CreateLocalGenerator(cm.GetCurrentSnapshot()));
cmMakefile* mf = lg->GetMakefile(); cmMakefile* mf = lg->GetMakefile();
std::string fname = this->LogDir; std::string fname = this->LogDir;
fname += "CTestLaunchConfig.cmake"; fname += "CTestLaunchConfig.cmake";

View File

@ -342,7 +342,7 @@ void cmCTestScriptHandler::CreateCMake()
this->GlobalGenerator = new cmGlobalGenerator(this->CMake); this->GlobalGenerator = new cmGlobalGenerator(this->CMake);
cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot(); cmState::Snapshot snapshot = this->CMake->GetCurrentSnapshot();
this->LocalGenerator = this->GlobalGenerator->MakeLocalGenerator(snapshot); this->LocalGenerator = this->GlobalGenerator->CreateLocalGenerator(snapshot);
this->Makefile = this->LocalGenerator->GetMakefile(); this->Makefile = this->LocalGenerator->GetMakefile();
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest); this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);

View File

@ -1593,7 +1593,7 @@ void cmCTestTestHandler::GetListOfTests()
cm.SetHomeOutputDirectory(""); cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmLocalGenerator> lg( cmsys::auto_ptr<cmLocalGenerator> lg(
gg.MakeLocalGenerator(cm.GetCurrentSnapshot())); gg.CreateLocalGenerator(cm.GetCurrentSnapshot()));
cmMakefile *mf = lg->GetMakefile(); cmMakefile *mf = lg->GetMakefile();
mf->AddDefinition("CTEST_CONFIGURATION_TYPE", mf->AddDefinition("CTEST_CONFIGURATION_TYPE",
this->CTest->GetConfigType().c_str()); this->CTest->GetConfigType().c_str());

View File

@ -521,7 +521,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
cm.SetHomeOutputDirectory(""); cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmLocalGenerator> lg( cmsys::auto_ptr<cmLocalGenerator> lg(
gg.MakeLocalGenerator(cm.GetCurrentSnapshot())); gg.CreateLocalGenerator(cm.GetCurrentSnapshot()));
cmMakefile *mf = lg->GetMakefile(); cmMakefile *mf = lg->GetMakefile();
if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) ) if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) )
{ {

View File

@ -1128,7 +1128,7 @@ void cmGlobalGenerator::Configure()
this->ClearGeneratorMembers(); this->ClearGeneratorMembers();
// start with this directory // start with this directory
cmLocalGenerator *lg = this->MakeLocalGenerator( cmLocalGenerator *lg = this->CreateLocalGenerator(
this->GetCMakeInstance()->GetCurrentSnapshot()); this->GetCMakeInstance()->GetCurrentSnapshot());
this->Makefiles.push_back(lg->GetMakefile()); this->Makefiles.push_back(lg->GetMakefile());
this->LocalGenerators.push_back(lg); this->LocalGenerators.push_back(lg);
@ -1986,12 +1986,6 @@ void cmGlobalGenerator::EnableInstallTarget()
this->InstallTargetEnabled = true; this->InstallTargetEnabled = true;
} }
cmLocalGenerator *
cmGlobalGenerator::MakeLocalGenerator(cmState::Snapshot snapshot)
{
return this->CreateLocalGenerator(snapshot);
}
cmLocalGenerator* cmLocalGenerator*
cmGlobalGenerator::CreateLocalGenerator(cmState::Snapshot snapshot) cmGlobalGenerator::CreateLocalGenerator(cmState::Snapshot snapshot)
{ {

View File

@ -56,8 +56,8 @@ public:
cmGlobalGenerator(cmake* cm); cmGlobalGenerator(cmake* cm);
virtual ~cmGlobalGenerator(); virtual ~cmGlobalGenerator();
cmLocalGenerator* virtual cmLocalGenerator*
MakeLocalGenerator(cmState::Snapshot snapshot = cmState::Snapshot()); CreateLocalGenerator(cmState::Snapshot snapshot = cmState::Snapshot());
///! Get the name for this generator ///! Get the name for this generator
virtual std::string GetName() const { return "Generic"; } virtual std::string GetName() const { return "Generic"; }
@ -440,9 +440,6 @@ protected:
virtual bool UseFolderProperty(); virtual bool UseFolderProperty();
private: private:
///! Create a local generator appropriate to this Global Generator
virtual cmLocalGenerator *CreateLocalGenerator(cmState::Snapshot snapshot);
cmMakefile* TryCompileOuterMakefile; cmMakefile* TryCompileOuterMakefile;
// If you add a new map here, make sure it is copied // If you add a new map here, make sure it is copied
// in EnableLanguagesFromGenerator // in EnableLanguagesFromGenerator

View File

@ -587,7 +587,7 @@ void cmGlobalUnixMakefileGenerator3
{ {
cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot(); cmState::Snapshot snapshot = this->CMakeInstance->GetCurrentSnapshot();
lg = static_cast<cmLocalUnixMakefileGenerator3 *> lg = static_cast<cmLocalUnixMakefileGenerator3 *>
(this->MakeLocalGenerator(snapshot)); (this->CreateLocalGenerator(snapshot));
// set the Start directories // set the Start directories
lg->GetMakefile()->SetCurrentSourceDirectory lg->GetMakefile()->SetCurrentSourceDirectory
(this->CMakeInstance->GetHomeDirectory()); (this->CMakeInstance->GetHomeDirectory());

View File

@ -69,7 +69,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
cm.SetHomeOutputDirectory(""); cm.SetHomeOutputDirectory("");
cmGlobalGenerator ggi(&cm); cmGlobalGenerator ggi(&cm);
cmsys::auto_ptr<cmLocalGenerator> lg( cmsys::auto_ptr<cmLocalGenerator> lg(
ggi.MakeLocalGenerator(cm.GetCurrentSnapshot())); ggi.CreateLocalGenerator(cm.GetCurrentSnapshot()));
cmMakefile *mf = lg->GetMakefile(); cmMakefile *mf = lg->GetMakefile();
const char* inFileName = settingsFileName; const char* inFileName = settingsFileName;

View File

@ -1756,7 +1756,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
// create a new local generator and set its parent // create a new local generator and set its parent
cmLocalGenerator *lg2 = this->GetGlobalGenerator() cmLocalGenerator *lg2 = this->GetGlobalGenerator()
->MakeLocalGenerator(newSnapshot); ->CreateLocalGenerator(newSnapshot);
this->GetGlobalGenerator()->AddMakefile(lg2->GetMakefile()); this->GetGlobalGenerator()->AddMakefile(lg2->GetMakefile());
this->GetGlobalGenerator()->AddLocalGenerator(lg2); this->GetGlobalGenerator()->AddLocalGenerator(lg2);

View File

@ -1218,7 +1218,7 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot(); cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
cmLocalGenerator* lg = gg.MakeLocalGenerator(snapshot); cmLocalGenerator* lg = gg.CreateLocalGenerator(snapshot);
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory); lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory); lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
gg.SetCurrentMakefile(lg->GetMakefile()); gg.SetCurrentMakefile(lg->GetMakefile());

View File

@ -430,7 +430,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory()); this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
cmState::Snapshot snapshot = this->GetCurrentSnapshot(); cmState::Snapshot snapshot = this->GetCurrentSnapshot();
cmsys::auto_ptr<cmLocalGenerator> lg(gg->MakeLocalGenerator(snapshot)); cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(snapshot));
lg->GetMakefile()->SetCurrentBinaryDirectory lg->GetMakefile()->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
lg->GetMakefile()->SetCurrentSourceDirectory lg->GetMakefile()->SetCurrentSourceDirectory
@ -472,7 +472,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
cmState::Snapshot snapshot = this->GetCurrentSnapshot(); cmState::Snapshot snapshot = this->GetCurrentSnapshot();
// read in the list file to fill the cache // read in the list file to fill the cache
cmsys::auto_ptr<cmLocalGenerator> lg(gg->MakeLocalGenerator(snapshot)); cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator(snapshot));
cmMakefile* mf = lg->GetMakefile(); cmMakefile* mf = lg->GetMakefile();
mf->SetCurrentBinaryDirectory mf->SetCurrentBinaryDirectory
(cmSystemTools::GetCurrentWorkingDirectory()); (cmSystemTools::GetCurrentWorkingDirectory());
@ -2062,7 +2062,7 @@ int cmake::CheckBuildSystem()
cm.SetHomeOutputDirectory(""); cm.SetHomeOutputDirectory("");
cmGlobalGenerator gg(&cm); cmGlobalGenerator gg(&cm);
cmsys::auto_ptr<cmLocalGenerator> lg( cmsys::auto_ptr<cmLocalGenerator> lg(
gg.MakeLocalGenerator(cm.GetCurrentSnapshot())); gg.CreateLocalGenerator(cm.GetCurrentSnapshot()));
cmMakefile* mf = lg->GetMakefile(); cmMakefile* mf = lg->GetMakefile();
if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) || if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
cmSystemTools::GetErrorOccuredFlag()) cmSystemTools::GetErrorOccuredFlag())
@ -2093,7 +2093,7 @@ int cmake::CheckBuildSystem()
if(ggd.get()) if(ggd.get())
{ {
cmsys::auto_ptr<cmLocalGenerator> lgd( cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->MakeLocalGenerator(cm.GetCurrentSnapshot())); ggd->CreateLocalGenerator(cm.GetCurrentSnapshot()));
lgd->ClearDependencies(mf, verbose); lgd->ClearDependencies(mf, verbose);
} }
} }

View File

@ -770,7 +770,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
cm.SetGlobalGenerator(ggd); cm.SetGlobalGenerator(ggd);
cmState::Snapshot snapshot = cm.GetCurrentSnapshot(); cmState::Snapshot snapshot = cm.GetCurrentSnapshot();
cmsys::auto_ptr<cmLocalGenerator> lgd( cmsys::auto_ptr<cmLocalGenerator> lgd(
ggd->MakeLocalGenerator(snapshot)); ggd->CreateLocalGenerator(snapshot));
lgd->GetMakefile()->SetCurrentSourceDirectory(startDir); lgd->GetMakefile()->SetCurrentSourceDirectory(startDir);
lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir); lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir);