cmCPackComponentGroup.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmCPackComponentGroup_h
  14. #define cmCPackComponentGroup_h
  15. #include <map>
  16. #include <string>
  17. #include <vector>
  18. class cmCPackComponentGroup;
  19. /** \class cmCPackInstallationType
  20. * \brief A certain type of installation, which encompasses a
  21. * set of components.
  22. */
  23. class cmCPackInstallationType
  24. {
  25. public:
  26. /// The name of the installation type (used to reference this
  27. /// installation type).
  28. std::string Name;
  29. /// The name of the installation type as displayed to the user.
  30. std::string DisplayName;
  31. /// The index number of the installation type. This is an arbitrary
  32. /// numbering from 1 to the number of installation types.
  33. unsigned Index;
  34. };
  35. /** \class cmCPackComponent
  36. * \brief A single component to be installed by CPack.
  37. */
  38. class cmCPackComponent
  39. {
  40. public:
  41. cmCPackComponent() : Group(0), TotalSize(0) { }
  42. /// The name of the component (used to reference the component).
  43. std::string Name;
  44. /// The name of the component as displayed to the user.
  45. std::string DisplayName;
  46. /// The component group that contains this component (if any).
  47. cmCPackComponentGroup *Group;
  48. /// Whether this component group must always be installed.
  49. bool IsRequired : 1;
  50. /// Whether this component group is hidden. A hidden component group
  51. /// is always installed. However, it may still be shown to the user.
  52. bool IsHidden : 1;
  53. /// Whether this component defaults to "disabled".
  54. bool IsDisabledByDefault : 1;
  55. /// Whether this component should be downloaded on-the-fly. If false,
  56. /// the component will be a part of the installation package.
  57. bool IsDownloaded : 1;
  58. /// A description of this component.
  59. std::string Description;
  60. /// The installation types that this component is a part of.
  61. std::vector<cmCPackInstallationType *> InstallationTypes;
  62. /// If IsDownloaded is true, the name of the archive file that
  63. /// contains the files that are part of this component.
  64. std::string ArchiveFile;
  65. /// The components that this component depends on.
  66. std::vector<cmCPackComponent *> Dependencies;
  67. /// The components that depend on this component.
  68. std::vector<cmCPackComponent *> ReverseDependencies;
  69. /// The list of installed files that are part of this component.
  70. std::vector<std::string> Files;
  71. /// The list of installed directories that are part of this component.
  72. std::vector<std::string> Directories;
  73. /// Get the total installed size of all of the files in this
  74. /// component, in bytes. installDir is the directory into which the
  75. /// component was installed.
  76. unsigned long GetInstalledSize(const char* installDir) const;
  77. /// Identical to GetInstalledSize, but returns the result in
  78. /// kilobytes.
  79. unsigned long GetInstalledSizeInKbytes(const char* installDir) const;
  80. private:
  81. mutable unsigned long TotalSize;
  82. };
  83. /** \class cmCPackComponentGroup
  84. * \brief A component group to be installed by CPack.
  85. */
  86. class cmCPackComponentGroup
  87. {
  88. public:
  89. cmCPackComponentGroup() : ParentGroup(0) { }
  90. /// The name of the group (used to reference the group).
  91. std::string Name;
  92. /// The name of the component as displayed to the user.
  93. std::string DisplayName;
  94. /// The description of this component group.
  95. std::string Description;
  96. /// Whether the name of the component will be shown in bold.
  97. bool IsBold : 1;
  98. /// Whether the section should be expanded by default
  99. bool IsExpandedByDefault : 1;
  100. /// The components within this group.
  101. std::vector<cmCPackComponent*> Components;
  102. /// The parent group of this component group (if any).
  103. cmCPackComponentGroup *ParentGroup;
  104. /// The subgroups of this group.
  105. std::vector<cmCPackComponentGroup*> Subgroups;
  106. };
  107. #endif