/src/CMake/Source/cmExportAndroidMKGenerator.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 <map> |
9 | | #include <string> |
10 | | |
11 | | #include <cm/string_view> |
12 | | |
13 | | #include "cmExportFileGenerator.h" |
14 | | |
15 | | class cmGeneratorTarget; |
16 | | |
17 | | namespace cm { |
18 | | enum class TargetType; |
19 | | } // namespace cm |
20 | | |
21 | | /** \class cmExportAndroidMKGenerator |
22 | | * \brief Generate CMake configuration files exporting targets from a build or |
23 | | * install tree. |
24 | | * |
25 | | * cmExportAndroidMKGenerator is the superclass for |
26 | | * cmExportBuildAndroidMKGenerator and cmExportInstallAndroidMKGenerator. |
27 | | * It contains common code generation routines for the two kinds of export |
28 | | * implementations. |
29 | | */ |
30 | | class cmExportAndroidMKGenerator : virtual public cmExportFileGenerator |
31 | | { |
32 | | public: |
33 | | cmExportAndroidMKGenerator(); |
34 | | |
35 | | using cmExportFileGenerator::GenerateImportFile; |
36 | | |
37 | | protected: |
38 | | enum GenerateType |
39 | | { |
40 | | BUILD, |
41 | | INSTALL |
42 | | }; |
43 | | virtual GenerateType GetGenerateType() const = 0; |
44 | | |
45 | | using ImportPropertyMap = std::map<std::string, std::string>; |
46 | | |
47 | | cm::string_view GetImportPrefixWithSlash() const override; |
48 | | |
49 | | void GenerateInterfaceProperties(cmGeneratorTarget const* target, |
50 | | std::ostream& os, |
51 | | ImportPropertyMap const& properties); |
52 | | |
53 | | // Methods to implement export file code generation. |
54 | | bool GenerateImportFile(std::ostream& os) override; |
55 | | virtual void GenerateImportHeaderCode(std::ostream& os, |
56 | | std::string const& config = "") = 0; |
57 | | virtual void GenerateImportTargetCode(std::ostream& os, |
58 | | cmGeneratorTarget const* target, |
59 | | cm::TargetType targetType) = 0; |
60 | | |
61 | | void GenerateImportTargetsConfig(std::ostream& /*os*/, |
62 | | std::string const& /*config*/, |
63 | | std::string const& /*suffix*/) override |
64 | 0 | { |
65 | 0 | } |
66 | | |
67 | | std::string GetCxxModuleFile(std::string const& /*name*/) const override |
68 | 0 | { |
69 | 0 | return {}; |
70 | 0 | } |
71 | | |
72 | | void GenerateCxxModuleConfigInformation(std::string const& /*name*/, |
73 | | std::ostream& /*os*/) const override |
74 | 0 | { |
75 | 0 | } |
76 | | }; |