cmOSXBundleGenerator.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2012 Nicolas Despres <[email protected]>
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmOSXBundleGenerator_h
  11. #define cmOSXBundleGenerator_h
  12. #include "cmStandardIncludes.h"
  13. #include "cmSourceFile.h"
  14. #include <string>
  15. #include <set>
  16. class cmTarget;
  17. class cmMakefile;
  18. class cmLocalGenerator;
  19. class cmGeneratorTarget;
  20. class cmOSXBundleGenerator
  21. {
  22. public:
  23. cmOSXBundleGenerator(cmGeneratorTarget* target,
  24. const std::string& configName);
  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. // create a framework at a given root
  29. void CreateFramework(const std::string& targetName,
  30. const std::string& root);
  31. // create a cf bundle at a given root
  32. void CreateCFBundle(const std::string& targetName,
  33. const std::string& root);
  34. struct MacOSXContentGeneratorType
  35. {
  36. virtual ~MacOSXContentGeneratorType() {}
  37. virtual void operator()(cmSourceFile& source, const char* pkgloc) = 0;
  38. };
  39. void GenerateMacOSXContentStatements(
  40. std::vector<cmSourceFile*> const& sources,
  41. MacOSXContentGeneratorType* generator);
  42. std::string InitMacOSXContentDirectory(const char* pkgloc);
  43. void SetMacContentFolders(std::set<std::string>* macContentFolders)
  44. { this->MacContentFolders = macContentFolders; }
  45. private:
  46. bool MustSkip();
  47. private:
  48. cmGeneratorTarget* GT;
  49. cmMakefile* Makefile;
  50. cmLocalGenerator* LocalGenerator;
  51. std::string ConfigName;
  52. std::set<std::string>* MacContentFolders;
  53. };
  54. #endif