MCPcopy Create free account
hub / github.com/Kitware/CMake / GenerateScriptForConfig

Method GenerateScriptForConfig

Source/cmInstallRuntimeDependencySetGenerator.cxx:53–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void cmInstallRuntimeDependencySetGenerator::GenerateScriptForConfig(
54 std::ostream& os, std::string const& config, Indent indent)
55{
56 if (!this->LocalGenerator->GetMakefile()
57 ->GetSafeDefinition("CMAKE_INSTALL_NAME_TOOL")
58 .empty() &&
59 !this->NoInstallName) {
60 std::string installNameDir = "@rpath/";
61 if (!this->InstallNameDir.empty()) {
62 installNameDir = this->InstallNameDir;
63 cmGeneratorExpression::ReplaceInstallPrefix(installNameDir,
64 "${CMAKE_INSTALL_PREFIX}");
65 installNameDir = cmGeneratorExpression::Evaluate(
66 installNameDir, this->LocalGenerator, config);
67 if (installNameDir.empty()) {
68 this->LocalGenerator->GetMakefile()->GetCMakeInstance()->IssueMessage(
69 MessageType::FATAL_ERROR,
70 "INSTALL_NAME_DIR argument must not evaluate to an "
71 "empty string",
72 this->Backtrace);
73 return;
74 }
75 if (installNameDir.back() != '/') {
76 installNameDir += '/';
77 }
78 }
79 os << indent << "set(" << this->TmpVarPrefix << "_install_name_dir \""
80 << installNameDir << "\")\n";
81 }
82
83 os << indent << "foreach(" << this->TmpVarPrefix << "_dep IN LISTS "
84 << this->DepsVar << ")\n";
85
86 if (!this->LocalGenerator->GetMakefile()
87 ->GetSafeDefinition("CMAKE_INSTALL_NAME_TOOL")
88 .empty()) {
89 std::vector<std::string> evaluatedRPaths;
90 for (auto const& rpath : this->InstallRPaths) {
91 std::string result =
92 cmGeneratorExpression::Evaluate(rpath, this->LocalGenerator, config);
93 if (!result.empty()) {
94 evaluatedRPaths.push_back(std::move(result));
95 }
96 }
97
98 switch (this->Type) {
99 case DependencyType::Library:
100 this->GenerateAppleLibraryScript(os, config, evaluatedRPaths,
101 indent.Next());
102 break;
103 case DependencyType::Framework:
104 this->GenerateAppleFrameworkScript(os, config, evaluatedRPaths,
105 indent.Next());
106 break;
107 }
108 } else {
109 std::string depVar = cmStrCat(this->TmpVarPrefix, "_dep");
110

Callers

nothing calls this directly

Calls 14

GetDestinationMethod · 0.95
moveFunction · 0.85
push_backMethod · 0.80
AddInstallRuleMethod · 0.80
c_strMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
GetMakefileMethod · 0.45
IssueMessageMethod · 0.45
GetCMakeInstanceMethod · 0.45

Tested by

no test coverage detected