cmOSXBundleGenerator.h 1.65 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4 5
#ifndef cmOSXBundleGenerator_h
#define cmOSXBundleGenerator_h

6
#include "cmConfigure.h" // IWYU pragma: keep
7 8

#include <set>
9
#include <string>
10
#include <vector>
11

12
class cmGeneratorTarget;
13 14 15
class cmLocalGenerator;
class cmMakefile;
class cmSourceFile;
16 17 18 19

class cmOSXBundleGenerator
{
public:
wahikihiki's avatar
wahikihiki committed
20
  cmOSXBundleGenerator(cmGeneratorTarget* target, std::string configName);
21

22 23 24 25 26
  // create an app bundle at a given root, and return
  // the directory within the bundle that contains the executable
  void CreateAppBundle(const std::string& targetName, std::string& root);

  // create a framework at a given root
27
  void CreateFramework(const std::string& targetName, const std::string& root);
28

29
  // create a cf bundle at a given root
30
  void CreateCFBundle(const std::string& targetName, const std::string& root);
31

Peter Kümmel's avatar
Peter Kümmel committed
32
  struct MacOSXContentGeneratorType
33
  {
wahikihiki's avatar
wahikihiki committed
34
    virtual ~MacOSXContentGeneratorType() = default;
35 36
    virtual void operator()(cmSourceFile const& source,
                            const char* pkgloc) = 0;
37 38 39
  };

  void GenerateMacOSXContentStatements(
40
    std::vector<cmSourceFile const*> const& sources,
41
    MacOSXContentGeneratorType* generator);
42
  std::string InitMacOSXContentDirectory(const char* pkgloc);
43

44
  void SetMacContentFolders(std::set<std::string>* macContentFolders)
45 46 47
  {
    this->MacContentFolders = macContentFolders;
  }
48

49 50 51
private:
  bool MustSkip();

52
private:
53
  cmGeneratorTarget* GT;
54 55
  cmMakefile* Makefile;
  cmLocalGenerator* LocalGenerator;
56
  std::string ConfigName;
57
  std::set<std::string>* MacContentFolders;
58 59 60
};

#endif