1
0

cmCPackIFWPackage.h 3.6 KB

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