/src/CMake/Source/cmInstallFileSetGenerator.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 <iosfwd> |
6 | | #include <map> |
7 | | #include <string> |
8 | | #include <vector> |
9 | | |
10 | | #include "cmInstallGenerator.h" |
11 | | |
12 | | class cmDiagnosticContext; |
13 | | class cmExportInstallCMakeConfigGenerator; |
14 | | class cmGeneratorFileSet; |
15 | | class cmGeneratorTarget; |
16 | | class cmLocalGenerator; |
17 | | |
18 | | class cmInstallFileSetGenerator : public cmInstallGenerator |
19 | | { |
20 | | public: |
21 | | cmInstallFileSetGenerator(std::string targetName, std::string fileSetName, |
22 | | std::string destination, |
23 | | std::string filePermissions, |
24 | | std::vector<std::string> const& configurations, |
25 | | std::string const& component, MessageLevel message, |
26 | | bool excludeFromAll, bool optional, |
27 | | cmDiagnosticContext context); |
28 | | ~cmInstallFileSetGenerator() override; |
29 | | |
30 | | bool Compute(cmLocalGenerator* lg) override; |
31 | | |
32 | | struct DestinationContext |
33 | | { |
34 | | std::string UnescapedDestination; |
35 | | bool HadContextSensitiveCondition; |
36 | | }; |
37 | | std::string GetDestination(std::string const& config) const; |
38 | | DestinationContext GetDestination(cmGeneratorTarget* gt, |
39 | | std::string const& config) const; |
40 | 0 | bool GetOptional() const { return this->Optional; } |
41 | 0 | std::string GetFileSetName() const { return this->FileSetName; } |
42 | 0 | cmGeneratorFileSet const* GetFileSet() const { return this->FileSet; }; |
43 | 0 | cmGeneratorTarget* GetTarget() const { return this->Target; } |
44 | | |
45 | | protected: |
46 | | friend cmExportInstallCMakeConfigGenerator; |
47 | | std::string GetDestination() const; |
48 | | |
49 | | void GenerateScriptForConfig(std::ostream& os, std::string const& config, |
50 | | Indent indent) override; |
51 | | |
52 | | private: |
53 | | std::string TargetName; |
54 | | cmLocalGenerator* LocalGenerator; |
55 | | cmGeneratorFileSet const* FileSet; |
56 | | std::string const FileSetName; |
57 | | std::string const FilePermissions; |
58 | | bool const Optional; |
59 | | cmGeneratorTarget* Target; |
60 | | |
61 | | std::map<std::string, std::vector<std::string>> CalculateFilesPerDir( |
62 | | std::string const& config) const; |
63 | | }; |