cmInstallRuntimeDependencySetGenerator.h 2.4 KB

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