cmCPackComponentGroup.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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 cmCPackComponentGroup_h
  11. #define cmCPackComponentGroup_h
  12. #include "cmStandardIncludes.h"
  13. class cmCPackComponentGroup;
  14. /** \class cmCPackInstallationType
  15. * \brief A certain type of installation, which encompasses a
  16. * set of components.
  17. */
  18. class cmCPackInstallationType
  19. {
  20. public:
  21. /// The name of the installation type (used to reference this
  22. /// installation type).
  23. std::string Name;
  24. /// The name of the installation type as displayed to the user.
  25. std::string DisplayName;
  26. /// The index number of the installation type. This is an arbitrary
  27. /// numbering from 1 to the number of installation types.
  28. unsigned Index;
  29. };
  30. /** \class cmCPackComponent
  31. * \brief A single component to be installed by CPack.
  32. */
  33. class cmCPackComponent
  34. {
  35. public:
  36. cmCPackComponent() : Group(0), IsRequired(true), IsHidden(false),
  37. IsDisabledByDefault(false), IsDownloaded(false),
  38. TotalSize(0) { }
  39. /// The name of the component (used to reference the component).
  40. std::string Name;
  41. /// The name of the component as displayed to the user.
  42. std::string DisplayName;
  43. /// The component group that contains this component (if any).
  44. cmCPackComponentGroup *Group;
  45. /// Whether this component group must always be installed.
  46. bool IsRequired : 1;
  47. /// Whether this component group is hidden. A hidden component group
  48. /// is always installed. However, it may still be shown to the user.
  49. bool IsHidden : 1;
  50. /// Whether this component defaults to "disabled".
  51. bool IsDisabledByDefault : 1;
  52. /// Whether this component should be downloaded on-the-fly. If false,
  53. /// the component will be a part of the installation package.
  54. bool IsDownloaded : 1;
  55. /// A description of this component.
  56. std::string Description;
  57. /// The installation types that this component is a part of.
  58. std::vector<cmCPackInstallationType *> InstallationTypes;
  59. /// If IsDownloaded is true, the name of the archive file that
  60. /// contains the files that are part of this component.
  61. std::string ArchiveFile;
  62. /// The components that this component depends on.
  63. std::vector<cmCPackComponent *> Dependencies;
  64. /// The components that depend on this component.
  65. std::vector<cmCPackComponent *> ReverseDependencies;
  66. /// The list of installed files that are part of this component.
  67. std::vector<std::string> Files;
  68. /// The list of installed directories that are part of this component.
  69. std::vector<std::string> Directories;
  70. /// Get the total installed size of all of the files in this
  71. /// component, in bytes. installDir is the directory into which the
  72. /// component was installed.
  73. unsigned long GetInstalledSize(const char* installDir) const;
  74. /// Identical to GetInstalledSize, but returns the result in
  75. /// kilobytes.
  76. unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
  77. private:
  78. mutable unsigned long TotalSize;
  79. };
  80. /** \class cmCPackComponentGroup
  81. * \brief A component group to be installed by CPack.
  82. */
  83. class cmCPackComponentGroup
  84. {
  85. public:
  86. cmCPackComponentGroup() : ParentGroup(0) { }
  87. /// The name of the group (used to reference the group).
  88. std::string Name;
  89. /// The name of the component as displayed to the user.
  90. std::string DisplayName;
  91. /// The description of this component group.
  92. std::string Description;
  93. /// Whether the name of the component will be shown in bold.
  94. bool IsBold : 1;
  95. /// Whether the section should be expanded by default
  96. bool IsExpandedByDefault : 1;
  97. /// The components within this group.
  98. std::vector<cmCPackComponent*> Components;
  99. /// The parent group of this component group (if any).
  100. cmCPackComponentGroup *ParentGroup;
  101. /// The subgroups of this group.
  102. std::vector<cmCPackComponentGroup*> Subgroups;
  103. };
  104. #endif