cmCPackProductBuildGenerator.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmCPackProductBuildGenerator_h
  4. #define cmCPackProductBuildGenerator_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include "cmCPackGenerator.h"
  8. #include "cmCPackPKGGenerator.h"
  9. class cmCPackComponent;
  10. /** \class cmCPackProductBuildGenerator
  11. * \brief A generator for ProductBuild files
  12. *
  13. */
  14. class cmCPackProductBuildGenerator : public cmCPackPKGGenerator
  15. {
  16. public:
  17. cmCPackTypeMacro(cmCPackProductBuildGenerator, cmCPackPKGGenerator);
  18. /**
  19. * Construct generator
  20. */
  21. cmCPackProductBuildGenerator();
  22. ~cmCPackProductBuildGenerator() override;
  23. protected:
  24. int InitializeInternal() override;
  25. int PackageFiles() override;
  26. const char* GetOutputExtension() override { return ".pkg"; }
  27. // Run ProductBuild with the given command line, which will (if
  28. // successful) produce the given package file. Returns true if
  29. // ProductBuild succeeds, false otherwise.
  30. bool RunProductBuild(const std::string& command);
  31. // Generate a package in the file packageFile for the given
  32. // component. All of the files within this component are stored in
  33. // the directory packageDir. Returns true if successful, false
  34. // otherwise.
  35. bool GenerateComponentPackage(const std::string& packageFileDir,
  36. const std::string& packageFileName,
  37. const std::string& packageDir,
  38. const cmCPackComponent* component);
  39. const char* GetComponentScript(const char* script,
  40. const char* script_component);
  41. };
  42. #endif