cmCPackIFWPackage.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCPackIFWPackage_h
  4. #define cmCPackIFWPackage_h
  5. #include <cmConfigure.h> // IWYU pragma: keep
  6. #include <set>
  7. #include <string>
  8. #include <vector>
  9. class cmCPackComponent;
  10. class cmCPackComponentGroup;
  11. class cmCPackIFWGenerator;
  12. class cmCPackIFWInstaller;
  13. class cmXMLWriter;
  14. /** \class cmCPackIFWPackage
  15. * \brief A single component to be installed by CPack IFW generator
  16. */
  17. class cmCPackIFWPackage
  18. {
  19. public:
  20. // Types
  21. enum CompareTypes
  22. {
  23. CompareNone = 0x0,
  24. CompareEqual = 0x1,
  25. CompareLess = 0x2,
  26. CompareLessOrEqual = 0x3,
  27. CompareGreater = 0x4,
  28. CompareGreaterOrEqual = 0x5
  29. };
  30. struct CompareStruct
  31. {
  32. CompareStruct();
  33. unsigned int Type;
  34. std::string Value;
  35. };
  36. struct DependenceStruct
  37. {
  38. DependenceStruct();
  39. DependenceStruct(const std::string& dependence);
  40. std::string Name;
  41. CompareStruct Compare;
  42. std::string NameWithCompare() const;
  43. bool operator<(const DependenceStruct& other) const
  44. {
  45. return Name < other.Name;
  46. }
  47. };
  48. public:
  49. // [Con|De]structor
  50. /**
  51. * Construct package
  52. */
  53. cmCPackIFWPackage();
  54. public:
  55. // Configuration
  56. /// Human-readable name of the component
  57. std::string DisplayName;
  58. /// Human-readable description of the component
  59. std::string Description;
  60. /// Version number of the component
  61. std::string Version;
  62. /// Date when this component version was released
  63. std::string ReleaseDate;
  64. /// Domain-like identification for this component
  65. std::string Name;
  66. /// File name of a script being loaded
  67. std::string Script;
  68. /// List of license agreements to be accepted by the installing user
  69. std::vector<std::string> Licenses;
  70. /// List of pages to load
  71. std::vector<std::string> UserInterfaces;
  72. /// Priority of the component in the tree
  73. std::string SortingPriority;
  74. /// Set to true to preselect the component in the installer
  75. std::string Default;
  76. /// Marks the package as essential to force a restart of the MaintenanceTool
  77. std::string Essential;
  78. /// Set to true to hide the component from the installer
  79. std::string Virtual;
  80. /// Determines that the package must always be installed
  81. std::string ForcedInstallation;
  82. public:
  83. // Internal implementation
  84. const char* GetOption(const std::string& op) const;
  85. bool IsOn(const std::string& op) const;
  86. bool IsSetToOff(const std::string& op) const;
  87. bool IsSetToEmpty(const std::string& op) const;
  88. bool IsVersionLess(const char* version);
  89. bool IsVersionGreater(const char* version);
  90. bool IsVersionEqual(const char* version);
  91. std::string GetComponentName(cmCPackComponent* component);
  92. void DefaultConfiguration();
  93. int ConfigureFromOptions();
  94. int ConfigureFromComponent(cmCPackComponent* component);
  95. int ConfigureFromGroup(cmCPackComponentGroup* group);
  96. int ConfigureFromGroup(const std::string& groupName);
  97. int ConfigureFromPrefix(const std::string& prefix);
  98. void GeneratePackageFile();
  99. // Pointer to generator
  100. cmCPackIFWGenerator* Generator;
  101. // Pointer to installer
  102. cmCPackIFWInstaller* Installer;
  103. // Collection of dependencies
  104. std::set<cmCPackIFWPackage*> Dependencies;
  105. // Collection of unresolved dependencies
  106. std::set<DependenceStruct*> AlienDependencies;
  107. // Patch to package directory
  108. std::string Directory;
  109. protected:
  110. void WriteGeneratedByToStrim(cmXMLWriter& xout);
  111. };
  112. #endif // cmCPackIFWPackage_h