cmOSXBundleGenerator.h 1.6 KB

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