CMake/Source/CPack/cmCPackGeneratorFactory.h

69 lines
1.9 KiB
C
Raw Normal View History

/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc.
2006-01-02 07:21:05 +03:00
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
2006-01-02 07:21:05 +03:00
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.
============================================================================*/
2006-01-02 07:21:05 +03:00
2007-11-06 00:33:19 +03:00
#ifndef cmCPackGeneratorFactory_h
#define cmCPackGeneratorFactory_h
2006-01-02 07:21:05 +03:00
2016-09-07 01:21:35 +03:00
#include <cmConfigure.h>
2006-01-02 07:21:05 +03:00
#include "cmObject.h"
2016-09-07 01:21:35 +03:00
#include "cmTypeMacro.h"
#include <map>
#include <string>
#include <vector>
2006-01-02 07:21:05 +03:00
2007-11-06 00:55:45 +03:00
class cmCPackGenerator;
2016-09-07 01:21:35 +03:00
class cmCPackLog;
2006-01-02 07:21:05 +03:00
2007-11-06 00:33:19 +03:00
/** \class cmCPackGeneratorFactory
2006-01-02 07:21:05 +03:00
* \brief A container for CPack generators
*
*/
2007-11-06 00:33:19 +03:00
class cmCPackGeneratorFactory : public cmObject
2006-01-02 07:21:05 +03:00
{
public:
2007-11-06 00:33:19 +03:00
cmTypeMacro(cmCPackGeneratorFactory, cmObject);
2006-01-02 07:21:05 +03:00
2007-11-06 00:33:19 +03:00
cmCPackGeneratorFactory();
2016-06-27 22:25:27 +03:00
~cmCPackGeneratorFactory() CM_OVERRIDE;
2006-01-02 07:21:05 +03:00
//! Get the generator
cmCPackGenerator* NewGenerator(const std::string& name);
2007-11-06 00:55:45 +03:00
void DeleteGenerator(cmCPackGenerator* gen);
2006-01-02 07:21:05 +03:00
2007-11-06 00:55:45 +03:00
typedef cmCPackGenerator* CreateGeneratorCall();
2006-01-02 07:21:05 +03:00
void RegisterGenerator(const std::string& name,
const char* generatorDescription,
CreateGeneratorCall* createGenerator);
2006-01-02 07:21:05 +03:00
2006-03-10 21:06:26 +03:00
void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
2006-01-03 00:14:21 +03:00
typedef std::map<std::string, std::string> DescriptionsMap;
2006-05-03 01:52:22 +04:00
const DescriptionsMap& GetGeneratorsList() const
{
return this->GeneratorDescriptions;
}
2006-05-03 01:52:22 +04:00
2006-01-02 07:21:05 +03:00
private:
cmCPackGenerator* NewGeneratorInternal(const std::string& name);
2007-11-06 00:55:45 +03:00
std::vector<cmCPackGenerator*> Generators;
2006-01-02 07:21:05 +03:00
typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
2006-03-10 21:06:26 +03:00
t_GeneratorCreatorsMap GeneratorCreators;
2006-05-03 01:52:22 +04:00
DescriptionsMap GeneratorDescriptions;
2006-03-10 21:06:26 +03:00
cmCPackLog* Logger;
2006-01-02 07:21:05 +03:00
};
#endif