cmCPackIFWPackage.h 3.5 KB

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