Merge topic 'cmState-CurrentDirs'
46f6a5f4
cmState: Store the Current directories.3a041c59
Introduce cmState::Snapshot.ae6c8a9d
cmState: Store the Source and Binary directories.86f3cd0f
cmMakefile: Require the localGenerator in the constructor.a48aebcb
cmLocalGenerator: Require a parent in the constructor.e4c78b37
cmMakefile: Inline SetHome* methods into last remaining caller.410f39a4
cmMakefile: Delegate storage of Home dirs to the cmake class.
This commit is contained in:
commit
72e380fb12
|
@ -37,9 +37,11 @@ void cmGlobalBorlandMakefileGenerator
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator(
|
||||
cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalUnixMakefileGenerator3* lg =
|
||||
new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetIncludeDirective("!include");
|
||||
lg->SetWindowsShell(true);
|
||||
lg->SetDefineWindowsNULL(true);
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -1878,9 +1878,10 @@ void cmGlobalGenerator::EnableInstallTarget()
|
|||
this->InstallTargetEnabled = true;
|
||||
}
|
||||
|
||||
cmLocalGenerator *cmGlobalGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalGenerator::CreateLocalGenerator(cmLocalGenerator *parent)
|
||||
{
|
||||
cmLocalGenerator *lg = new cmLocalGenerator;
|
||||
cmLocalGenerator *lg = new cmLocalGenerator(parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public:
|
|||
virtual ~cmGlobalGenerator();
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
///! Get the name for this generator
|
||||
virtual std::string GetName() const { return "Generic"; }
|
||||
|
|
|
@ -32,9 +32,10 @@ cmGlobalGhsMultiGenerator::~cmGlobalGhsMultiGenerator()
|
|||
cmDeleteAll(TargetFolderBuildStreams);
|
||||
}
|
||||
|
||||
cmLocalGenerator *cmGlobalGhsMultiGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalGhsMultiGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalGenerator *lg = new cmLocalGhsMultiGenerator;
|
||||
cmLocalGenerator *lg = new cmLocalGhsMultiGenerator(parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
this->SetCurrentLocalGenerator(lg);
|
||||
return lg;
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
{ return new cmGlobalGeneratorSimpleFactory<cmGlobalGhsMultiGenerator>(); }
|
||||
|
||||
///! create the correct local generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/// @return the name of this generator.
|
||||
static std::string GetActualName() { return "Green Hills MULTI"; }
|
||||
|
|
|
@ -45,9 +45,11 @@ void cmGlobalJOMMakefileGenerator
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalJOMMakefileGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalJOMMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalUnixMakefileGenerator3* lg
|
||||
= new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetDefineWindowsNULL(true);
|
||||
lg->SetWindowsShell(true);
|
||||
lg->SetMakeSilentFlag("/nologo");
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -93,9 +93,11 @@ void cmGlobalMSYSMakefileGenerator
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalMSYSMakefileGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalMSYSMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalUnixMakefileGenerator3* lg =
|
||||
new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetWindowsShell(false);
|
||||
lg->SetMSYSShell(true);
|
||||
lg->SetGlobalGenerator(this);
|
||||
|
|
|
@ -36,7 +36,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -31,9 +31,11 @@ void cmGlobalMinGWMakefileGenerator
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalMinGWMakefileGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalMinGWMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalUnixMakefileGenerator3* lg =
|
||||
new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetWindowsShell(true);
|
||||
lg->SetGlobalGenerator(this);
|
||||
lg->SetIgnoreLibPrefix(true);
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -45,9 +45,11 @@ void cmGlobalNMakeMakefileGenerator
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalNMakeMakefileGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalNMakeMakefileGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalUnixMakefileGenerator3* lg =
|
||||
new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetDefineWindowsNULL(true);
|
||||
lg->SetWindowsShell(true);
|
||||
lg->SetMakeSilentFlag("/nologo");
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -496,9 +496,10 @@ cmGlobalNinjaGenerator::cmGlobalNinjaGenerator()
|
|||
//----------------------------------------------------------------------------
|
||||
// Virtual public methods.
|
||||
|
||||
cmLocalGenerator* cmGlobalNinjaGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator*
|
||||
cmGlobalNinjaGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalGenerator* lg = new cmLocalNinjaGenerator;
|
||||
cmLocalGenerator* lg = new cmLocalNinjaGenerator(parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -171,7 +171,7 @@ public:
|
|||
virtual ~cmGlobalNinjaGenerator() { }
|
||||
|
||||
/// Overloaded methods. @see cmGlobalGenerator::CreateLocalGenerator()
|
||||
virtual cmLocalGenerator* CreateLocalGenerator();
|
||||
virtual cmLocalGenerator* CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/// Overloaded methods. @see cmGlobalGenerator::GetName().
|
||||
virtual std::string GetName() const {
|
||||
|
|
|
@ -53,9 +53,10 @@ void cmGlobalUnixMakefileGenerator3
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalUnixMakefileGenerator3::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalUnixMakefileGenerator3::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalGenerator* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalGenerator* lg = new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator3
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -308,10 +308,12 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout)
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio10Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio10Generator* lg =
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS10);
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS10,
|
||||
parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
);
|
||||
|
||||
///! create the correct local generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -237,10 +237,12 @@ void cmGlobalVisualStudio11Generator::WriteSLNHeader(std::ostream& fout)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalGenerator *cmGlobalVisualStudio11Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio11Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio10Generator* lg =
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS11);
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS11,
|
||||
parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
virtual void WriteSLNHeader(std::ostream& fout);
|
||||
|
||||
///! create the correct local generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
protected:
|
||||
virtual bool InitializeWindowsPhone(cmMakefile* mf);
|
||||
|
|
|
@ -217,10 +217,12 @@ void cmGlobalVisualStudio12Generator::WriteSLNHeader(std::ostream& fout)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalGenerator *cmGlobalVisualStudio12Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio12Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio10Generator* lg =
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS12);
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS12,
|
||||
parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
virtual void WriteSLNHeader(std::ostream& fout);
|
||||
|
||||
///! create the correct local generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
//in Visual Studio 2013 they detached the MSBuild tools version
|
||||
//from the .Net Framework version and instead made it have it's own
|
||||
|
|
|
@ -128,10 +128,12 @@ void cmGlobalVisualStudio14Generator::WriteSLNHeader(std::ostream& fout)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalGenerator *cmGlobalVisualStudio14Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio14Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio10Generator* lg =
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS14);
|
||||
new cmLocalVisualStudio10Generator(cmLocalVisualStudioGenerator::VS14,
|
||||
parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
virtual void WriteSLNHeader(std::ostream& fout);
|
||||
|
||||
///! create the correct local generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
virtual const char* GetToolsVersion() { return "14.0"; }
|
||||
protected:
|
||||
|
|
|
@ -170,9 +170,10 @@ cmGlobalVisualStudio6Generator::GenerateBuildCommand(
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalVisualStudio6Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio6Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalGenerator *lg = new cmLocalVisualStudio6Generator;
|
||||
cmLocalGenerator *lg = new cmLocalVisualStudio6Generator(parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -25,10 +25,12 @@ cmGlobalVisualStudio71Generator::cmGlobalVisualStudio71Generator(
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalVisualStudio71Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio71Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg =
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS71);
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS71,
|
||||
parent);
|
||||
lg->SetExtraFlagTable(this->GetExtraFlagTableVS7());
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Where does this version of Visual Studio look for macros for the
|
||||
|
|
|
@ -250,10 +250,12 @@ void cmGlobalVisualStudio7Generator::GenerateBuildCommand(
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalVisualStudio7Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio7Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg =
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS7);
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS7,
|
||||
parent);
|
||||
lg->SetExtraFlagTable(this->GetExtraFlagTableVS7());
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
|
|
|
@ -42,7 +42,7 @@ public:
|
|||
std::string const& GetPlatformName() const;
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
virtual bool SetSystemName(std::string const& s, cmMakefile* mf);
|
||||
|
||||
|
|
|
@ -125,10 +125,12 @@ std::string cmGlobalVisualStudio8Generator::FindDevEnvCommand()
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio8Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg =
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS8);
|
||||
new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS8,
|
||||
parent);
|
||||
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
|
|
|
@ -34,7 +34,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
virtual void EnableLanguage(std::vector<std::string>const& languages,
|
||||
cmMakefile *, bool optional);
|
||||
|
|
|
@ -114,10 +114,12 @@ void cmGlobalVisualStudio9Generator::WriteSLNHeader(std::ostream& fout)
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalVisualStudio9Generator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalVisualStudio7Generator *lg
|
||||
= new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS9);
|
||||
= new cmLocalVisualStudio7Generator(cmLocalVisualStudioGenerator::VS9,
|
||||
parent);
|
||||
lg->SetExtraFlagTable(this->GetExtraFlagTableVS8());
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
|
|
|
@ -29,7 +29,7 @@ public:
|
|||
static cmGlobalGeneratorFactory* NewFactory();
|
||||
|
||||
///! create the correct local generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -41,9 +41,11 @@ void cmGlobalWatcomWMakeGenerator
|
|||
}
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalWatcomWMakeGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalWatcomWMakeGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
||||
cmLocalUnixMakefileGenerator3* lg
|
||||
= new cmLocalUnixMakefileGenerator3(parent);
|
||||
lg->SetDefineWindowsNULL(true);
|
||||
#ifdef _WIN32
|
||||
lg->SetWindowsShell(true);
|
||||
|
|
|
@ -35,7 +35,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -368,9 +368,10 @@ cmGlobalXCodeGenerator::GenerateBuildCommand(
|
|||
|
||||
//----------------------------------------------------------------------------
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
cmLocalGenerator *cmGlobalXCodeGenerator::CreateLocalGenerator()
|
||||
cmLocalGenerator *
|
||||
cmGlobalXCodeGenerator::CreateLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
cmLocalGenerator *lg = new cmLocalXCodeGenerator;
|
||||
cmLocalGenerator *lg = new cmLocalXCodeGenerator(parent);
|
||||
lg->SetGlobalGenerator(this);
|
||||
return lg;
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public:
|
|||
static void GetDocumentation(cmDocumentationEntry& entry);
|
||||
|
||||
///! Create a local generator appropriate to this Global Generator
|
||||
virtual cmLocalGenerator *CreateLocalGenerator();
|
||||
virtual cmLocalGenerator *CreateLocalGenerator(cmLocalGenerator* parent = 0);
|
||||
|
||||
/**
|
||||
* Try to determine system information such as shared library
|
||||
|
|
|
@ -43,10 +43,14 @@
|
|||
#include <StorageDefs.h>
|
||||
#endif
|
||||
|
||||
cmLocalGenerator::cmLocalGenerator()
|
||||
cmLocalGenerator::cmLocalGenerator(cmLocalGenerator* parent)
|
||||
{
|
||||
this->Makefile = 0; // moved to after set on global
|
||||
this->Parent = 0;
|
||||
this->Parent = parent;
|
||||
if (parent)
|
||||
{
|
||||
parent->AddChild(this);
|
||||
}
|
||||
this->WindowsShell = false;
|
||||
this->WindowsVSIDE = false;
|
||||
this->WatcomWMake = false;
|
||||
|
@ -249,8 +253,7 @@ void cmLocalGenerator::SetupPathConversions()
|
|||
void cmLocalGenerator::SetGlobalGenerator(cmGlobalGenerator *gg)
|
||||
{
|
||||
this->GlobalGenerator = gg;
|
||||
this->Makefile = new cmMakefile;
|
||||
this->Makefile->SetLocalGenerator(this);
|
||||
this->Makefile = new cmMakefile(this);
|
||||
}
|
||||
|
||||
void cmLocalGenerator::ConfigureFinalPass()
|
||||
|
|
|
@ -33,7 +33,7 @@ class cmCustomCommandGenerator;
|
|||
class cmLocalGenerator
|
||||
{
|
||||
public:
|
||||
cmLocalGenerator();
|
||||
cmLocalGenerator(cmLocalGenerator* parent);
|
||||
virtual ~cmLocalGenerator();
|
||||
|
||||
/**
|
||||
|
@ -131,7 +131,6 @@ public:
|
|||
|
||||
///! set/get the parent generator
|
||||
cmLocalGenerator* GetParent() const {return this->Parent;}
|
||||
void SetParent(cmLocalGenerator* g) { this->Parent = g; g->AddChild(this); }
|
||||
|
||||
///! set/get the children
|
||||
void AddChild(cmLocalGenerator* g) { this->Children.push_back(g); }
|
||||
|
|
|
@ -16,7 +16,8 @@
|
|||
#include "cmGhsMultiTargetGenerator.h"
|
||||
#include "cmGeneratedFileStream.h"
|
||||
|
||||
cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator()
|
||||
cmLocalGhsMultiGenerator::cmLocalGhsMultiGenerator(cmLocalGenerator* parent)
|
||||
: cmLocalGenerator(parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class cmGeneratedFileStream;
|
|||
class cmLocalGhsMultiGenerator : public cmLocalGenerator
|
||||
{
|
||||
public:
|
||||
cmLocalGhsMultiGenerator();
|
||||
cmLocalGhsMultiGenerator(cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalGhsMultiGenerator();
|
||||
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
|
||||
#include <assert.h>
|
||||
|
||||
cmLocalNinjaGenerator::cmLocalNinjaGenerator()
|
||||
: cmLocalGenerator()
|
||||
cmLocalNinjaGenerator::cmLocalNinjaGenerator(cmLocalGenerator* parent)
|
||||
: cmLocalGenerator(parent)
|
||||
, ConfigName("")
|
||||
, HomeRelativeOutputPath("")
|
||||
{
|
||||
|
|
|
@ -32,7 +32,7 @@ class cmLocalNinjaGenerator : public cmLocalGenerator
|
|||
{
|
||||
public:
|
||||
/// Default constructor.
|
||||
cmLocalNinjaGenerator();
|
||||
cmLocalNinjaGenerator(cmLocalGenerator* parent);
|
||||
|
||||
/// Destructor.
|
||||
virtual ~cmLocalNinjaGenerator();
|
||||
|
|
|
@ -79,7 +79,9 @@ static std::string cmSplitExtension(std::string const& in, std::string& base)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3()
|
||||
cmLocalUnixMakefileGenerator3::
|
||||
cmLocalUnixMakefileGenerator3(cmLocalGenerator* parent)
|
||||
: cmLocalGenerator(parent)
|
||||
{
|
||||
this->WindowsShell = false;
|
||||
this->IncludeDirective = "include";
|
||||
|
|
|
@ -34,7 +34,7 @@ class cmSourceFile;
|
|||
class cmLocalUnixMakefileGenerator3 : public cmLocalGenerator
|
||||
{
|
||||
public:
|
||||
cmLocalUnixMakefileGenerator3();
|
||||
cmLocalUnixMakefileGenerator3(cmLocalGenerator* parent);
|
||||
virtual ~cmLocalUnixMakefileGenerator3();
|
||||
|
||||
/**
|
||||
|
|
|
@ -61,8 +61,9 @@ class cmVS10XMLParser : public cmXMLParser
|
|||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalVisualStudio10Generator::cmLocalVisualStudio10Generator(VSVersion v):
|
||||
cmLocalVisualStudio7Generator(v)
|
||||
cmLocalVisualStudio10Generator
|
||||
::cmLocalVisualStudio10Generator(VSVersion v, cmLocalGenerator* parent):
|
||||
cmLocalVisualStudio7Generator(v, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ class cmLocalVisualStudio10Generator : public cmLocalVisualStudio7Generator
|
|||
{
|
||||
public:
|
||||
///! Set cache only and recurse to false by default.
|
||||
cmLocalVisualStudio10Generator(VSVersion v);
|
||||
cmLocalVisualStudio10Generator(VSVersion v, cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalVisualStudio10Generator();
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@
|
|||
#include <cmsys/RegularExpression.hxx>
|
||||
#include <cmsys/FStream.hxx>
|
||||
|
||||
cmLocalVisualStudio6Generator::cmLocalVisualStudio6Generator():
|
||||
cmLocalVisualStudioGenerator(VS6)
|
||||
cmLocalVisualStudio6Generator
|
||||
::cmLocalVisualStudio6Generator(cmLocalGenerator* parent):
|
||||
cmLocalVisualStudioGenerator(VS6, parent)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class cmLocalVisualStudio6Generator : public cmLocalVisualStudioGenerator
|
|||
{
|
||||
public:
|
||||
///! Set cache only and recurse to false by default.
|
||||
cmLocalVisualStudio6Generator();
|
||||
cmLocalVisualStudio6Generator(cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalVisualStudio6Generator();
|
||||
|
||||
|
|
|
@ -54,8 +54,9 @@ static void cmConvertToWindowsSlash(std::string& s)
|
|||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalVisualStudio7Generator::cmLocalVisualStudio7Generator(VSVersion v):
|
||||
cmLocalVisualStudioGenerator(v)
|
||||
cmLocalVisualStudio7Generator
|
||||
::cmLocalVisualStudio7Generator(VSVersion v, cmLocalGenerator* parent):
|
||||
cmLocalVisualStudioGenerator(v, parent)
|
||||
{
|
||||
this->ExtraFlagTable = 0;
|
||||
this->Internal = new cmLocalVisualStudio7GeneratorInternals(this);
|
||||
|
|
|
@ -35,7 +35,7 @@ class cmLocalVisualStudio7Generator : public cmLocalVisualStudioGenerator
|
|||
{
|
||||
public:
|
||||
///! Set cache only and recurse to false by default.
|
||||
cmLocalVisualStudio7Generator(VSVersion v);
|
||||
cmLocalVisualStudio7Generator(VSVersion v, cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalVisualStudio7Generator();
|
||||
|
||||
|
|
|
@ -18,7 +18,9 @@
|
|||
#include "windows.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalVisualStudioGenerator::cmLocalVisualStudioGenerator(VSVersion v)
|
||||
cmLocalVisualStudioGenerator
|
||||
::cmLocalVisualStudioGenerator(VSVersion v, cmLocalGenerator* parent)
|
||||
: cmLocalGenerator(parent)
|
||||
{
|
||||
this->WindowsShell = true;
|
||||
this->WindowsVSIDE = true;
|
||||
|
|
|
@ -45,7 +45,7 @@ public:
|
|||
VS14 = 140
|
||||
};
|
||||
|
||||
cmLocalVisualStudioGenerator(VSVersion v);
|
||||
cmLocalVisualStudioGenerator(VSVersion v, cmLocalGenerator* parent);
|
||||
virtual ~cmLocalVisualStudioGenerator();
|
||||
|
||||
/** Construct a script from the given list of command lines. */
|
||||
|
|
|
@ -15,7 +15,8 @@
|
|||
#include "cmMakefile.h"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
cmLocalXCodeGenerator::cmLocalXCodeGenerator()
|
||||
cmLocalXCodeGenerator::cmLocalXCodeGenerator(cmLocalGenerator* parent)
|
||||
: cmLocalGenerator(parent)
|
||||
{
|
||||
// the global generator does this, so do not
|
||||
// put these flags into the language flags
|
||||
|
|
|
@ -24,7 +24,7 @@ class cmLocalXCodeGenerator : public cmLocalGenerator
|
|||
{
|
||||
public:
|
||||
///! Set cache only and recurse to false by default.
|
||||
cmLocalXCodeGenerator();
|
||||
cmLocalXCodeGenerator(cmLocalGenerator* parent);
|
||||
|
||||
virtual ~cmLocalXCodeGenerator();
|
||||
virtual std::string GetTargetDirectory(cmTarget const& target) const;
|
||||
|
|
|
@ -53,7 +53,11 @@ public:
|
|||
};
|
||||
|
||||
// default is not to be building executables
|
||||
cmMakefile::cmMakefile(): Internal(new Internals)
|
||||
cmMakefile::cmMakefile(cmLocalGenerator* localGenerator)
|
||||
: Internal(new Internals),
|
||||
LocalGenerator(localGenerator),
|
||||
StateSnapshot(localGenerator->GetGlobalGenerator()
|
||||
->GetCMakeInstance()->GetState())
|
||||
{
|
||||
const cmDefinitions& defs = cmDefinitions();
|
||||
const std::set<std::string> globalKeys = defs.LocalKeys();
|
||||
|
@ -62,6 +66,19 @@ cmMakefile::cmMakefile(): Internal(new Internals)
|
|||
this->Internal->VarUsageStack.push(globalKeys);
|
||||
this->Internal->IsSourceFileTryCompile = false;
|
||||
|
||||
if (this->LocalGenerator->GetParent())
|
||||
{
|
||||
cmMakefile* parentMf = this->LocalGenerator->GetParent()->GetMakefile();
|
||||
this->StateSnapshot =
|
||||
this->GetState()->CreateSnapshot(parentMf->StateSnapshot);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->StateSnapshot =
|
||||
this->GetState()->CreateSnapshot(this->StateSnapshot);
|
||||
}
|
||||
|
||||
|
||||
// Initialize these first since AddDefaultDefinitions calls AddDefinition
|
||||
this->WarnUnused = false;
|
||||
this->CheckSystemVars = false;
|
||||
|
@ -97,7 +114,7 @@ cmMakefile::cmMakefile(): Internal(new Internals)
|
|||
this->HeaderFileExtensions.push_back( "txx" );
|
||||
|
||||
this->DefineFlags = " ";
|
||||
this->LocalGenerator = 0;
|
||||
this->LocalGenerator = localGenerator;
|
||||
|
||||
this->AddDefaultDefinitions();
|
||||
this->Initialize();
|
||||
|
@ -126,6 +143,39 @@ void cmMakefile::Initialize()
|
|||
// By default the check is not done. It is enabled by
|
||||
// cmListFileCache in the top level if necessary.
|
||||
this->CheckCMP0000 = false;
|
||||
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
this->AddSourceGroup("", "^.*$");
|
||||
this->AddSourceGroup
|
||||
("Source Files",
|
||||
"\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp"
|
||||
"|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
|
||||
this->AddSourceGroup("Header Files", CM_HEADER_REGEX);
|
||||
this->AddSourceGroup("CMake Rules", "\\.rule$");
|
||||
this->AddSourceGroup("Resources", "\\.plist$");
|
||||
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
|
||||
#endif
|
||||
|
||||
this->Properties.SetCMakeInstance(this->GetCMakeInstance());
|
||||
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
|
||||
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
|
||||
|
||||
{
|
||||
const char* dir = this->GetCMakeInstance()->GetHomeDirectory();
|
||||
this->AddDefinition("CMAKE_SOURCE_DIR", dir);
|
||||
if ( !this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR") )
|
||||
{
|
||||
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", dir);
|
||||
}
|
||||
}
|
||||
{
|
||||
const char* dir = this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||
this->AddDefinition("CMAKE_BINARY_DIR", dir);
|
||||
if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") )
|
||||
{
|
||||
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", dir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cmMakefile::~cmMakefile()
|
||||
|
@ -181,11 +231,11 @@ void cmMakefile::Print() const
|
|||
std::cout << " this->StartOutputDirectory; " <<
|
||||
this->GetCurrentBinaryDirectory() << std::endl;
|
||||
std::cout << " this->HomeOutputDirectory; " <<
|
||||
this->HomeOutputDirectory << std::endl;
|
||||
this->GetHomeOutputDirectory() << std::endl;
|
||||
std::cout << " this->cmStartDirectory; " <<
|
||||
this->GetCurrentSourceDirectory() << std::endl;
|
||||
std::cout << " this->cmHomeDirectory; " <<
|
||||
this->cmHomeDirectory << std::endl;
|
||||
this->GetHomeDirectory() << std::endl;
|
||||
std::cout << " this->ProjectName; "
|
||||
<< this->ProjectName << std::endl;
|
||||
this->PrintStringVector("this->LinkDirectories", this->LinkDirectories);
|
||||
|
@ -630,32 +680,6 @@ void cmMakefile::EnforceDirectoryLevelRules() const
|
|||
}
|
||||
}
|
||||
|
||||
// Set the make file
|
||||
void cmMakefile::SetLocalGenerator(cmLocalGenerator* lg)
|
||||
{
|
||||
this->LocalGenerator = lg;
|
||||
// the source groups need to access the global generator
|
||||
// so don't create them until the lg is set
|
||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||
this->AddSourceGroup("", "^.*$");
|
||||
this->AddSourceGroup
|
||||
("Source Files",
|
||||
"\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp"
|
||||
"|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
|
||||
this->AddSourceGroup("Header Files", CM_HEADER_REGEX);
|
||||
this->AddSourceGroup("CMake Rules", "\\.rule$");
|
||||
this->AddSourceGroup("Resources", "\\.plist$");
|
||||
this->AddSourceGroup("Object Files", "\\.(lo|o|obj)$");
|
||||
#endif
|
||||
|
||||
this->Properties.SetCMakeInstance(this->GetCMakeInstance());
|
||||
this->WarnUnused = this->GetCMakeInstance()->GetWarnUnused();
|
||||
this->CheckSystemVars = this->GetCMakeInstance()->GetCheckSystemVars();
|
||||
this->SetHomeDirectory(this->GetCMakeInstance()->GetHomeDirectory());
|
||||
this->SetHomeOutputDirectory(
|
||||
this->GetCMakeInstance()->GetHomeOutputDirectory());
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
struct file_not_persistent
|
||||
|
@ -1603,8 +1627,8 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
|
|||
|
||||
// create a new local generator and set its parent
|
||||
cmLocalGenerator *lg2 =
|
||||
this->LocalGenerator->GetGlobalGenerator()->CreateLocalGenerator();
|
||||
lg2->SetParent(this->LocalGenerator);
|
||||
this->LocalGenerator->GetGlobalGenerator()
|
||||
->CreateLocalGenerator(this->LocalGenerator);
|
||||
this->LocalGenerator->GetGlobalGenerator()->AddLocalGenerator(lg2);
|
||||
|
||||
// set the subdirs start dirs
|
||||
|
@ -1623,33 +1647,27 @@ void cmMakefile::AddSubDirectory(const std::string& srcPath,
|
|||
|
||||
void cmMakefile::SetCurrentSourceDirectory(const std::string& dir)
|
||||
{
|
||||
this->cmStartDirectory = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
|
||||
this->cmStartDirectory =
|
||||
cmSystemTools::CollapseFullPath(this->cmStartDirectory);
|
||||
this->StateSnapshot.SetCurrentSourceDirectory(dir);
|
||||
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
|
||||
this->cmStartDirectory.c_str());
|
||||
this->StateSnapshot.GetCurrentSourceDirectory());
|
||||
}
|
||||
|
||||
const char* cmMakefile::GetCurrentSourceDirectory() const
|
||||
{
|
||||
return this->cmStartDirectory.c_str();
|
||||
return this->StateSnapshot.GetCurrentSourceDirectory();
|
||||
}
|
||||
|
||||
void cmMakefile::SetCurrentBinaryDirectory(const std::string& dir)
|
||||
{
|
||||
this->StartOutputDirectory = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
|
||||
this->StartOutputDirectory =
|
||||
cmSystemTools::CollapseFullPath(this->StartOutputDirectory);
|
||||
cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
|
||||
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
|
||||
this->StartOutputDirectory.c_str());
|
||||
this->StateSnapshot.SetCurrentBinaryDirectory(dir);
|
||||
const char* binDir = this->StateSnapshot.GetCurrentBinaryDirectory();
|
||||
cmSystemTools::MakeDirectory(binDir);
|
||||
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR", binDir);
|
||||
}
|
||||
|
||||
const char* cmMakefile::GetCurrentBinaryDirectory() const
|
||||
{
|
||||
return this->StartOutputDirectory.c_str();
|
||||
return this->StateSnapshot.GetCurrentBinaryDirectory();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -3382,35 +3400,12 @@ cmMakefile::LexicalPushPop::~LexicalPushPop()
|
|||
|
||||
const char* cmMakefile::GetHomeDirectory() const
|
||||
{
|
||||
return this->cmHomeDirectory.c_str();
|
||||
}
|
||||
|
||||
void cmMakefile::SetHomeDirectory(const std::string& dir)
|
||||
{
|
||||
this->cmHomeDirectory = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory);
|
||||
this->AddDefinition("CMAKE_SOURCE_DIR", this->GetHomeDirectory());
|
||||
if ( !this->GetDefinition("CMAKE_CURRENT_SOURCE_DIR") )
|
||||
{
|
||||
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR", this->GetHomeDirectory());
|
||||
}
|
||||
return this->GetCMakeInstance()->GetHomeDirectory();
|
||||
}
|
||||
|
||||
const char* cmMakefile::GetHomeOutputDirectory() const
|
||||
{
|
||||
return this->HomeOutputDirectory.c_str();
|
||||
}
|
||||
|
||||
void cmMakefile::SetHomeOutputDirectory(const std::string& dir)
|
||||
{
|
||||
this->HomeOutputDirectory = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory);
|
||||
this->AddDefinition("CMAKE_BINARY_DIR", this->GetHomeOutputDirectory());
|
||||
if ( !this->GetDefinition("CMAKE_CURRENT_BINARY_DIR") )
|
||||
{
|
||||
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
|
||||
this->GetHomeOutputDirectory());
|
||||
}
|
||||
return this->GetCMakeInstance()->GetHomeOutputDirectory();
|
||||
}
|
||||
|
||||
void cmMakefile::SetScriptModeFile(const char* scriptfile)
|
||||
|
|
|
@ -74,7 +74,7 @@ public:
|
|||
/**
|
||||
* Construct an empty makefile.
|
||||
*/
|
||||
cmMakefile();
|
||||
cmMakefile(cmLocalGenerator* localGenerator);
|
||||
|
||||
/**
|
||||
* Destructor.
|
||||
|
@ -138,13 +138,6 @@ public:
|
|||
|
||||
bool GetIsSourceFileTryCompile() const;
|
||||
|
||||
/**
|
||||
* Specify the makefile generator. This is platform/compiler
|
||||
* dependent, although the interface is through a generic
|
||||
* superclass.
|
||||
*/
|
||||
void SetLocalGenerator(cmLocalGenerator*);
|
||||
|
||||
///! Get the current makefile generator.
|
||||
cmLocalGenerator* GetLocalGenerator() const
|
||||
{ return this->LocalGenerator;}
|
||||
|
@ -422,19 +415,8 @@ public:
|
|||
bool HasCMP0054AlreadyBeenReported(
|
||||
cmListFileContext context) const;
|
||||
|
||||
//@{
|
||||
/**
|
||||
* Set/Get the home directory (or output directory) in the project. The
|
||||
* home directory is the top directory of the project. It is where
|
||||
* CMakeSetup or configure was run. Remember that CMake processes
|
||||
* CMakeLists files by recursing up the tree starting at the StartDirectory
|
||||
* and going up until it reaches the HomeDirectory.
|
||||
*/
|
||||
void SetHomeDirectory(const std::string& dir);
|
||||
const char* GetHomeDirectory() const;
|
||||
void SetHomeOutputDirectory(const std::string& dir);
|
||||
const char* GetHomeOutputDirectory() const;
|
||||
//@}
|
||||
|
||||
/**
|
||||
* Set CMAKE_SCRIPT_MODE_FILE variable when running a -P script.
|
||||
|
@ -876,10 +858,6 @@ protected:
|
|||
// Check for a an unused variable
|
||||
void CheckForUnused(const char* reason, const std::string& name) const;
|
||||
|
||||
std::string cmStartDirectory;
|
||||
std::string StartOutputDirectory;
|
||||
std::string cmHomeDirectory;
|
||||
std::string HomeOutputDirectory;
|
||||
std::string cmCurrentListFile;
|
||||
|
||||
std::string ProjectName; // project name
|
||||
|
@ -942,7 +920,7 @@ private:
|
|||
cmMakefile& operator=(const cmMakefile& mf);
|
||||
void Initialize();
|
||||
|
||||
|
||||
cmState::Snapshot StateSnapshot;
|
||||
|
||||
bool ReadListFileInternal(const char* filenametoread,
|
||||
bool noPolicyScope,
|
||||
|
|
|
@ -1210,10 +1210,11 @@ static cmGlobalGenerator* CreateGlobalGenerator(cmake* cm,
|
|||
cmGlobalGenerator* gg = new cmGlobalGenerator();
|
||||
gg->SetCMakeInstance(cm);
|
||||
|
||||
cm->SetHomeOutputDirectory(targetDirectory);
|
||||
cm->SetHomeDirectory(targetDirectory);
|
||||
|
||||
cmLocalGenerator* lg = gg->CreateLocalGenerator();
|
||||
lg->GetMakefile()->SetHomeOutputDirectory(targetDirectory);
|
||||
lg->GetMakefile()->SetCurrentBinaryDirectory(targetDirectory);
|
||||
lg->GetMakefile()->SetHomeDirectory(targetDirectory);
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory(targetDirectory);
|
||||
gg->SetCurrentLocalGenerator(lg);
|
||||
|
||||
|
@ -1225,6 +1226,8 @@ bool cmQtAutoGenerators::Run(const std::string& targetDirectory,
|
|||
{
|
||||
bool success = true;
|
||||
cmake cm;
|
||||
cm.SetHomeOutputDirectory(targetDirectory);
|
||||
cm.SetHomeDirectory(targetDirectory);
|
||||
cmGlobalGenerator* gg = CreateGlobalGenerator(&cm, targetDirectory);
|
||||
cmMakefile* makefile = gg->GetCurrentLocalGenerator()->GetMakefile();
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ cmState::cmState(cmake* cm)
|
|||
: CMakeInstance(cm),
|
||||
IsInTryCompile(false)
|
||||
{
|
||||
this->CreateSnapshot(Snapshot());
|
||||
this->Initialize();
|
||||
}
|
||||
|
||||
|
@ -444,3 +445,72 @@ bool cmState::GetGlobalPropertyAsBool(const std::string& prop)
|
|||
{
|
||||
return cmSystemTools::IsOn(this->GetGlobalProperty(prop));
|
||||
}
|
||||
|
||||
void cmState::SetSourceDirectory(std::string const& sourceDirectory)
|
||||
{
|
||||
this->SourceDirectory = sourceDirectory;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->SourceDirectory);
|
||||
}
|
||||
|
||||
const char* cmState::GetSourceDirectory() const
|
||||
{
|
||||
return this->SourceDirectory.c_str();
|
||||
}
|
||||
|
||||
void cmState::SetBinaryDirectory(std::string const& binaryDirectory)
|
||||
{
|
||||
this->BinaryDirectory = binaryDirectory;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->BinaryDirectory);
|
||||
}
|
||||
|
||||
const char* cmState::GetBinaryDirectory() const
|
||||
{
|
||||
return this->BinaryDirectory.c_str();
|
||||
}
|
||||
|
||||
cmState::Snapshot cmState::CreateSnapshot(Snapshot originSnapshot)
|
||||
{
|
||||
PositionType pos = this->ParentPositions.size();
|
||||
this->ParentPositions.push_back(originSnapshot.Position);
|
||||
this->Locations.resize(this->Locations.size() + 1);
|
||||
this->OutputLocations.resize(this->OutputLocations.size() + 1);
|
||||
return cmState::Snapshot(this, pos);
|
||||
}
|
||||
|
||||
cmState::Snapshot::Snapshot(cmState* state, PositionType position)
|
||||
: State(state),
|
||||
Position(position)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
const char* cmState::Snapshot::GetCurrentSourceDirectory() const
|
||||
{
|
||||
return this->State->Locations[this->Position].c_str();
|
||||
}
|
||||
|
||||
void cmState::Snapshot::SetCurrentSourceDirectory(std::string const& dir)
|
||||
{
|
||||
assert(this->State->Locations.size() > this->Position);
|
||||
this->State->Locations[this->Position] = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(
|
||||
this->State->Locations[this->Position]);
|
||||
this->State->Locations[this->Position] =
|
||||
cmSystemTools::CollapseFullPath(this->State->Locations[this->Position]);
|
||||
}
|
||||
|
||||
const char* cmState::Snapshot::GetCurrentBinaryDirectory() const
|
||||
{
|
||||
return this->State->OutputLocations[this->Position].c_str();
|
||||
}
|
||||
|
||||
void cmState::Snapshot::SetCurrentBinaryDirectory(std::string const& dir)
|
||||
{
|
||||
assert(this->State->OutputLocations.size() > this->Position);
|
||||
this->State->OutputLocations[this->Position] = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(
|
||||
this->State->OutputLocations[this->Position]);
|
||||
this->State->OutputLocations[this->Position] =
|
||||
cmSystemTools::CollapseFullPath(
|
||||
this->State->OutputLocations[this->Position]);
|
||||
}
|
||||
|
|
|
@ -21,10 +21,29 @@ class cmCommand;
|
|||
|
||||
class cmState
|
||||
{
|
||||
typedef std::vector<std::string>::size_type PositionType;
|
||||
friend class Snapshot;
|
||||
public:
|
||||
cmState(cmake* cm);
|
||||
~cmState();
|
||||
|
||||
class Snapshot {
|
||||
public:
|
||||
Snapshot(cmState* state = 0, PositionType position = 0);
|
||||
|
||||
const char* GetCurrentSourceDirectory() const;
|
||||
void SetCurrentSourceDirectory(std::string const& dir);
|
||||
const char* GetCurrentBinaryDirectory() const;
|
||||
void SetCurrentBinaryDirectory(std::string const& dir);
|
||||
|
||||
private:
|
||||
friend class cmState;
|
||||
cmState* State;
|
||||
cmState::PositionType Position;
|
||||
};
|
||||
|
||||
Snapshot CreateSnapshot(Snapshot originSnapshot);
|
||||
|
||||
enum CacheEntryType{ BOOL=0, PATH, FILEPATH, STRING, INTERNAL,STATIC,
|
||||
UNINITIALIZED };
|
||||
static CacheEntryType StringToCacheEntryType(const char*);
|
||||
|
@ -95,12 +114,22 @@ public:
|
|||
const char *GetGlobalProperty(const std::string& prop);
|
||||
bool GetGlobalPropertyAsBool(const std::string& prop);
|
||||
|
||||
const char* GetSourceDirectory() const;
|
||||
void SetSourceDirectory(std::string const& sourceDirectory);
|
||||
const char* GetBinaryDirectory() const;
|
||||
void SetBinaryDirectory(std::string const& binaryDirectory);
|
||||
|
||||
private:
|
||||
std::map<cmProperty::ScopeType, cmPropertyDefinitionMap> PropertyDefinitions;
|
||||
std::vector<std::string> EnabledLanguages;
|
||||
std::map<std::string, cmCommand*> Commands;
|
||||
cmPropertyMap GlobalProperties;
|
||||
cmake* CMakeInstance;
|
||||
std::vector<std::string> Locations;
|
||||
std::vector<std::string> OutputLocations;
|
||||
std::vector<PositionType> ParentPositions;
|
||||
std::string SourceDirectory;
|
||||
std::string BinaryDirectory;
|
||||
bool IsInTryCompile;
|
||||
};
|
||||
|
||||
|
|
|
@ -372,13 +372,13 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
|
|||
// read in the list file to fill the cache
|
||||
if(path)
|
||||
{
|
||||
std::string homeDir = this->GetHomeDirectory();
|
||||
std::string homeOutputDir = this->GetHomeOutputDirectory();
|
||||
this->SetHomeDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
this->SetHomeOutputDirectory(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
cmsys::auto_ptr<cmLocalGenerator> lg(gg->CreateLocalGenerator());
|
||||
lg->GetMakefile()->SetHomeOutputDirectory
|
||||
(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
lg->GetMakefile()->SetCurrentBinaryDirectory
|
||||
(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
lg->GetMakefile()->SetHomeDirectory
|
||||
(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
lg->GetMakefile()->SetCurrentSourceDirectory
|
||||
(cmSystemTools::GetCurrentWorkingDirectory());
|
||||
if (this->GetWorkingMode() != NORMAL_MODE)
|
||||
|
@ -393,6 +393,8 @@ void cmake::ReadListFile(const std::vector<std::string>& args,
|
|||
{
|
||||
cmSystemTools::Error("Error processing file: ", path);
|
||||
}
|
||||
this->SetHomeDirectory(homeDir);
|
||||
this->SetHomeOutputDirectory(homeOutputDir);
|
||||
}
|
||||
|
||||
// free generic one if generated
|
||||
|
@ -976,24 +978,22 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const std::string& gname)
|
|||
|
||||
void cmake::SetHomeDirectory(const std::string& dir)
|
||||
{
|
||||
this->cmHomeDirectory = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->cmHomeDirectory);
|
||||
this->State->SetSourceDirectory(dir);
|
||||
}
|
||||
|
||||
const char* cmake::GetHomeDirectory() const
|
||||
{
|
||||
return this->cmHomeDirectory.c_str();
|
||||
return this->State->GetSourceDirectory();
|
||||
}
|
||||
|
||||
void cmake::SetHomeOutputDirectory(const std::string& dir)
|
||||
{
|
||||
this->HomeOutputDirectory = dir;
|
||||
cmSystemTools::ConvertToUnixSlashes(this->HomeOutputDirectory);
|
||||
this->State->SetBinaryDirectory(dir);
|
||||
}
|
||||
|
||||
const char* cmake::GetHomeOutputDirectory() const
|
||||
{
|
||||
return this->HomeOutputDirectory.c_str();
|
||||
return this->State->GetBinaryDirectory();
|
||||
}
|
||||
|
||||
void cmake::SetGlobalGenerator(cmGlobalGenerator *gg)
|
||||
|
|
|
@ -336,8 +336,6 @@ protected:
|
|||
cmPolicies *Policies;
|
||||
cmGlobalGenerator *GlobalGenerator;
|
||||
cmCacheManager *CacheManager;
|
||||
std::string cmHomeDirectory;
|
||||
std::string HomeOutputDirectory;
|
||||
bool SuppressDevWarnings;
|
||||
bool DoSuppressDevWarnings;
|
||||
std::string GeneratorPlatform;
|
||||
|
|
Loading…
Reference in New Issue