cmInstallRuntimeDependencySetGenerator.h 2.4 KB

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