/src/CMake/Source/cmInstallCommandArguments.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 <string> |
8 | | #include <vector> |
9 | | |
10 | | #include "cmArgumentParser.h" |
11 | | #include "cmArgumentParserTypes.h" |
12 | | |
13 | | class cmMakefile; |
14 | | |
15 | | class cmInstallCommandArguments : public cmArgumentParser<void> |
16 | | { |
17 | | public: |
18 | | cmInstallCommandArguments(std::string defaultComponent, |
19 | | cmMakefile& makefile); |
20 | | void SetGenericArguments(cmInstallCommandArguments* args) |
21 | 0 | { |
22 | 0 | this->GenericArguments = args; |
23 | 0 | } |
24 | | |
25 | | // Compute destination path.and check permissions |
26 | | bool Finalize(); |
27 | | |
28 | | std::string const& GetDestination() const; |
29 | | std::string const& GetComponent() const; |
30 | | std::string const& GetNamelinkComponent() const; |
31 | | bool GetExcludeFromAll() const; |
32 | | std::string const& GetRename() const; |
33 | | std::string const& GetPermissions() const; |
34 | | std::vector<std::string> const& GetConfigurations() const; |
35 | | bool GetOptional() const; |
36 | | bool GetNamelinkOnly() const; |
37 | | bool GetNamelinkSkip() const; |
38 | | bool HasNamelinkComponent() const; |
39 | | std::string const& GetType() const; |
40 | | |
41 | | std::string const& GetDefaultComponent() const; |
42 | | |
43 | | static bool CheckPermissions(std::string const& onePerm, std::string& perm); |
44 | | |
45 | | private: |
46 | | std::string Destination; |
47 | | std::string Component; |
48 | | std::string NamelinkComponent; |
49 | | bool ExcludeFromAll = false; |
50 | | std::string Rename; |
51 | | ArgumentParser::MaybeEmpty<std::vector<std::string>> Permissions; |
52 | | ArgumentParser::MaybeEmpty<std::vector<std::string>> Configurations; |
53 | | bool Optional = false; |
54 | | bool NamelinkOnly = false; |
55 | | bool NamelinkSkip = false; |
56 | | std::string Type; |
57 | | |
58 | | std::string DestinationString; |
59 | | std::string PermissionsString; |
60 | | |
61 | | cmInstallCommandArguments* GenericArguments = nullptr; |
62 | | static char const* PermissionsTable[]; |
63 | | static std::string const EmptyString; |
64 | | std::string DefaultComponentName; |
65 | | bool CheckPermissions(); |
66 | | }; |
67 | | |
68 | | class cmInstallCommandIncludesArgument |
69 | | { |
70 | | public: |
71 | | cmInstallCommandIncludesArgument(); |
72 | | void Parse(std::vector<std::string> const* args, |
73 | | std::vector<std::string>* unconsumedArgs); |
74 | | |
75 | | std::vector<std::string> const& GetIncludeDirs() const; |
76 | | |
77 | | private: |
78 | | std::vector<std::string> IncludeDirs; |
79 | | }; |
80 | | |
81 | | class cmInstallCommandFileSetArguments : public cmInstallCommandArguments |
82 | | { |
83 | | public: |
84 | | cmInstallCommandFileSetArguments(std::string defaultComponent, |
85 | | cmMakefile& makefile); |
86 | | |
87 | | void Parse(std::vector<std::string> args, |
88 | | std::vector<std::string>* unconsumedArgs); |
89 | | |
90 | 0 | std::string const& GetFileSet() const { return this->FileSet; } |
91 | | |
92 | | private: |
93 | | std::string FileSet; |
94 | | }; |