cmOSXBundleGenerator.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. // create an app bundle at a given root, and return
  18. // the directory within the bundle that contains the executable
  19. void CreateAppBundle(const std::string& targetName, std::string& root,
  20. const std::string& config);
  21. // create a framework at a given root
  22. void CreateFramework(const std::string& targetName, const std::string& root,
  23. const std::string& config);
  24. // create a cf bundle at a given root
  25. void CreateCFBundle(const std::string& targetName, const std::string& root,
  26. const std::string& config);
  27. struct MacOSXContentGeneratorType
  28. {
  29. virtual ~MacOSXContentGeneratorType() = default;
  30. virtual void operator()(cmSourceFile const& source, const char* pkgloc,
  31. const std::string& config) = 0;
  32. };
  33. void GenerateMacOSXContentStatements(
  34. std::vector<cmSourceFile const*> const& sources,
  35. MacOSXContentGeneratorType* generator, const std::string& config);
  36. std::string InitMacOSXContentDirectory(const char* pkgloc,
  37. const std::string& config);
  38. void SetMacContentFolders(std::set<std::string>* macContentFolders)
  39. {
  40. this->MacContentFolders = macContentFolders;
  41. }
  42. private:
  43. bool MustSkip();
  44. private:
  45. cmGeneratorTarget* GT;
  46. cmMakefile* Makefile;
  47. cmLocalGenerator* LocalGenerator;
  48. std::set<std::string>* MacContentFolders;
  49. };
  50. #endif