/src/CMake/Source/cmGeneratorExpressionEvaluationFile.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 <map> |
8 | | #include <memory> |
9 | | #include <string> |
10 | | #include <vector> |
11 | | |
12 | | #include "cm_sys_stat.h" |
13 | | |
14 | | #include "cmGeneratorExpression.h" |
15 | | #include "cmPolicies.h" |
16 | | |
17 | | namespace cm { |
18 | | namespace GenEx { |
19 | | struct Context; |
20 | | } |
21 | | } |
22 | | |
23 | | class cmGeneratorTarget; |
24 | | class cmLocalGenerator; |
25 | | |
26 | | class cmGeneratorExpressionEvaluationFile |
27 | | { |
28 | | public: |
29 | | cmGeneratorExpressionEvaluationFile( |
30 | | std::string input, std::string target, |
31 | | std::unique_ptr<cmCompiledGeneratorExpression> outputFileExpr, |
32 | | std::unique_ptr<cmCompiledGeneratorExpression> condition, |
33 | | bool inputIsContent, std::string newLineCharacter, mode_t permissions, |
34 | | cmPolicies::PolicyStatus policyStatusCMP0070, |
35 | | cmPolicies::PolicyStatus policyStatusCMP0189); |
36 | | |
37 | | void Generate(cmLocalGenerator* lg); |
38 | | |
39 | 0 | std::vector<std::string> GetFiles() const { return this->Files; } |
40 | | |
41 | | void CreateOutputFile(cmLocalGenerator* lg, std::string const& config); |
42 | | |
43 | | private: |
44 | | void Generate(cmLocalGenerator* lg, std::string const& config, |
45 | | std::string const& lang, |
46 | | cmCompiledGeneratorExpression* inputExpression, |
47 | | std::map<std::string, std::string>& outputFiles, mode_t perm); |
48 | | |
49 | | std::string GetInputFileName(cmLocalGenerator const* lg); |
50 | | std::string GetOutputFileName(cm::GenEx::Context const& context, |
51 | | cmGeneratorTarget* target); |
52 | | enum PathRole |
53 | | { |
54 | | PathForInput, |
55 | | PathForOutput |
56 | | }; |
57 | | std::string FixRelativePath(std::string const& filePath, PathRole role, |
58 | | cmLocalGenerator const* lg); |
59 | | |
60 | | std::string const Input; |
61 | | std::string const Target; |
62 | | std::unique_ptr<cmCompiledGeneratorExpression> const OutputFileExpr; |
63 | | std::unique_ptr<cmCompiledGeneratorExpression> const Condition; |
64 | | std::vector<std::string> Files; |
65 | | bool const InputIsContent; |
66 | | std::string const NewLineCharacter; |
67 | | cmPolicies::PolicyStatus PolicyStatusCMP0070; |
68 | | cmPolicies::PolicyStatus PolicyStatusCMP0189; |
69 | | mode_t Permissions; |
70 | | }; |