cmCPackIFWPackage.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 cmCPackIFWPackage
  18. * \brief A single component to be installed by CPack IFW generator
  19. */
  20. class cmCPackIFWPackage
  21. {
  22. public: // Types
  23. enum CompareTypes
  24. {
  25. CompareNone = 0x0,
  26. CompareEqual = 0x1,
  27. CompareLess = 0x2,
  28. CompareLessOrEqual = 0x3,
  29. CompareGreater = 0x4,
  30. CompareGreaterOrEqual = 0x5
  31. };
  32. struct CompareStruct
  33. {
  34. CompareStruct();
  35. unsigned int Type;
  36. std::string Value;
  37. };
  38. struct DependenceStruct
  39. {
  40. DependenceStruct();
  41. DependenceStruct(const std::string &dependence);
  42. std::string Name;
  43. CompareStruct Compare;
  44. std::string NameWithCompare() const;
  45. bool operator < (const DependenceStruct &other) const
  46. {
  47. return Name < other.Name;
  48. }
  49. };
  50. public: // [Con|De]structor
  51. /**
  52. * Construct package
  53. */
  54. cmCPackIFWPackage();
  55. public: // 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. /// Priority of the component in the tree
  71. std::string SortingPriority;
  72. /// Set to true to preselect the component in the installer
  73. std::string Default;
  74. /// Set to true to hide the component from the installer
  75. std::string Virtual;
  76. /// Determines that the package must always be installed
  77. std::string ForcedInstallation;
  78. public: // Internal implementation
  79. const char* GetOption(const std::string& op) const;
  80. bool IsOn(const std::string& op) const;
  81. std::string GetComponentName(cmCPackComponent *component);
  82. void DefaultConfiguration();
  83. int ConfigureFromOptions();
  84. int ConfigureFromComponent(cmCPackComponent *component);
  85. int ConfigureFromGroup(cmCPackComponentGroup *group);
  86. int ConfigureFromGroup(const std::string &groupName);
  87. void GeneratePackageFile();
  88. // Pointer to generator
  89. cmCPackIFWGenerator* Generator;
  90. // Pointer to installer
  91. cmCPackIFWInstaller* Installer;
  92. // Collection of dependencies
  93. std::set<cmCPackIFWPackage*> Dependencies;
  94. // Collection of unresolved dependencies
  95. std::set<DependenceStruct*> AlienDependencies;
  96. // Patch to package directory
  97. std::string Directory;
  98. };
  99. #endif // cmCPackIFWPackage_h