cmCPackProductBuildGenerator.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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
  4. #include "cmConfigure.h" // IWYU pragma: keep
  5. #include <string>
  6. #include "cmCPackGenerator.h"
  7. #include "cmCPackPKGGenerator.h"
  8. class cmCPackComponent;
  9. /** \class cmCPackProductBuildGenerator
  10. * \brief A generator for ProductBuild files
  11. *
  12. */
  13. class cmCPackProductBuildGenerator : public cmCPackPKGGenerator
  14. {
  15. public:
  16. cmCPackTypeMacro(cmCPackProductBuildGenerator, cmCPackPKGGenerator);
  17. /**
  18. * Construct generator
  19. */
  20. cmCPackProductBuildGenerator();
  21. ~cmCPackProductBuildGenerator() override;
  22. protected:
  23. int InitializeInternal() override;
  24. int PackageFiles() override;
  25. const char* GetOutputExtension() override { return ".pkg"; }
  26. // Run ProductBuild with the given command line, which will (if
  27. // successful) produce the given package file. Returns true if
  28. // ProductBuild succeeds, false otherwise.
  29. bool RunProductBuild(const std::string& command);
  30. // Generate a package in the file packageFile for the given
  31. // component. All of the files within this component are stored in
  32. // the directory packageDir. Returns true if successful, false
  33. // otherwise.
  34. bool GenerateComponentPackage(const std::string& packageFileDir,
  35. const std::string& packageFileName,
  36. const std::string& packageDir,
  37. const cmCPackComponent* component);
  38. const char* GetComponentScript(const char* script,
  39. const char* script_component);
  40. };