cmOSXBundleGenerator.h 1.7 KB

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