cmOSXBundleGenerator.h 2.1 KB

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