resolve cyclic dependency with zstd
[platform/upstream/cmake.git] / Source / cmInstallRuntimeDependencySetGenerator.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 <iosfwd>
6 #include <string>
7 #include <vector>
8
9 #include "cmInstallGenerator.h"
10 #include "cmScriptGenerator.h"
11
12 class cmInstallRuntimeDependencySet;
13 class cmListFileBacktrace;
14 class cmLocalGenerator;
15
16 class cmInstallRuntimeDependencySetGenerator : public cmInstallGenerator
17 {
18 public:
19   enum class DependencyType
20   {
21     Library,
22     Framework,
23   };
24
25   cmInstallRuntimeDependencySetGenerator(
26     DependencyType type, cmInstallRuntimeDependencySet* dependencySet,
27     std::vector<std::string> installRPaths, bool noInstallRPath,
28     std::string installNameDir, bool noInstallName, const char* depsVar,
29     const char* rpathPrefix, const char* tmpVarPrefix, std::string destination,
30     std::vector<std::string> const& configurations, std::string component,
31     std::string permissions, MessageLevel message, bool exclude_from_all,
32     cmListFileBacktrace backtrace);
33
34   bool Compute(cmLocalGenerator* lg) override;
35
36   DependencyType GetDependencyType() const { return this->Type; }
37
38   cmInstallRuntimeDependencySet* GetRuntimeDependencySet() const
39   {
40     return this->DependencySet;
41   }
42
43   std::string GetDestination(std::string const& config) const;
44
45 protected:
46   void GenerateScriptForConfig(std::ostream& os, const std::string& config,
47                                Indent indent) override;
48
49 private:
50   DependencyType Type;
51   cmInstallRuntimeDependencySet* DependencySet;
52   std::vector<std::string> InstallRPaths;
53   bool NoInstallRPath;
54   std::string InstallNameDir;
55   bool NoInstallName;
56   std::string Permissions;
57   const char* DepsVar;
58   const char* RPathPrefix;
59   const char* TmpVarPrefix;
60   cmLocalGenerator* LocalGenerator = nullptr;
61
62   void GenerateAppleLibraryScript(
63     std::ostream& os, const std::string& config,
64     const std::vector<std::string>& evaluatedRPaths, Indent indent);
65   void GenerateAppleFrameworkScript(
66     std::ostream& os, const std::string& config,
67     const std::vector<std::string>& evaluatedRPaths, Indent indent);
68   void GenerateInstallNameFixup(
69     std::ostream& os, const std::string& config,
70     const std::vector<std::string>& evaluatedRPaths,
71     const std::string& filename, const std::string& depName, Indent indent);
72   void GenerateStripFixup(std::ostream& os, const std::string& config,
73                           const std::string& depName, Indent indent);
74 };