cmCPackIFWPackage.h 3.5 KB

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