Introduce the abstract class cmGlobalGeneratorFactory
This new abstract class allows us move some logic from the cmGlobalGenerator into its own layer in a next step.
This commit is contained in:
parent
3359d95c00
commit
e8f841473b
@ -201,6 +201,7 @@ set(SRCS
|
|||||||
cmGeneratorTarget.h
|
cmGeneratorTarget.h
|
||||||
cmGlobalGenerator.cxx
|
cmGlobalGenerator.cxx
|
||||||
cmGlobalGenerator.h
|
cmGlobalGenerator.h
|
||||||
|
cmGlobalGeneratorFactory.h
|
||||||
cmGlobalUnixMakefileGenerator3.cxx
|
cmGlobalUnixMakefileGenerator3.cxx
|
||||||
cmGlobalUnixMakefileGenerator3.h
|
cmGlobalUnixMakefileGenerator3.h
|
||||||
cmGraphAdjacencyList.h
|
cmGraphAdjacencyList.h
|
||||||
|
@ -23,8 +23,9 @@ class cmGlobalBorlandMakefileGenerator : public cmGlobalNMakeMakefileGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalBorlandMakefileGenerator();
|
cmGlobalBorlandMakefileGenerator();
|
||||||
static cmGlobalGenerator* New()
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
{ return new cmGlobalBorlandMakefileGenerator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalBorlandMakefileGenerator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
51
Source/cmGlobalGeneratorFactory.h
Normal file
51
Source/cmGlobalGeneratorFactory.h
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
/*============================================================================
|
||||||
|
CMake - Cross Platform Makefile Generator
|
||||||
|
Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
|
||||||
|
|
||||||
|
Distributed under the OSI-approved BSD License (the "License");
|
||||||
|
see accompanying file Copyright.txt for details.
|
||||||
|
|
||||||
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||||
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
See the License for more information.
|
||||||
|
============================================================================*/
|
||||||
|
|
||||||
|
#ifndef cmGlobalGeneratorFactory_h
|
||||||
|
#define cmGlobalGeneratorFactory_h
|
||||||
|
|
||||||
|
#include "cmStandardIncludes.h"
|
||||||
|
|
||||||
|
class cmGlobalGenerator;
|
||||||
|
struct cmDocumentationEntry;
|
||||||
|
|
||||||
|
/** \class cmGlobalGeneratorFactory
|
||||||
|
* \brief Responable for creating cmGlobalGenerator instances
|
||||||
|
*
|
||||||
|
* Subclasses of this class generate instances of cmGlobalGenerator.
|
||||||
|
*/
|
||||||
|
class cmGlobalGeneratorFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual ~cmGlobalGeneratorFactory() {}
|
||||||
|
|
||||||
|
/** Create a GlobalGenerator */
|
||||||
|
virtual cmGlobalGenerator* CreateGlobalGenerator() const = 0;
|
||||||
|
|
||||||
|
/** Get the documentation entry for this factory */
|
||||||
|
virtual void GetDocumentation(cmDocumentationEntry& entry) const = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
class cmGlobalGeneratorSimpleFactory : public cmGlobalGeneratorFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
/** Create a GlobalGenerator */
|
||||||
|
virtual cmGlobalGenerator* CreateGlobalGenerator() const {
|
||||||
|
return new T; }
|
||||||
|
|
||||||
|
/** Get the documentation entry for this factory */
|
||||||
|
virtual void GetDocumentation(cmDocumentationEntry& entry) const {
|
||||||
|
T().GetDocumentation(entry); }
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -23,8 +23,9 @@ class cmGlobalJOMMakefileGenerator : public cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalJOMMakefileGenerator();
|
cmGlobalJOMMakefileGenerator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalJOMMakefileGenerator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalJOMMakefileGenerator>(); }
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
return cmGlobalJOMMakefileGenerator::GetActualName();}
|
return cmGlobalJOMMakefileGenerator::GetActualName();}
|
||||||
|
@ -23,8 +23,9 @@ class cmGlobalMSYSMakefileGenerator : public cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalMSYSMakefileGenerator();
|
cmGlobalMSYSMakefileGenerator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalMSYSMakefileGenerator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalMSYSMakefileGenerator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -23,8 +23,9 @@ class cmGlobalMinGWMakefileGenerator : public cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalMinGWMakefileGenerator();
|
cmGlobalMinGWMakefileGenerator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalMinGWMakefileGenerator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalMinGWMakefileGenerator>(); }
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
return cmGlobalMinGWMakefileGenerator::GetActualName();}
|
return cmGlobalMinGWMakefileGenerator::GetActualName();}
|
||||||
|
@ -23,8 +23,9 @@ class cmGlobalNMakeMakefileGenerator : public cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalNMakeMakefileGenerator();
|
cmGlobalNMakeMakefileGenerator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalNMakeMakefileGenerator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalNMakeMakefileGenerator>(); }
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
return cmGlobalNMakeMakefileGenerator::GetActualName();}
|
return cmGlobalNMakeMakefileGenerator::GetActualName();}
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
# define cmGlobalNinjaGenerator_h
|
# define cmGlobalNinjaGenerator_h
|
||||||
|
|
||||||
# include "cmGlobalGenerator.h"
|
# include "cmGlobalGenerator.h"
|
||||||
|
# include "cmGlobalGeneratorFactory.h"
|
||||||
# include "cmNinjaTypes.h"
|
# include "cmNinjaTypes.h"
|
||||||
|
|
||||||
//#define NINJA_GEN_VERBOSE_FILES
|
//#define NINJA_GEN_VERBOSE_FILES
|
||||||
@ -160,8 +161,8 @@ public:
|
|||||||
cmGlobalNinjaGenerator();
|
cmGlobalNinjaGenerator();
|
||||||
|
|
||||||
/// Convenience method for creating an instance of this class.
|
/// Convenience method for creating an instance of this class.
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalNinjaGenerator; }
|
return new cmGlobalGeneratorSimpleFactory<cmGlobalNinjaGenerator>(); }
|
||||||
|
|
||||||
/// Destructor.
|
/// Destructor.
|
||||||
virtual ~cmGlobalNinjaGenerator() { }
|
virtual ~cmGlobalNinjaGenerator() { }
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#define cmGlobalUnixMakefileGenerator3_h
|
#define cmGlobalUnixMakefileGenerator3_h
|
||||||
|
|
||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
|
#include "cmGlobalGeneratorFactory.h"
|
||||||
|
|
||||||
class cmGeneratedFileStream;
|
class cmGeneratedFileStream;
|
||||||
class cmMakefileTargetGenerator;
|
class cmMakefileTargetGenerator;
|
||||||
@ -54,8 +55,9 @@ class cmGlobalUnixMakefileGenerator3 : public cmGlobalGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalUnixMakefileGenerator3();
|
cmGlobalUnixMakefileGenerator3();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalUnixMakefileGenerator3; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalUnixMakefileGenerator3>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -25,8 +25,9 @@ class cmGlobalVisualStudio10Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio10Generator();
|
cmGlobalVisualStudio10Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio10Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio10Generator>(); }
|
||||||
|
|
||||||
virtual std::string
|
virtual std::string
|
||||||
GenerateBuildCommand(const char* makeProgram,
|
GenerateBuildCommand(const char* makeProgram,
|
||||||
|
@ -19,8 +19,9 @@ class cmGlobalVisualStudio10IA64Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio10IA64Generator();
|
cmGlobalVisualStudio10IA64Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio10IA64Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio10IA64Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -19,8 +19,9 @@ class cmGlobalVisualStudio10Win64Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio10Win64Generator();
|
cmGlobalVisualStudio10Win64Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio10Win64Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio10Win64Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -19,8 +19,9 @@ class cmGlobalVisualStudio11ARMGenerator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio11ARMGenerator();
|
cmGlobalVisualStudio11ARMGenerator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio11ARMGenerator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio11ARMGenerator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -21,8 +21,9 @@ class cmGlobalVisualStudio11Generator:
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio11Generator();
|
cmGlobalVisualStudio11Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio11Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio11Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -19,8 +19,9 @@ class cmGlobalVisualStudio11Win64Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio11Win64Generator();
|
cmGlobalVisualStudio11Win64Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio11Win64Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio11Win64Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#define cmGlobalVisualStudio6Generator_h
|
#define cmGlobalVisualStudio6Generator_h
|
||||||
|
|
||||||
#include "cmGlobalVisualStudioGenerator.h"
|
#include "cmGlobalVisualStudioGenerator.h"
|
||||||
|
#include "cmGlobalGeneratorFactory.h"
|
||||||
|
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
|
|
||||||
@ -25,8 +26,9 @@ class cmGlobalVisualStudio6Generator : public cmGlobalVisualStudioGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio6Generator();
|
cmGlobalVisualStudio6Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio6Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio6Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -24,8 +24,9 @@ class cmGlobalVisualStudio71Generator : public cmGlobalVisualStudio7Generator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio71Generator();
|
cmGlobalVisualStudio71Generator();
|
||||||
static cmGlobalGenerator* New()
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
{ return new cmGlobalVisualStudio71Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio71Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
#define cmGlobalVisualStudio7Generator_h
|
#define cmGlobalVisualStudio7Generator_h
|
||||||
|
|
||||||
#include "cmGlobalVisualStudioGenerator.h"
|
#include "cmGlobalVisualStudioGenerator.h"
|
||||||
|
#include "cmGlobalGeneratorFactory.h"
|
||||||
|
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
struct cmIDEFlagTable;
|
struct cmIDEFlagTable;
|
||||||
@ -26,8 +27,9 @@ class cmGlobalVisualStudio7Generator : public cmGlobalVisualStudioGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio7Generator();
|
cmGlobalVisualStudio7Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio7Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio7Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -24,8 +24,9 @@ class cmGlobalVisualStudio8Generator : public cmGlobalVisualStudio71Generator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio8Generator();
|
cmGlobalVisualStudio8Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio8Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio8Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -25,8 +25,9 @@ class cmGlobalVisualStudio8Win64Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio8Win64Generator();
|
cmGlobalVisualStudio8Win64Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio8Win64Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio8Win64Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -25,8 +25,9 @@ class cmGlobalVisualStudio9Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio9Generator();
|
cmGlobalVisualStudio9Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio9Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio9Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -25,8 +25,9 @@ class cmGlobalVisualStudio9IA64Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio9IA64Generator();
|
cmGlobalVisualStudio9IA64Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio9IA64Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio9IA64Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -25,8 +25,9 @@ class cmGlobalVisualStudio9Win64Generator :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalVisualStudio9Win64Generator();
|
cmGlobalVisualStudio9Win64Generator();
|
||||||
static cmGlobalGenerator* New() {
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
return new cmGlobalVisualStudio9Win64Generator; }
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalVisualStudio9Win64Generator>(); }
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
|
@ -23,7 +23,9 @@ class cmGlobalWatcomWMakeGenerator : public cmGlobalUnixMakefileGenerator3
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalWatcomWMakeGenerator();
|
cmGlobalWatcomWMakeGenerator();
|
||||||
static cmGlobalGenerator* New() { return new cmGlobalWatcomWMakeGenerator; }
|
static cmGlobalGeneratorFactory* NewFactory() {
|
||||||
|
return new cmGlobalGeneratorSimpleFactory
|
||||||
|
<cmGlobalWatcomWMakeGenerator>(); }
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
return cmGlobalWatcomWMakeGenerator::GetActualName();}
|
return cmGlobalWatcomWMakeGenerator::GetActualName();}
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "cmSourceFile.h"
|
#include "cmSourceFile.h"
|
||||||
#include "cmCustomCommandGenerator.h"
|
#include "cmCustomCommandGenerator.h"
|
||||||
#include "cmGeneratorTarget.h"
|
#include "cmGeneratorTarget.h"
|
||||||
|
#include "cmGlobalGeneratorFactory.h"
|
||||||
|
|
||||||
#include <cmsys/auto_ptr.hxx>
|
#include <cmsys/auto_ptr.hxx>
|
||||||
|
|
||||||
@ -112,6 +113,15 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class cmGlobalXCodeGenerator::Factory : public cmGlobalGeneratorFactory
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual cmGlobalGenerator* CreateGlobalGenerator() const;
|
||||||
|
|
||||||
|
virtual void GetDocumentation(cmDocumentationEntry& entry) const {
|
||||||
|
cmGlobalXCodeGenerator().GetDocumentation(entry); }
|
||||||
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
|
cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
|
||||||
{
|
{
|
||||||
@ -132,7 +142,14 @@ cmGlobalXCodeGenerator::cmGlobalXCodeGenerator(std::string const& version)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
cmGlobalGenerator* cmGlobalXCodeGenerator::New()
|
cmGlobalGeneratorFactory* cmGlobalXCodeGenerator::NewFactory()
|
||||||
|
{
|
||||||
|
return new Factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------
|
||||||
|
cmGlobalGenerator* cmGlobalXCodeGenerator::Factory
|
||||||
|
::CreateGlobalGenerator() const
|
||||||
{
|
{
|
||||||
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
#if defined(CMAKE_BUILD_WITH_CMAKE)
|
||||||
cmXcodeVersionParser parser;
|
cmXcodeVersionParser parser;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "cmGlobalGenerator.h"
|
#include "cmGlobalGenerator.h"
|
||||||
#include "cmXCodeObject.h"
|
#include "cmXCodeObject.h"
|
||||||
#include "cmCustomCommand.h"
|
#include "cmCustomCommand.h"
|
||||||
|
class cmGlobalGeneratorFactory;
|
||||||
class cmTarget;
|
class cmTarget;
|
||||||
class cmSourceFile;
|
class cmSourceFile;
|
||||||
class cmSourceGroup;
|
class cmSourceGroup;
|
||||||
@ -29,7 +30,7 @@ class cmGlobalXCodeGenerator : public cmGlobalGenerator
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cmGlobalXCodeGenerator(std::string const& version);
|
cmGlobalXCodeGenerator(std::string const& version);
|
||||||
static cmGlobalGenerator* New();
|
static cmGlobalGeneratorFactory* NewFactory();
|
||||||
|
|
||||||
///! Get the name for the generator.
|
///! Get the name for the generator.
|
||||||
virtual const char* GetName() const {
|
virtual const char* GetName() const {
|
||||||
@ -186,6 +187,7 @@ private:
|
|||||||
const char* varNameSuffix,
|
const char* varNameSuffix,
|
||||||
const char* default_flags);
|
const char* default_flags);
|
||||||
|
|
||||||
|
class Factory;
|
||||||
class BuildObjectListOrString;
|
class BuildObjectListOrString;
|
||||||
friend class BuildObjectListOrString;
|
friend class BuildObjectListOrString;
|
||||||
|
|
||||||
|
@ -222,6 +222,11 @@ cmake::~cmake()
|
|||||||
{
|
{
|
||||||
delete (*j).second;
|
delete (*j).second;
|
||||||
}
|
}
|
||||||
|
for(RegisteredGeneratorsMap::iterator j = this->Generators.begin();
|
||||||
|
j != this->Generators.end(); ++j)
|
||||||
|
{
|
||||||
|
delete (*j).second;
|
||||||
|
}
|
||||||
#ifdef CMAKE_BUILD_WITH_CMAKE
|
#ifdef CMAKE_BUILD_WITH_CMAKE
|
||||||
delete this->VariableWatch;
|
delete this->VariableWatch;
|
||||||
#endif
|
#endif
|
||||||
@ -1904,7 +1909,7 @@ cmGlobalGenerator* cmake::CreateGlobalGenerator(const char* name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generator = (genIt->second)();
|
generator = genIt->second->CreateGlobalGenerator();
|
||||||
generator->SetCMakeInstance(this);
|
generator->SetCMakeInstance(this);
|
||||||
generator->SetExternalMakefileProjectGenerator(extraGenerator);
|
generator->SetExternalMakefileProjectGenerator(extraGenerator);
|
||||||
return generator;
|
return generator;
|
||||||
@ -2571,54 +2576,54 @@ void cmake::AddDefaultGenerators()
|
|||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
# if !defined(CMAKE_BOOT_MINGW)
|
# if !defined(CMAKE_BOOT_MINGW)
|
||||||
this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio6Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio6Generator::New;
|
cmGlobalVisualStudio6Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio7Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio7Generator::New;
|
cmGlobalVisualStudio7Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio10Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio10Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio10Generator::New;
|
cmGlobalVisualStudio10Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio10IA64Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio10IA64Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio10IA64Generator::New;
|
cmGlobalVisualStudio10IA64Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio10Win64Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio10Win64Generator::New;
|
cmGlobalVisualStudio10Win64Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio11Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio11Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio11Generator::New;
|
cmGlobalVisualStudio11Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio11Win64Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio11Win64Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio11Win64Generator::New;
|
cmGlobalVisualStudio11Win64Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio11ARMGenerator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio11ARMGenerator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio11ARMGenerator::New;
|
cmGlobalVisualStudio11ARMGenerator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio71Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio71Generator::New;
|
cmGlobalVisualStudio71Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio8Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio8Generator::New;
|
cmGlobalVisualStudio8Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio9Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio9Generator::New;
|
cmGlobalVisualStudio9Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio9IA64Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio9IA64Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio9IA64Generator::New;
|
cmGlobalVisualStudio9IA64Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio9Win64Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio9Win64Generator::New;
|
cmGlobalVisualStudio9Win64Generator::NewFactory();
|
||||||
this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] =
|
this->Generators[cmGlobalVisualStudio8Win64Generator::GetActualName()] =
|
||||||
&cmGlobalVisualStudio8Win64Generator::New;
|
cmGlobalVisualStudio8Win64Generator::NewFactory();
|
||||||
this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] =
|
this->Generators[cmGlobalBorlandMakefileGenerator::GetActualName()] =
|
||||||
&cmGlobalBorlandMakefileGenerator::New;
|
cmGlobalBorlandMakefileGenerator::NewFactory();
|
||||||
this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] =
|
this->Generators[cmGlobalNMakeMakefileGenerator::GetActualName()] =
|
||||||
&cmGlobalNMakeMakefileGenerator::New;
|
cmGlobalNMakeMakefileGenerator::NewFactory();
|
||||||
this->Generators[cmGlobalJOMMakefileGenerator::GetActualName()] =
|
this->Generators[cmGlobalJOMMakefileGenerator::GetActualName()] =
|
||||||
&cmGlobalJOMMakefileGenerator::New;
|
cmGlobalJOMMakefileGenerator::NewFactory();
|
||||||
this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] =
|
this->Generators[cmGlobalWatcomWMakeGenerator::GetActualName()] =
|
||||||
&cmGlobalWatcomWMakeGenerator::New;
|
cmGlobalWatcomWMakeGenerator::NewFactory();
|
||||||
# endif
|
# endif
|
||||||
this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] =
|
this->Generators[cmGlobalMSYSMakefileGenerator::GetActualName()] =
|
||||||
&cmGlobalMSYSMakefileGenerator::New;
|
cmGlobalMSYSMakefileGenerator::NewFactory();
|
||||||
this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] =
|
this->Generators[cmGlobalMinGWMakefileGenerator::GetActualName()] =
|
||||||
&cmGlobalMinGWMakefileGenerator::New;
|
cmGlobalMinGWMakefileGenerator::NewFactory();
|
||||||
#endif
|
#endif
|
||||||
this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] =
|
this->Generators[cmGlobalUnixMakefileGenerator3::GetActualName()] =
|
||||||
&cmGlobalUnixMakefileGenerator3::New;
|
cmGlobalUnixMakefileGenerator3::NewFactory();
|
||||||
this->Generators[cmGlobalNinjaGenerator::GetActualName()] =
|
this->Generators[cmGlobalNinjaGenerator::GetActualName()] =
|
||||||
&cmGlobalNinjaGenerator::New;
|
cmGlobalNinjaGenerator::NewFactory();
|
||||||
#ifdef CMAKE_USE_XCODE
|
#ifdef CMAKE_USE_XCODE
|
||||||
this->Generators[cmGlobalXCodeGenerator::GetActualName()] =
|
this->Generators[cmGlobalXCodeGenerator::GetActualName()] =
|
||||||
&cmGlobalXCodeGenerator::New;
|
cmGlobalXCodeGenerator::NewFactory();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2716,9 +2721,7 @@ void cmake::GetGeneratorDocumentation(std::vector<cmDocumentationEntry>& v)
|
|||||||
i != this->Generators.end(); ++i)
|
i != this->Generators.end(); ++i)
|
||||||
{
|
{
|
||||||
cmDocumentationEntry e;
|
cmDocumentationEntry e;
|
||||||
cmGlobalGenerator* generator = (i->second)();
|
i->second->GetDocumentation(e);
|
||||||
generator->GetDocumentation(e);
|
|
||||||
delete generator;
|
|
||||||
v.push_back(e);
|
v.push_back(e);
|
||||||
}
|
}
|
||||||
for(RegisteredExtraGeneratorsMap::const_iterator
|
for(RegisteredExtraGeneratorsMap::const_iterator
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "cmPropertyDefinitionMap.h"
|
#include "cmPropertyDefinitionMap.h"
|
||||||
#include "cmPropertyMap.h"
|
#include "cmPropertyMap.h"
|
||||||
|
|
||||||
|
class cmGlobalGeneratorFactory;
|
||||||
class cmGlobalGenerator;
|
class cmGlobalGenerator;
|
||||||
class cmLocalGenerator;
|
class cmLocalGenerator;
|
||||||
class cmCacheManager;
|
class cmCacheManager;
|
||||||
@ -396,10 +397,8 @@ protected:
|
|||||||
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
|
cmExternalMakefileProjectGenerator* (*CreateExtraGeneratorFunctionType)();
|
||||||
typedef std::map<cmStdString,
|
typedef std::map<cmStdString,
|
||||||
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
|
CreateExtraGeneratorFunctionType> RegisteredExtraGeneratorsMap;
|
||||||
|
|
||||||
typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
|
|
||||||
typedef std::map<cmStdString,
|
typedef std::map<cmStdString,
|
||||||
CreateGeneratorFunctionType> RegisteredGeneratorsMap;
|
cmGlobalGeneratorFactory*> RegisteredGeneratorsMap;
|
||||||
RegisteredCommandsMap Commands;
|
RegisteredCommandsMap Commands;
|
||||||
RegisteredGeneratorsMap Generators;
|
RegisteredGeneratorsMap Generators;
|
||||||
RegisteredExtraGeneratorsMap ExtraGenerators;
|
RegisteredExtraGeneratorsMap ExtraGenerators;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user