resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmExportSet.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 <map>
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 class cmInstallExportGenerator;
13 class cmLocalGenerator;
14 class cmTargetExport;
15
16 /// A set of targets that were installed with the same EXPORT parameter.
17 class cmExportSet
18 {
19 public:
20   /// Construct an empty export set named \a name
21   cmExportSet(std::string name);
22   /// Destructor
23   ~cmExportSet();
24
25   cmExportSet(const cmExportSet&) = delete;
26   cmExportSet& operator=(const cmExportSet&) = delete;
27
28   bool Compute(cmLocalGenerator* lg);
29
30   void AddTargetExport(std::unique_ptr<cmTargetExport> tgt);
31
32   void AddInstallation(cmInstallExportGenerator const* installation);
33
34   std::string const& GetName() const { return this->Name; }
35
36   std::vector<std::unique_ptr<cmTargetExport>> const& GetTargetExports() const
37   {
38     return this->TargetExports;
39   }
40
41   std::vector<cmInstallExportGenerator const*> const* GetInstallations() const
42   {
43     return &this->Installations;
44   }
45
46 private:
47   std::vector<std::unique_ptr<cmTargetExport>> TargetExports;
48   std::string Name;
49   std::vector<cmInstallExportGenerator const*> Installations;
50 };
51
52 /// A name -> cmExportSet map with overloaded operator[].
53 class cmExportSetMap : public std::map<std::string, cmExportSet>
54 {
55 public:
56   /** \brief Overloaded operator[].
57    *
58    * The operator is overloaded because cmExportSet has no default constructor:
59    * we do not want unnamed export sets.
60    */
61   cmExportSet& operator[](const std::string& name);
62 };