/src/CMake/Source/cmOSXBundleGenerator.h
Line | Count | Source |
1 | | /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
2 | | file LICENSE.rst or https://cmake.org/licensing for details. */ |
3 | | #pragma once |
4 | | |
5 | | #include "cmConfigure.h" // IWYU pragma: keep |
6 | | |
7 | | #include <set> |
8 | | #include <string> |
9 | | #include <vector> |
10 | | |
11 | | class cmGeneratorTarget; |
12 | | class cmLocalGenerator; |
13 | | class cmMakefile; |
14 | | class cmSourceFile; |
15 | | |
16 | | class cmOSXBundleGenerator |
17 | | { |
18 | | public: |
19 | | cmOSXBundleGenerator(cmGeneratorTarget* target); |
20 | | |
21 | | struct SkipParts |
22 | | { |
23 | 0 | SkipParts() {} // NOLINT(modernize-use-equals-default) |
24 | | |
25 | | bool InfoPlist = false; |
26 | | bool TextStubs = true; |
27 | | }; |
28 | | |
29 | | // create an app bundle at a given root, and return |
30 | | // the directory within the bundle that contains the executable |
31 | | void CreateAppBundle(std::string const& targetName, std::string& root, |
32 | | std::string const& config); |
33 | | |
34 | | // create a framework at a given root |
35 | | void CreateFramework(std::string const& targetName, std::string const& root, |
36 | | std::string const& config, |
37 | | SkipParts skipParts = SkipParts{}); |
38 | | |
39 | | // create a cf bundle at a given root |
40 | | void CreateCFBundle(std::string const& targetName, std::string const& root, |
41 | | std::string const& config); |
42 | | |
43 | | struct MacOSXContentGeneratorType |
44 | | { |
45 | 0 | virtual ~MacOSXContentGeneratorType() = default; |
46 | | virtual void operator()(cmSourceFile const& source, char const* pkgloc, |
47 | | std::string const& config) = 0; |
48 | | }; |
49 | | |
50 | | void GenerateMacOSXContentStatements( |
51 | | std::vector<cmSourceFile const*> const& sources, |
52 | | MacOSXContentGeneratorType* generator, std::string const& config); |
53 | | std::string InitMacOSXContentDirectory(char const* pkgloc, |
54 | | std::string const& config); |
55 | | |
56 | | void SetMacContentFolders(std::set<std::string>* macContentFolders) |
57 | 0 | { |
58 | 0 | this->MacContentFolders = macContentFolders; |
59 | 0 | } |
60 | | |
61 | | private: |
62 | | bool MustSkip(); |
63 | | |
64 | | cmGeneratorTarget* GT; |
65 | | cmMakefile* Makefile; |
66 | | cmLocalGenerator* LocalGenerator; |
67 | | std::set<std::string>* MacContentFolders = nullptr; |
68 | | }; |