cmCPackArchiveGenerator.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 cmCPackArchiveGenerator_h
  11. #define cmCPackArchiveGenerator_h
  12. #include "cmCPackGenerator.h"
  13. #include "cmArchiveWrite.h"
  14. /** \class cmCPackArchiveGenerator
  15. * \brief A generator base for libarchive generation.
  16. * The generator itself uses the libarchive wrapper
  17. * \ref cmArchiveWrite.
  18. *
  19. */
  20. class cmCPackArchiveGenerator : public cmCPackGenerator
  21. {
  22. public:
  23. cmTypeMacro(cmCPackArchiveGenerator, cmCPackGenerator);
  24. /**
  25. * Construct generator
  26. */
  27. cmCPackArchiveGenerator(cmArchiveWrite::Compress, std::string const& format);
  28. virtual ~cmCPackArchiveGenerator();
  29. // Used to add a header to the archive
  30. virtual int GenerateHeader(std::ostream* os);
  31. // component support
  32. virtual bool SupportsComponentInstallation() const;
  33. protected:
  34. virtual int InitializeInternal();
  35. /**
  36. * Add the files belonging to the specified component
  37. * to the provided (already opened) archive.
  38. * @param[in,out] archive the archive object
  39. * @param[in] component the component whose file will be added to archive
  40. */
  41. int addOneComponentToArchive(cmArchiveWrite& archive,
  42. cmCPackComponent* component);
  43. /**
  44. * The main package file method.
  45. * If component install was required this
  46. * method will call either PackageComponents or
  47. * PackageComponentsAllInOne.
  48. */
  49. int PackageFiles();
  50. /**
  51. * The method used to package files when component
  52. * install is used. This will create one
  53. * archive for each component group.
  54. */
  55. int PackageComponents(bool ignoreGroup);
  56. /**
  57. * Special case of component install where all
  58. * components will be put in a single installer.
  59. */
  60. int PackageComponentsAllInOne();
  61. virtual const char* GetOutputExtension() = 0;
  62. cmArchiveWrite::Compress Compress;
  63. std::string ArchiveFormat;
  64. };
  65. #endif