resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmExportTryCompileFileGenerator.h
1 /* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
2    file Copyright.txt or https://cmake.org/licensing for details.  */
3 #pragma once
4
5 #include "cmConfigure.h" // IWYU pragma: keep
6
7 #include <iosfwd>
8 #include <set>
9 #include <string>
10 #include <vector>
11
12 #include "cmExportFileGenerator.h"
13
14 class cmFileSet;
15 class cmGeneratorTarget;
16 class cmGlobalGenerator;
17 class cmMakefile;
18 class cmTargetExport;
19
20 class cmExportTryCompileFileGenerator : public cmExportFileGenerator
21 {
22 public:
23   cmExportTryCompileFileGenerator(cmGlobalGenerator* gg,
24                                   std::vector<std::string> const& targets,
25                                   cmMakefile* mf,
26                                   std::set<std::string> const& langs);
27
28   /** Set the list of targets to export.  */
29   void SetConfig(const std::string& config) { this->Config = config; }
30
31 protected:
32   // Implement virtual methods from the superclass.
33   bool GenerateMainFile(std::ostream& os) override;
34
35   void GenerateImportTargetsConfig(std::ostream&, const std::string&,
36                                    std::string const&) override
37   {
38   }
39   void HandleMissingTarget(std::string&, cmGeneratorTarget const*,
40                            cmGeneratorTarget*) override
41   {
42   }
43
44   void PopulateProperties(cmGeneratorTarget const* target,
45                           ImportPropertyMap& properties,
46                           std::set<const cmGeneratorTarget*>& emitted);
47
48   std::string InstallNameDir(cmGeneratorTarget const* target,
49                              const std::string& config) override;
50
51   std::string GetFileSetDirectories(cmGeneratorTarget* target,
52                                     cmFileSet* fileSet,
53                                     cmTargetExport* te) override;
54
55   std::string GetFileSetFiles(cmGeneratorTarget* target, cmFileSet* fileSet,
56                               cmTargetExport* te) override;
57
58   std::string GetCxxModulesDirectory() const override { return {}; }
59   void GenerateCxxModuleConfigInformation(std::ostream&) const override {}
60
61 private:
62   std::string FindTargets(const std::string& prop,
63                           const cmGeneratorTarget* tgt,
64                           std::string const& language,
65                           std::set<const cmGeneratorTarget*>& emitted);
66
67   std::vector<cmGeneratorTarget const*> Exports;
68   std::string Config;
69   std::vector<std::string> Languages;
70 };