cmCPackIFWGenerator.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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 cmCPackIFWGenerator_h
  11. #define cmCPackIFWGenerator_h
  12. #include <CPack/cmCPackGenerator.h>
  13. #include "cmCPackIFWInstaller.h"
  14. #include "cmCPackIFWPackage.h"
  15. class cmXMLWriter;
  16. /** \class cmCPackIFWGenerator
  17. * \brief A generator for Qt Installer Framework tools
  18. *
  19. * http://qt-project.org/doc/qtinstallerframework/index.html
  20. */
  21. class cmCPackIFWGenerator : public cmCPackGenerator
  22. {
  23. public:
  24. cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);
  25. typedef std::map<std::string, cmCPackIFWPackage> PackagesMap;
  26. typedef std::map<std::string, cmCPackComponent> ComponentsMap;
  27. typedef std::map<std::string, cmCPackComponentGroup> ComponentGoupsMap;
  28. typedef std::map<std::string, cmCPackIFWPackage::DependenceStruct>
  29. DependenceMap;
  30. /**
  31. * Construct IFW generator
  32. */
  33. cmCPackIFWGenerator();
  34. /**
  35. * Destruct IFW generator
  36. */
  37. virtual ~cmCPackIFWGenerator();
  38. /**
  39. * Compare \a version with QtIFW framework version
  40. */
  41. bool IsVersionLess(const char *version);
  42. /**
  43. * Compare \a version with QtIFW framework version
  44. */
  45. bool IsVersionGreater(const char *version);
  46. /**
  47. * Compare \a version with QtIFW framework version
  48. */
  49. bool IsVersionEqual(const char *version);
  50. protected:
  51. // cmCPackGenerator reimplementation
  52. /**
  53. * @brief Initialize generator
  54. * @return 0 on failure
  55. */
  56. virtual int InitializeInternal();
  57. virtual int PackageFiles();
  58. virtual const char* GetPackagingInstallPrefix();
  59. /**
  60. * @brief Extension of binary installer
  61. * @return Executable suffix or value from default implementation
  62. */
  63. virtual const char* GetOutputExtension();
  64. virtual std::string GetComponentInstallDirNameSuffix(
  65. const std::string& componentName);
  66. /**
  67. * @brief Get Component
  68. * @param projectName Project name
  69. * @param componentName Component name
  70. *
  71. * This method calls the base implementation.
  72. *
  73. * @return Pointer to component
  74. */
  75. virtual cmCPackComponent* GetComponent(
  76. const std::string& projectName,
  77. const std::string& componentName);
  78. /**
  79. * @brief Get group of component
  80. * @param projectName Project name
  81. * @param groupName Component group name
  82. *
  83. * This method calls the base implementation.
  84. *
  85. * @return Pointer to component group
  86. */
  87. virtual cmCPackComponentGroup* GetComponentGroup(
  88. const std::string& projectName,
  89. const std::string& groupName);
  90. enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const;
  91. virtual bool SupportsAbsoluteDestination() const;
  92. virtual bool SupportsComponentInstallation() const;
  93. protected:
  94. // Methods
  95. bool IsOnePackage() const;
  96. std::string GetRootPackageName();
  97. std::string GetGroupPackageName(cmCPackComponentGroup *group) const;
  98. std::string GetComponentPackageName(cmCPackComponent *component) const;
  99. cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup *group) const;
  100. cmCPackIFWPackage* GetComponentPackage(cmCPackComponent *component) const;
  101. void WriteGeneratedByToStrim(cmXMLWriter& xout);
  102. protected:
  103. // Data
  104. friend class cmCPackIFWPackage;
  105. friend class cmCPackIFWInstaller;
  106. // Installer
  107. cmCPackIFWInstaller Installer;
  108. // Collection of packages
  109. PackagesMap Packages;
  110. // Collection of binary packages
  111. std::set<cmCPackIFWPackage*> BinaryPackages;
  112. // Collection of downloaded packages
  113. std::set<cmCPackIFWPackage*> DownloadedPackages;
  114. // Dependent packages
  115. DependenceMap DependentPackages;
  116. std::map<cmCPackComponent*, cmCPackIFWPackage*> ComponentPackages;
  117. std::map<cmCPackComponentGroup*, cmCPackIFWPackage*> GroupPackages;
  118. private:
  119. std::string RepoGen;
  120. std::string BinCreator;
  121. std::string FrameworkVersion;
  122. std::string ExecutableSuffix;
  123. bool OnlineOnly;
  124. bool ResolveDuplicateNames;
  125. std::vector<std::string> PkgsDirsVector;
  126. };
  127. #endif