/src/CMake/Source/cmInstallDirectoryGenerator.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 | | |
13 | | class cmListFileBacktrace; |
14 | | class cmLocalGenerator; |
15 | | |
16 | | /** \class cmInstallDirectoryGenerator |
17 | | * \brief Generate directory installation rules. |
18 | | */ |
19 | | class cmInstallDirectoryGenerator : public cmInstallGenerator |
20 | | { |
21 | | public: |
22 | | cmInstallDirectoryGenerator( |
23 | | std::vector<std::string> const& dirs, std::string const& dest, |
24 | | std::string file_permissions, std::string dir_permissions, |
25 | | std::vector<std::string> const& configurations, |
26 | | std::string const& component, MessageLevel message, bool exclude_from_all, |
27 | | std::string literal_args, bool optional, cmListFileBacktrace backtrace); |
28 | | ~cmInstallDirectoryGenerator() override; |
29 | | |
30 | | bool Compute(cmLocalGenerator* lg) override; |
31 | | |
32 | | std::string GetDestination(std::string const& config) const; |
33 | | std::vector<std::string> GetDirectories(std::string const& config) const; |
34 | | |
35 | 0 | bool GetOptional() const { return this->Optional; } |
36 | | |
37 | | protected: |
38 | | void GenerateScriptActions(std::ostream& os, Indent indent) override; |
39 | | void GenerateScriptForConfig(std::ostream& os, std::string const& config, |
40 | | Indent indent) override; |
41 | | void AddDirectoryInstallRule(std::ostream& os, std::string const& config, |
42 | | Indent indent, |
43 | | std::vector<std::string> const& dirs); |
44 | | cmLocalGenerator* LocalGenerator = nullptr; |
45 | | std::vector<std::string> const Directories; |
46 | | std::string const FilePermissions; |
47 | | std::string const DirPermissions; |
48 | | std::string const LiteralArguments; |
49 | | bool const Optional; |
50 | | }; |