cmCPackGeneratorFactory.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. { return this->GeneratorDescriptions; }
  36. private:
  37. cmCPackGenerator* NewGeneratorInternal(const std::string& name);
  38. std::vector<cmCPackGenerator*> Generators;
  39. typedef std::map<std::string, CreateGeneratorCall*> t_GeneratorCreatorsMap;
  40. t_GeneratorCreatorsMap GeneratorCreators;
  41. DescriptionsMap GeneratorDescriptions;
  42. cmCPackLog* Logger;
  43. };
  44. #endif