/src/CMake/Source/cmInstallScriptGenerator.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 <iosfwd> |
8 | | #include <string> |
9 | | #include <vector> |
10 | | |
11 | | #include "cmInstallGenerator.h" |
12 | | #include "cmListFileCache.h" |
13 | | |
14 | | class cmLocalGenerator; |
15 | | |
16 | | /** \class cmInstallScriptGenerator |
17 | | * \brief Generate target installation rules. |
18 | | */ |
19 | | class cmInstallScriptGenerator : public cmInstallGenerator |
20 | | { |
21 | | public: |
22 | | cmInstallScriptGenerator( |
23 | | std::string script, bool code, std::string const& component, |
24 | | bool excludeFromAll, bool allComponents, |
25 | | std::vector<std::string> buildDepends = {}, |
26 | | cmListFileBacktrace backtrace = cmListFileBacktrace()); |
27 | | ~cmInstallScriptGenerator() override; |
28 | | |
29 | | bool Compute(cmLocalGenerator* lg) override; |
30 | | |
31 | | void GetInstallBuildDependencies( |
32 | | std::string const& config, |
33 | | std::vector<BuildDependency>& dependencies) const override; |
34 | | |
35 | 0 | bool IsCode() const { return this->Code; } |
36 | | |
37 | | std::string GetScript(std::string const& config) const; |
38 | | |
39 | | protected: |
40 | | void GenerateScriptActions(std::ostream& os, Indent indent) override; |
41 | | void GenerateScriptForConfig(std::ostream& os, std::string const& config, |
42 | | Indent indent) override; |
43 | | void AddScriptInstallRule(std::ostream& os, Indent indent, |
44 | | std::string const& script) const; |
45 | | |
46 | | std::string const Script; |
47 | | bool const Code; |
48 | | std::vector<std::string> const BuildDepends; |
49 | | BuildDependsEntries ResolvedBuildDepends; |
50 | | cmLocalGenerator* LocalGenerator; |
51 | | bool AllowGenex = false; |
52 | | }; |