cmOSXBundleGenerator.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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 const& source,
  38. const char* pkgloc) = 0;
  39. };
  40. void GenerateMacOSXContentStatements(
  41. std::vector<cmSourceFile const*> const& sources,
  42. MacOSXContentGeneratorType* generator);
  43. std::string InitMacOSXContentDirectory(const char* pkgloc);
  44. void SetMacContentFolders(std::set<std::string>* macContentFolders)
  45. { this->MacContentFolders = macContentFolders; }
  46. private:
  47. bool MustSkip();
  48. private:
  49. cmGeneratorTarget* GT;
  50. cmMakefile* Makefile;
  51. cmLocalGenerator* LocalGenerator;
  52. std::string ConfigName;
  53. std::set<std::string>* MacContentFolders;
  54. };
  55. #endif