| 51 | } |
| 52 | |
| 53 | void 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 |
nothing calls this directly
no test coverage detected