cmOSXBundleGenerator.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 <set>
  6. #include <string>
  7. #include <vector>
  8. class cmGeneratorTarget;
  9. class cmLocalGenerator;
  10. class cmMakefile;
  11. class cmSourceFile;
  12. class cmOSXBundleGenerator
  13. {
  14. public:
  15. cmOSXBundleGenerator(cmGeneratorTarget* target);
  16. struct SkipParts
  17. {
  18. SkipParts()
  19. : infoPlist(false)
  20. {
  21. }
  22. bool infoPlist; // NOLINT(modernize-use-default-member-init)
  23. };
  24. // create an app bundle at a given root, and return
  25. // the directory within the bundle that contains the executable
  26. void CreateAppBundle(const std::string& targetName, std::string& root,
  27. const std::string& config);
  28. // create a framework at a given root
  29. void CreateFramework(const std::string& targetName, const std::string& root,
  30. const std::string& config,
  31. const SkipParts& skipParts = SkipParts());
  32. // create a cf bundle at a given root
  33. void CreateCFBundle(const std::string& targetName, const std::string& root,
  34. const std::string& config);
  35. struct MacOSXContentGeneratorType
  36. {
  37. virtual ~MacOSXContentGeneratorType() = default;
  38. virtual void operator()(cmSourceFile const& source, const char* pkgloc,
  39. const std::string& config) = 0;
  40. };
  41. void GenerateMacOSXContentStatements(
  42. std::vector<cmSourceFile const*> const& sources,
  43. MacOSXContentGeneratorType* generator, const std::string& config);
  44. std::string InitMacOSXContentDirectory(const char* pkgloc,
  45. const std::string& config);
  46. void SetMacContentFolders(std::set<std::string>* macContentFolders)
  47. {
  48. this->MacContentFolders = macContentFolders;
  49. }
  50. private:
  51. bool MustSkip();
  52. cmGeneratorTarget* GT;
  53. cmMakefile* Makefile;
  54. cmLocalGenerator* LocalGenerator;
  55. std::set<std::string>* MacContentFolders;
  56. };