cmake/Source/CPack/IFW/cmCPackIFWGenerator.h

166 lines
4.4 KiB
C
Raw Normal View History

2016-10-30 18:24:19 +01:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
2015-04-27 22:25:09 +02:00
#ifndef cmCPackIFWGenerator_h
#define cmCPackIFWGenerator_h
2016-10-30 18:24:19 +01:00
#include <cmConfigure.h>
2015-04-27 22:25:09 +02:00
2016-10-30 18:24:19 +01:00
#include "CPack/cmCPackComponentGroup.h"
#include "CPack/cmCPackGenerator.h"
2015-04-27 22:25:09 +02:00
#include "cmCPackIFWInstaller.h"
2016-07-09 11:21:54 +02:00
#include "cmCPackIFWPackage.h"
#include "cmCPackIFWRepository.h"
2016-10-30 18:24:19 +01:00
#include "cmTypeMacro.h"
#include <map>
#include <set>
#include <string>
#include <vector>
2016-07-09 11:21:54 +02:00
class cmXMLWriter;
2015-04-27 22:25:09 +02:00
/** \class cmCPackIFWGenerator
* \brief A generator for Qt Installer Framework tools
*
* http://qt-project.org/doc/qtinstallerframework/index.html
*/
class cmCPackIFWGenerator : public cmCPackGenerator
{
public:
cmCPackTypeMacro(cmCPackIFWGenerator, cmCPackGenerator);
typedef std::map<std::string, cmCPackIFWPackage> PackagesMap;
2016-07-09 11:21:54 +02:00
typedef std::map<std::string, cmCPackIFWRepository> RepositoriesMap;
2015-04-27 22:25:09 +02:00
typedef std::map<std::string, cmCPackComponent> ComponentsMap;
typedef std::map<std::string, cmCPackComponentGroup> ComponentGoupsMap;
typedef std::map<std::string, cmCPackIFWPackage::DependenceStruct>
DependenceMap;
/**
* Construct IFW generator
*/
cmCPackIFWGenerator();
/**
* Destruct IFW generator
*/
2016-10-30 18:24:19 +01:00
~cmCPackIFWGenerator() CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
2015-08-17 11:37:30 +02:00
/**
* Compare \a version with QtIFW framework version
*/
2016-07-09 11:21:54 +02:00
bool IsVersionLess(const char* version);
2015-08-17 11:37:30 +02:00
/**
* Compare \a version with QtIFW framework version
*/
2016-07-09 11:21:54 +02:00
bool IsVersionGreater(const char* version);
2015-08-17 11:37:30 +02:00
/**
* Compare \a version with QtIFW framework version
*/
2016-07-09 11:21:54 +02:00
bool IsVersionEqual(const char* version);
2015-08-17 11:37:30 +02:00
2016-07-09 11:21:54 +02:00
protected:
// cmCPackGenerator reimplementation
2015-04-27 22:25:09 +02:00
/**
* @brief Initialize generator
* @return 0 on failure
*/
2016-10-30 18:24:19 +01:00
int InitializeInternal() CM_OVERRIDE;
int PackageFiles() CM_OVERRIDE;
const char* GetPackagingInstallPrefix() CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
/**
* @brief Extension of binary installer
* @return Executable suffix or value from default implementation
*/
2016-10-30 18:24:19 +01:00
const char* GetOutputExtension() CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
2016-10-30 18:24:19 +01:00
std::string GetComponentInstallDirNameSuffix(
const std::string& componentName) CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
/**
* @brief Get Component
* @param projectName Project name
* @param componentName Component name
*
* This method calls the base implementation.
*
* @return Pointer to component
*/
2016-10-30 18:24:19 +01:00
cmCPackComponent* GetComponent(const std::string& projectName,
const std::string& componentName) CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
/**
* @brief Get group of component
* @param projectName Project name
* @param groupName Component group name
*
* This method calls the base implementation.
*
* @return Pointer to component group
*/
2016-10-30 18:24:19 +01:00
cmCPackComponentGroup* GetComponentGroup(
const std::string& projectName, const std::string& groupName) CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
2016-10-30 18:24:19 +01:00
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const
CM_OVERRIDE;
bool SupportsAbsoluteDestination() const CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
protected:
// Methods
2015-04-27 22:25:09 +02:00
bool IsOnePackage() const;
std::string GetRootPackageName();
2016-07-09 11:21:54 +02:00
std::string GetGroupPackageName(cmCPackComponentGroup* group) const;
std::string GetComponentPackageName(cmCPackComponent* component) const;
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
cmCPackIFWRepository* GetRepository(const std::string& repositoryName);
2015-04-27 22:25:09 +02:00
2016-07-09 11:21:54 +02:00
void WriteGeneratedByToStrim(cmXMLWriter& xout);
2015-08-17 11:37:30 +02:00
2016-07-09 11:21:54 +02:00
protected:
// Data
2015-04-27 22:25:09 +02:00
friend class cmCPackIFWPackage;
friend class cmCPackIFWInstaller;
2016-07-09 11:21:54 +02:00
friend class cmCPackIFWRepository;
2015-04-27 22:25:09 +02:00
// Installer
cmCPackIFWInstaller Installer;
2016-07-09 11:21:54 +02:00
// Repository
cmCPackIFWRepository Repository;
2015-04-27 22:25:09 +02:00
// Collection of packages
PackagesMap Packages;
2016-07-09 11:21:54 +02:00
// Collection of repositories
RepositoriesMap Repositories;
2015-04-27 22:25:09 +02:00
// Collection of binary packages
std::set<cmCPackIFWPackage*> BinaryPackages;
// Collection of downloaded packages
std::set<cmCPackIFWPackage*> DownloadedPackages;
// Dependent packages
DependenceMap DependentPackages;
std::map<cmCPackComponent*, cmCPackIFWPackage*> ComponentPackages;
std::map<cmCPackComponentGroup*, cmCPackIFWPackage*> GroupPackages;
private:
std::string RepoGen;
std::string BinCreator;
2015-08-17 11:37:30 +02:00
std::string FrameworkVersion;
std::string ExecutableSuffix;
2015-04-27 22:25:09 +02:00
bool OnlineOnly;
bool ResolveDuplicateNames;
std::vector<std::string> PkgsDirsVector;
};
#endif