mirror of
https://github.com/reactos/CMake.git
synced 2024-12-15 23:57:44 +00:00
cmGlobalGenerator: Add NVI wrapper to create local generator.
This commit is contained in:
parent
2e4ea0c055
commit
b659d161da
@ -715,7 +715,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
|
||||
cm.SetProgressCallback(cmCPackGeneratorProgress, this);
|
||||
cmGlobalGenerator gg;
|
||||
gg.SetCMakeInstance(&cm);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.MakeLocalGenerator());
|
||||
cmMakefile *mf = lg->GetMakefile();
|
||||
std::string realInstallDirectory = tempInstallDirectory;
|
||||
if ( !installSubDirectory.empty() && installSubDirectory != "/" )
|
||||
|
@ -201,7 +201,7 @@ int main (int argc, char const* const* argv)
|
||||
cminst.GetState()->RemoveUnscriptableCommands();
|
||||
cmGlobalGenerator cmgg;
|
||||
cmgg.SetCMakeInstance(&cminst);
|
||||
cmsys::auto_ptr<cmLocalGenerator> cmlg(cmgg.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> cmlg(cmgg.MakeLocalGenerator());
|
||||
cmMakefile* globalMF = cmlg->GetMakefile();
|
||||
#if defined(__CYGWIN__)
|
||||
globalMF->AddDefinition("CMAKE_LEGACY_CYGWIN_WIN32", "0");
|
||||
|
@ -752,7 +752,7 @@ void cmCTestLaunch::LoadConfig()
|
||||
cmake cm;
|
||||
cmGlobalGenerator gg;
|
||||
gg.SetCMakeInstance(&cm);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.MakeLocalGenerator());
|
||||
cmMakefile* mf = lg->GetMakefile();
|
||||
std::string fname = this->LogDir;
|
||||
fname += "CTestLaunchConfig.cmake";
|
||||
|
@ -340,7 +340,7 @@ void cmCTestScriptHandler::CreateCMake()
|
||||
this->GlobalGenerator = new cmGlobalGenerator;
|
||||
this->GlobalGenerator->SetCMakeInstance(this->CMake);
|
||||
|
||||
this->LocalGenerator = this->GlobalGenerator->CreateLocalGenerator();
|
||||
this->LocalGenerator = this->GlobalGenerator->MakeLocalGenerator();
|
||||
this->Makefile = this->LocalGenerator->GetMakefile();
|
||||
|
||||
this->CMake->SetProgressCallback(ctestScriptProgressCallback, this->CTest);
|
||||
|
@ -1573,7 +1573,7 @@ void cmCTestTestHandler::GetListOfTests()
|
||||
cmake cm;
|
||||
cmGlobalGenerator gg;
|
||||
gg.SetCMakeInstance(&cm);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.MakeLocalGenerator());
|
||||
cmMakefile *mf = lg->GetMakefile();
|
||||
mf->AddDefinition("CTEST_CONFIGURATION_TYPE",
|
||||
this->CTest->GetConfigType().c_str());
|
||||
|
@ -512,7 +512,7 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
|
||||
cmake cm;
|
||||
cmGlobalGenerator gg;
|
||||
gg.SetCMakeInstance(&cm);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.MakeLocalGenerator());
|
||||
cmMakefile *mf = lg->GetMakefile();
|
||||
if ( !this->ReadCustomConfigurationFileTree(this->BinaryDir.c_str(), mf) )
|
||||
{
|
||||
|
@ -1099,7 +1099,7 @@ void cmGlobalGenerator::Configure()
|
||||
this->ClearGeneratorMembers();
|
||||
|
||||
// start with this directory
|
||||
cmLocalGenerator *lg = this->CreateLocalGenerator();
|
||||
cmLocalGenerator *lg = this->MakeLocalGenerator();
|
||||
this->LocalGenerators.push_back(lg);
|
||||
|
||||
// set the Start directories
|
||||
@ -1881,6 +1881,12 @@ void cmGlobalGenerator::EnableInstallTarget()
|
||||
this->InstallTargetEnabled = true;
|
||||
}
|
||||
|
||||
cmLocalGenerator *
|
||||
cmGlobalGenerator::MakeLocalGenerator(cmLocalGenerator *parent)
|
||||
{
|
||||
return this->CreateLocalGenerator(parent);
|
||||
}
|
||||
|
||||
cmLocalGenerator *
|
||||
cmGlobalGenerator::CreateLocalGenerator(cmLocalGenerator *parent)
|
||||
{
|
||||
|
@ -52,8 +52,7 @@ public:
|
||||
cmGlobalGenerator();
|
||||
virtual ~cmGlobalGenerator();
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
cmLocalGenerator* MakeLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
///! Get the name for this generator
|
||||
virtual std::string GetName() const { return "Generic"; }
|
||||
@ -442,6 +441,9 @@ protected:
|
||||
virtual bool UseFolderProperty();
|
||||
|
||||
private:
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent);
|
||||
|
||||
cmMakefile* TryCompileOuterMakefile;
|
||||
float FirstTimeProgress;
|
||||
// If you add a new map here, make sure it is copied
|
||||
|
@ -580,7 +580,7 @@ void cmGlobalUnixMakefileGenerator3
|
||||
else
|
||||
{
|
||||
lg = static_cast<cmLocalUnixMakefileGenerator3 *>
|
||||
(this->CreateLocalGenerator());
|
||||
(this->MakeLocalGenerator());
|
||||
// set the Start directories
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory
|
||||
(this->CMakeInstance->GetHomeDirectory());
|
||||
|
@ -67,7 +67,7 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
|
||||
cmake cm;
|
||||
cmGlobalGenerator ggi;
|
||||
ggi.SetCMakeInstance(&cm);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(ggi.MakeLocalGenerator());
|
||||
cmMakefile *mf = lg->GetMakefile();
|
||||
|
||||
const char* inFileName = settingsFileName;
|
||||
|
@ -1706,7 +1706,7 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
|
||||
|
||||
// create a new local generator and set its parent
|
||||
cmLocalGenerator *lg2 = this->GetGlobalGenerator()
|
||||
->CreateLocalGenerator(this->LocalGenerator);
|
||||
->MakeLocalGenerator(this->LocalGenerator);
|
||||
this->GetGlobalGenerator()->AddLocalGenerator(lg2);
|
||||
|
||||
// set the subdirs start dirs
|
||||
|
@ -1212,7 +1212,7 @@ static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
|
||||
cm->SetHomeOutputDirectory(targetDirectory);
|
||||
cm->SetHomeDirectory(targetDirectory);
|
||||
|
||||
cmLocalGenerator* lg = gg->CreateLocalGenerator();
|
||||
cmLocalGenerator* lg = gg->MakeLocalGenerator();
|
||||
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
|
||||
gg->SetCurrentLocalGenerator(lg);
|
||||
|
@ -376,7 +376,7 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
|
||||
std::string homeOutputDir = this->GetHomeOutputDirectory();
|
||||
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg->MakeLocalGenerator());
|
||||
lg->GetMakefile()->SetCurrentBinaryDirectory
|
||||
(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory
|
||||
@ -418,7 +418,7 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
|
||||
this->SetGlobalGenerator(gg);
|
||||
|
||||
// read in the list file to fill the cache
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg->MakeLocalGenerator());
|
||||
cmMakefile* mf = lg->GetMakefile();
|
||||
mf->SetCurrentBinaryDirectory
|
||||
(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
@ -1927,7 +1927,7 @@ int cmake::CheckBuildSystem()
|
||||
cmake cm;
|
||||
cmGlobalGenerator gg;
|
||||
gg.SetCMakeInstance(&cm);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg.MakeLocalGenerator());
|
||||
cmMakefile* mf = lg->GetMakefile();
|
||||
if(!mf->ReadListFile(this->CheckBuildSystemArgument.c_str()) ||
|
||||
cmSystemTools::GetErrorOccuredFlag())
|
||||
@ -1957,7 +1957,7 @@ int cmake::CheckBuildSystem()
|
||||
ggd(this->CreateGlobalGenerator(genName));
|
||||
if(ggd.get())
|
||||
{
|
||||
cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->MakeLocalGenerator());
|
||||
lgd->ClearDependencies(mf, verbose);
|
||||
}
|
||||
}
|
||||
|
@ -646,7 +646,7 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args)
|
||||
if(cmGlobalGenerator* ggd = cm.CreateGlobalGenerator(gen))
|
||||
{
|
||||
cm.SetGlobalGenerator(ggd);
|
||||
cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->CreateLocalGenerator());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lgd(ggd->MakeLocalGenerator());
|
||||
lgd->GetMakefile()->SetCurrentSourceDirectory(startDir);
|
||||
lgd->GetMakefile()->SetCurrentBinaryDirectory(startOutDir);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user