cmCPackComponentGroup.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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()
  37. : Group(0)
  38. , IsRequired(true)
  39. , IsHidden(false)
  40. , IsDisabledByDefault(false)
  41. , IsDownloaded(false)
  42. , TotalSize(0)
  43. {
  44. }
  45. /// The name of the component (used to reference the component).
  46. std::string Name;
  47. /// The name of the component as displayed to the user.
  48. std::string DisplayName;
  49. /// The component group that contains this component (if any).
  50. cmCPackComponentGroup* Group;
  51. /// Whether this component group must always be installed.
  52. bool IsRequired : 1;
  53. /// Whether this component group is hidden. A hidden component group
  54. /// is always installed. However, it may still be shown to the user.
  55. bool IsHidden : 1;
  56. /// Whether this component defaults to "disabled".
  57. bool IsDisabledByDefault : 1;
  58. /// Whether this component should be downloaded on-the-fly. If false,
  59. /// the component will be a part of the installation package.
  60. bool IsDownloaded : 1;
  61. /// A description of this component.
  62. std::string Description;
  63. /// The installation types that this component is a part of.
  64. std::vector<cmCPackInstallationType*> InstallationTypes;
  65. /// If IsDownloaded is true, the name of the archive file that
  66. /// contains the files that are part of this component.
  67. std::string ArchiveFile;
  68. /// The components that this component depends on.
  69. std::vector<cmCPackComponent*> Dependencies;
  70. /// The components that depend on this component.
  71. std::vector<cmCPackComponent*> ReverseDependencies;
  72. /// The list of installed files that are part of this component.
  73. std::vector<std::string> Files;
  74. /// The list of installed directories that are part of this component.
  75. std::vector<std::string> Directories;
  76. /// Get the total installed size of all of the files in this
  77. /// component, in bytes. installDir is the directory into which the
  78. /// component was installed.
  79. unsigned long GetInstalledSize(const std::string& installDir) const;
  80. /// Identical to GetInstalledSize, but returns the result in
  81. /// kilobytes.
  82. unsigned long GetInstalledSizeInKbytes(const std::string& installDir) const;
  83. private:
  84. mutable unsigned long TotalSize;
  85. };
  86. /** \class cmCPackComponentGroup
  87. * \brief A component group to be installed by CPack.
  88. */
  89. class cmCPackComponentGroup
  90. {
  91. public:
  92. cmCPackComponentGroup()
  93. : ParentGroup(0)
  94. {
  95. }
  96. /// The name of the group (used to reference the group).
  97. std::string Name;
  98. /// The name of the component as displayed to the user.
  99. std::string DisplayName;
  100. /// The description of this component group.
  101. std::string Description;
  102. /// Whether the name of the component will be shown in bold.
  103. bool IsBold : 1;
  104. /// Whether the section should be expanded by default
  105. bool IsExpandedByDefault : 1;
  106. /// The components within this group.
  107. std::vector<cmCPackComponent*> Components;
  108. /// The parent group of this component group (if any).
  109. cmCPackComponentGroup* ParentGroup;
  110. /// The subgroups of this group.
  111. std::vector<cmCPackComponentGroup*> Subgroups;
  112. };
  113. #endif