You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
90 lines
2.7 KiB
90 lines
2.7 KiB
6 years ago
|
/* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||
|
file Copyright.txt or https://cmake.org/licensing for details. */
|
||
6 years ago
|
#ifndef cmCPackExternalGenerator_h
|
||
|
#define cmCPackExternalGenerator_h
|
||
6 years ago
|
|
||
|
#include "cmCPackGenerator.h"
|
||
|
#include "cm_sys_stat.h"
|
||
|
|
||
|
#include <memory>
|
||
|
#include <string>
|
||
|
|
||
|
class cmGlobalGenerator;
|
||
|
namespace Json {
|
||
|
class Value;
|
||
|
}
|
||
|
|
||
6 years ago
|
/** \class cmCPackExternalGenerator
|
||
6 years ago
|
* \brief A generator for CPack External packaging tools
|
||
|
*/
|
||
6 years ago
|
class cmCPackExternalGenerator : public cmCPackGenerator
|
||
6 years ago
|
{
|
||
|
public:
|
||
6 years ago
|
cmCPackTypeMacro(cmCPackExternalGenerator, cmCPackGenerator);
|
||
6 years ago
|
|
||
|
const char* GetOutputExtension() override { return ".json"; }
|
||
|
|
||
|
protected:
|
||
|
int InitializeInternal() override;
|
||
|
|
||
|
int PackageFiles() override;
|
||
|
|
||
|
bool SupportsComponentInstallation() const override;
|
||
|
|
||
|
int InstallProjectViaInstallCommands(
|
||
|
bool setDestDir, const std::string& tempInstallDirectory) override;
|
||
|
int InstallProjectViaInstallScript(
|
||
|
bool setDestDir, const std::string& tempInstallDirectory) override;
|
||
|
int InstallProjectViaInstalledDirectories(
|
||
|
bool setDestDir, const std::string& tempInstallDirectory,
|
||
|
const mode_t* default_dir_mode) override;
|
||
|
|
||
|
int RunPreinstallTarget(const std::string& installProjectName,
|
||
|
const std::string& installDirectory,
|
||
|
cmGlobalGenerator* globalGenerator,
|
||
|
const std::string& buildConfig) override;
|
||
|
int InstallCMakeProject(bool setDestDir, const std::string& installDirectory,
|
||
|
const std::string& baseTempInstallDirectory,
|
||
|
const mode_t* default_dir_mode,
|
||
|
const std::string& component, bool componentInstall,
|
||
|
const std::string& installSubDirectory,
|
||
|
const std::string& buildConfig,
|
||
|
std::string& absoluteDestFiles) override;
|
||
|
|
||
|
private:
|
||
|
bool StagingEnabled() const;
|
||
|
|
||
6 years ago
|
class cmCPackExternalVersionGenerator
|
||
6 years ago
|
{
|
||
|
public:
|
||
6 years ago
|
cmCPackExternalVersionGenerator(cmCPackExternalGenerator* parent);
|
||
6 years ago
|
|
||
6 years ago
|
virtual ~cmCPackExternalVersionGenerator() = default;
|
||
6 years ago
|
|
||
|
virtual int WriteToJSON(Json::Value& root);
|
||
|
|
||
|
protected:
|
||
|
virtual int GetVersionMajor() = 0;
|
||
|
virtual int GetVersionMinor() = 0;
|
||
|
|
||
|
int WriteVersion(Json::Value& root);
|
||
|
|
||
6 years ago
|
cmCPackExternalGenerator* Parent;
|
||
6 years ago
|
};
|
||
|
|
||
6 years ago
|
class cmCPackExternalVersion1Generator
|
||
|
: public cmCPackExternalVersionGenerator
|
||
6 years ago
|
{
|
||
|
public:
|
||
6 years ago
|
using cmCPackExternalVersionGenerator::cmCPackExternalVersionGenerator;
|
||
6 years ago
|
|
||
|
protected:
|
||
|
int GetVersionMajor() override { return 1; }
|
||
|
int GetVersionMinor() override { return 0; }
|
||
|
};
|
||
|
|
||
6 years ago
|
std::unique_ptr<cmCPackExternalVersionGenerator> Generator;
|
||
6 years ago
|
};
|
||
|
|
||
|
#endif
|