CMake/Source/CPack/IFW/cmCPackIFWGenerator.h

166 lines
4.4 KiB
C
Raw Normal View History

Simplify CMake per-source license notices Per-source copyright/license notice headers that spell out copyright holder names and years are hard to maintain and often out-of-date or plain wrong. Precise contributor information is already maintained automatically by the version control tool. Ultimately it is the receiver of a file who is responsible for determining its licensing status, and per-source notices are merely a convenience. Therefore it is simpler and more accurate for each source to have a generic notice of the license name and references to more detailed information on copyright holders and full license terms. Our `Copyright.txt` file now contains a list of Contributors whose names appeared source-level copyright notices. It also references version control history for more precise information. Therefore we no longer need to spell out the list of Contributors in each source file notice. Replace CMake per-source copyright/license notice headers with a short description of the license and links to `Copyright.txt` and online information available from "https://cmake.org/licensing". The online URL also handles cases of modules being copied out of our source into other projects, so we can drop our notices about replacing links with full license text. Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority of the replacements mechanically. Manually fix up shebang lines and trailing newlines in a few files. Manually update the notices in a few files that the script does not handle.
2016-09-27 22:01:08 +03:00
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
file Copyright.txt or https://cmake.org/licensing for details. */
#ifndef cmCPackIFWGenerator_h
#define cmCPackIFWGenerator_h
2016-09-07 01:21:35 +03:00
#include <cmConfigure.h>
2016-09-07 01:21:35 +03:00
#include "CPack/cmCPackComponentGroup.h"
#include "CPack/cmCPackGenerator.h"
#include "cmCPackIFWInstaller.h"
#include "cmCPackIFWPackage.h"
#include "cmCPackIFWRepository.h"
2016-09-07 01:21:35 +03:00
#include "cmTypeMacro.h"
#include <map>
#include <set>
#include <string>
#include <vector>
2015-07-16 22:53:57 +03:00
class cmXMLWriter;
/** \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;
typedef std::map<std::string, cmCPackIFWRepository> RepositoriesMap;
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-06-27 22:25:27 +03:00
~cmCPackIFWGenerator() CM_OVERRIDE;
/**
* Compare \a version with QtIFW framework version
*/
bool IsVersionLess(const char* version);
/**
* Compare \a version with QtIFW framework version
*/
bool IsVersionGreater(const char* version);
/**
* Compare \a version with QtIFW framework version
*/
bool IsVersionEqual(const char* version);
protected:
// cmCPackGenerator reimplementation
/**
* @brief Initialize generator
* @return 0 on failure
*/
2016-06-27 22:25:27 +03:00
int InitializeInternal() CM_OVERRIDE;
int PackageFiles() CM_OVERRIDE;
const char* GetPackagingInstallPrefix() CM_OVERRIDE;
/**
* @brief Extension of binary installer
* @return Executable suffix or value from default implementation
*/
2016-06-27 22:25:27 +03:00
const char* GetOutputExtension() CM_OVERRIDE;
2016-06-27 22:25:27 +03:00
std::string GetComponentInstallDirNameSuffix(
const std::string& componentName) CM_OVERRIDE;
/**
* @brief Get Component
* @param projectName Project name
* @param componentName Component name
*
* This method calls the base implementation.
*
* @return Pointer to component
*/
2016-06-27 22:25:27 +03:00
cmCPackComponent* GetComponent(const std::string& projectName,
const std::string& componentName) CM_OVERRIDE;
/**
* @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-06-27 22:25:27 +03:00
cmCPackComponentGroup* GetComponentGroup(
const std::string& projectName, const std::string& groupName) CM_OVERRIDE;
2016-06-27 22:25:27 +03:00
enum cmCPackGenerator::CPackSetDestdirSupport SupportsSetDestdir() const
CM_OVERRIDE;
bool SupportsAbsoluteDestination() const CM_OVERRIDE;
bool SupportsComponentInstallation() const CM_OVERRIDE;
protected:
// Methods
bool IsOnePackage() const;
std::string GetRootPackageName();
std::string GetGroupPackageName(cmCPackComponentGroup* group) const;
std::string GetComponentPackageName(cmCPackComponent* component) const;
cmCPackIFWPackage* GetGroupPackage(cmCPackComponentGroup* group) const;
cmCPackIFWPackage* GetComponentPackage(cmCPackComponent* component) const;
cmCPackIFWRepository* GetRepository(const std::string& repositoryName);
2015-07-16 22:53:57 +03:00
void WriteGeneratedByToStrim(cmXMLWriter& xout);
protected:
// Data
friend class cmCPackIFWPackage;
friend class cmCPackIFWInstaller;
friend class cmCPackIFWRepository;
// Installer
cmCPackIFWInstaller Installer;
// Repository
cmCPackIFWRepository Repository;
// Collection of packages
PackagesMap Packages;
// Collection of repositories
RepositoriesMap Repositories;
// 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;
std::string FrameworkVersion;
std::string ExecutableSuffix;
bool OnlineOnly;
bool ResolveDuplicateNames;
std::vector<std::string> PkgsDirsVector;
};
#endif