cmCPackComponentGroup.h 4.1 KB

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