CMake Nightly Date Stamp
[kiteware-cmake.git] / Source / CPack / cmCPackProductBuildGenerator.h
blob31cfafadf10d94e930bf3523c25df464ea5adb53
1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #pragma once
5 #include "cmConfigure.h" // IWYU pragma: keep
7 #include <string>
9 #include "cmCPackGenerator.h"
10 #include "cmCPackPKGGenerator.h"
11 #include "cmValue.h"
13 class cmCPackComponent;
15 /** \class cmCPackProductBuildGenerator
16 * \brief A generator for ProductBuild files
19 class cmCPackProductBuildGenerator : public cmCPackPKGGenerator
21 public:
22 cmCPackTypeMacro(cmCPackProductBuildGenerator, cmCPackPKGGenerator);
24 /**
25 * Construct generator
27 cmCPackProductBuildGenerator();
28 ~cmCPackProductBuildGenerator() override;
30 protected:
31 int InitializeInternal() override;
32 int PackageFiles() override;
33 const char* GetOutputExtension() override { return ".pkg"; }
35 // Run ProductBuild with the given command line, which will (if
36 // successful) produce the given package file. Returns true if
37 // ProductBuild succeeds, false otherwise.
38 bool RunProductBuild(const std::string& command);
40 // Generate a package in the file packageFile for the given
41 // component. All of the files within this component are stored in
42 // the directory packageDir. Returns true if successful, false
43 // otherwise.
44 bool GenerateComponentPackage(const std::string& packageFileDir,
45 const std::string& packageFileName,
46 const std::string& packageDir,
47 const cmCPackComponent* component);
49 cmValue GetComponentScript(const char* script, const char* script_component);