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