cmCPackComponentGroup.h 4.3 KB

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