1
0

cmOSXBundleGenerator.h 2.0 KB

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