cmCPackIFWGenerator.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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(const std::string& projectName,
  76. const std::string& componentName);
  77. /**
  78. * @brief Get group of component
  79. * @param projectName Project name
  80. * @param groupName Component group name
  81. *
  82. * This method calls the base implementation.
  83. *
  84. * @return Pointer to component group
  85. */
  86. virtual cmCPackComponentGroup* GetComponentGroup(
  87. const std::string& projectName, const std::string& groupName);
  88. enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const;
  89. virtual bool SupportsAbsoluteDestination() const;
  90. virtual bool SupportsComponentInstallation() const;
  91. protected:
  92. // Methods
  93. bool IsOnePackage() const;
  94. std::string GetRootPackageName();
  95. std::string GetGroupPackageName(cmCPackComponentGroup* group) const;
  96. std::string GetComponentPackageName(cmCPackComponent* component) const;
  97. cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
  98. cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
  99. void WriteGeneratedByToStrim(cmXMLWriter& xout);
  100. protected:
  101. // Data
  102. friend class cmCPackIFWPackage;
  103. friend class cmCPackIFWInstaller;
  104. // Installer
  105. cmCPackIFWInstaller Installer;
  106. // Collection of packages
  107. PackagesMap Packages;
  108. // Collection of binary packages
  109. std::set<cmCPackIFWPackage*> BinaryPackages;
  110. // Collection of downloaded packages
  111. std::set<cmCPackIFWPackage*> DownloadedPackages;
  112. // Dependent packages
  113. DependenceMap DependentPackages;
  114. std::map<cmCPackComponent*, cmCPackIFWPackage*> ComponentPackages;
  115. std::map<cmCPackComponentGroup*, cmCPackIFWPackage*> GroupPackages;
  116. private:
  117. std::string RepoGen;
  118. std::string BinCreator;
  119. std::string FrameworkVersion;
  120. std::string ExecutableSuffix;
  121. bool OnlineOnly;
  122. bool ResolveDuplicateNames;
  123. std::vector<std::string> PkgsDirsVector;
  124. };
  125. #endif