2014-08-06 19:23:00 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
|
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
|
|
|
|
|
|
|
#ifndef cmCPackIFWGenerator_h
|
|
|
|
#define cmCPackIFWGenerator_h
|
|
|
|
|
|
|
|
#include <CPack/cmCPackGenerator.h>
|
|
|
|
|
|
|
|
#include "cmCPackIFWInstaller.h"
|
2016-04-29 17:53:13 +03:00
|
|
|
#include "cmCPackIFWPackage.h"
|
2016-05-17 17:00:29 +03:00
|
|
|
#include "cmCPackIFWRepository.h"
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2015-07-16 22:53:57 +03:00
|
|
|
class cmXMLWriter;
|
|
|
|
|
2014-08-06 19:23:00 +04: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-05-17 17:00:29 +03:00
|
|
|
typedef std::map<std::string, cmCPackIFWRepository> RepositoriesMap;
|
2014-08-06 19:23:00 +04: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
|
|
|
|
*/
|
|
|
|
virtual ~cmCPackIFWGenerator();
|
|
|
|
|
2015-04-27 17:02:49 +03:00
|
|
|
/**
|
|
|
|
* Compare \a version with QtIFW framework version
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
bool IsVersionLess(const char* version);
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Compare \a version with QtIFW framework version
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
bool IsVersionGreater(const char* version);
|
2015-04-27 17:02:49 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Compare \a version with QtIFW framework version
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
bool IsVersionEqual(const char* version);
|
2015-04-27 17:02:49 +03:00
|
|
|
|
2016-05-06 21:49:44 +03:00
|
|
|
protected:
|
|
|
|
// cmCPackGenerator reimplementation
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Initialize generator
|
|
|
|
* @return 0 on failure
|
|
|
|
*/
|
|
|
|
virtual int InitializeInternal();
|
|
|
|
virtual int PackageFiles();
|
|
|
|
virtual const char* GetPackagingInstallPrefix();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Extension of binary installer
|
|
|
|
* @return Executable suffix or value from default implementation
|
|
|
|
*/
|
|
|
|
virtual const char* GetOutputExtension();
|
|
|
|
|
|
|
|
virtual std::string GetComponentInstallDirNameSuffix(
|
|
|
|
const std::string& componentName);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Get Component
|
|
|
|
* @param projectName Project name
|
|
|
|
* @param componentName Component name
|
|
|
|
*
|
|
|
|
* This method calls the base implementation.
|
|
|
|
*
|
|
|
|
* @return Pointer to component
|
|
|
|
*/
|
2016-05-16 17:34:04 +03:00
|
|
|
virtual cmCPackComponent* GetComponent(const std::string& projectName,
|
|
|
|
const std::string& componentName);
|
2014-08-06 19:23:00 +04: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
|
|
|
|
*/
|
|
|
|
virtual cmCPackComponentGroup* GetComponentGroup(
|
2016-05-16 17:34:04 +03:00
|
|
|
const std::string& projectName, const std::string& groupName);
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const;
|
|
|
|
virtual bool SupportsAbsoluteDestination() const;
|
|
|
|
virtual bool SupportsComponentInstallation() const;
|
|
|
|
|
2016-05-06 21:49:44 +03:00
|
|
|
protected:
|
|
|
|
// Methods
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
bool IsOnePackage() const;
|
|
|
|
|
2014-08-12 22:44:02 +04:00
|
|
|
std::string GetRootPackageName();
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
std::string GetGroupPackageName(cmCPackComponentGroup* group) const;
|
|
|
|
std::string GetComponentPackageName(cmCPackComponent* component) const;
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2016-05-16 17:34:04 +03:00
|
|
|
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
|
|
|
|
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
|
2014-08-06 19:23:00 +04:00
|
|
|
|
2016-05-17 17:00:29 +03:00
|
|
|
cmCPackIFWRepository* GetRepository(const std::string& repositoryName);
|
|
|
|
|
2015-07-16 22:53:57 +03:00
|
|
|
void WriteGeneratedByToStrim(cmXMLWriter& xout);
|
2015-04-27 17:02:49 +03:00
|
|
|
|
2016-05-06 21:49:44 +03:00
|
|
|
protected:
|
|
|
|
// Data
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
friend class cmCPackIFWPackage;
|
|
|
|
friend class cmCPackIFWInstaller;
|
2016-05-17 17:00:29 +03:00
|
|
|
friend class cmCPackIFWRepository;
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
// Installer
|
|
|
|
cmCPackIFWInstaller Installer;
|
2016-05-17 17:00:29 +03:00
|
|
|
// Repository
|
|
|
|
cmCPackIFWRepository Repository;
|
2014-08-06 19:23:00 +04:00
|
|
|
// Collection of packages
|
|
|
|
PackagesMap Packages;
|
2016-05-17 17:00:29 +03:00
|
|
|
// Collection of repositories
|
|
|
|
RepositoriesMap Repositories;
|
2014-08-06 19:23:00 +04: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-04-27 17:02:49 +03:00
|
|
|
std::string FrameworkVersion;
|
|
|
|
std::string ExecutableSuffix;
|
2014-08-06 19:23:00 +04:00
|
|
|
|
|
|
|
bool OnlineOnly;
|
|
|
|
bool ResolveDuplicateNames;
|
|
|
|
std::vector<std::string> PkgsDirsVector;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|