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. */
|
2021-09-14 00:13:48 +02:00
|
|
|
#pragma once
|
2016-10-30 18:24:19 +01:00
|
|
|
|
2018-01-26 17:06:56 +01:00
|
|
|
#include "cmConfigure.h" // IWYU pragma: keep
|
2017-07-20 19:35:53 +02:00
|
|
|
|
2017-04-14 19:02:05 +02:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "cmCPackGenerator.h"
|
2016-10-30 18:24:19 +01:00
|
|
|
#include "cmCPackPKGGenerator.h"
|
2021-11-20 13:41:27 +01:00
|
|
|
#include "cmValue.h"
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
class cmCPackComponent;
|
|
|
|
|
|
|
|
/** \class cmCPackProductBuildGenerator
|
|
|
|
* \brief A generator for ProductBuild files
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
class cmCPackProductBuildGenerator : public cmCPackPKGGenerator
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmCPackTypeMacro(cmCPackProductBuildGenerator, cmCPackPKGGenerator);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Construct generator
|
|
|
|
*/
|
|
|
|
cmCPackProductBuildGenerator();
|
2018-01-26 17:06:56 +01:00
|
|
|
~cmCPackProductBuildGenerator() override;
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
protected:
|
2018-01-26 17:06:56 +01:00
|
|
|
int InitializeInternal() override;
|
|
|
|
int PackageFiles() override;
|
|
|
|
const char* GetOutputExtension() override { return ".pkg"; }
|
2016-10-30 18:24:19 +01:00
|
|
|
|
|
|
|
// Run ProductBuild with the given command line, which will (if
|
|
|
|
// successful) produce the given package file. Returns true if
|
|
|
|
// ProductBuild succeeds, false otherwise.
|
|
|
|
bool RunProductBuild(const std::string& command);
|
|
|
|
|
|
|
|
// Generate a package in the file packageFile for the given
|
|
|
|
// component. All of the files within this component are stored in
|
|
|
|
// the directory packageDir. Returns true if successful, false
|
|
|
|
// otherwise.
|
|
|
|
bool GenerateComponentPackage(const std::string& packageFileDir,
|
|
|
|
const std::string& packageFileName,
|
|
|
|
const std::string& packageDir,
|
|
|
|
const cmCPackComponent* component);
|
|
|
|
|
2021-11-20 13:41:27 +01:00
|
|
|
cmValue GetComponentScript(const char* script, const char* script_component);
|
2016-10-30 18:24:19 +01:00
|
|
|
};
|