cmCPackGeneratorFactory.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc.
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmCPackGeneratorFactory_h
  11. #define cmCPackGeneratorFactory_h
  12. #include "cmObject.h"
  13. class cmCPackLog;
  14. class cmCPackGenerator;
  15. /** \class cmCPackGeneratorFactory
  16. * \brief A container for CPack generators
  17. *
  18. */
  19. class cmCPackGeneratorFactory : public cmObject
  20. {
  21. public:
  22. cmTypeMacro(cmCPackGeneratorFactory, cmObject);
  23. cmCPackGeneratorFactory();
  24. ~cmCPackGeneratorFactory();
  25. //! Get the generator
  26. cmCPackGenerator* NewGenerator(const std::string& name);
  27. void DeleteGenerator(cmCPackGenerator* gen);
  28. typedef cmCPackGenerator* CreateGeneratorCall();
  29. void RegisterGenerator(const std::string& name,
  30. const char* generatorDescription,
  31. CreateGeneratorCall* createGenerator);
  32. void SetLogger(cmCPackLog* logger) { this->Logger = logger; }
  33. typedef std::map<std::string, std::string> DescriptionsMap;
  34. const DescriptionsMap& GetGeneratorsList() const
  35. {
  36. return this->GeneratorDescriptions;
  37. }
  38. private:
  39. cmCPackGenerator* NewGeneratorInternal(const std::string& name);
  40. std::vector<cmCPackGenerator*> Generators;
  41. typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
  42. t_GeneratorCreatorsMap GeneratorCreators;
  43. DescriptionsMap GeneratorDescriptions;
  44. cmCPackLog* Logger;
  45. };
  46. #endif