| 3010 | } |
| 3011 | |
| 3012 | std::string cmTarget::ImportedGetFullPath( |
| 3013 | std::string const& config, cmStateEnums::ArtifactType artifact, |
| 3014 | ImportArtifactMissingOk missingOk) const |
| 3015 | { |
| 3016 | assert(this->IsImported()); |
| 3017 | |
| 3018 | // Lookup/compute/cache the import information for this |
| 3019 | // configuration. |
| 3020 | std::string desired_config = config; |
| 3021 | if (config.empty()) { |
| 3022 | desired_config = "NOCONFIG"; |
| 3023 | } |
| 3024 | |
| 3025 | std::string result; |
| 3026 | |
| 3027 | cmValue loc = nullptr; |
| 3028 | cmValue imp = nullptr; |
| 3029 | std::string suffix; |
| 3030 | |
| 3031 | if (this->GetType() != cmStateEnums::INTERFACE_LIBRARY && |
| 3032 | this->GetMappedConfig(desired_config, loc, imp, suffix)) { |
| 3033 | switch (artifact) { |
| 3034 | case cmStateEnums::RuntimeBinaryArtifact: |
| 3035 | if (loc) { |
| 3036 | result = *loc; |
| 3037 | } else if (imp) { |
| 3038 | result = *imp; |
| 3039 | } else { |
| 3040 | std::string impProp = cmStrCat("IMPORTED_LOCATION", suffix); |
| 3041 | if (cmValue config_location = this->GetProperty(impProp)) { |
| 3042 | result = *config_location; |
| 3043 | } else if (cmValue location = |
| 3044 | this->GetProperty("IMPORTED_LOCATION")) { |
| 3045 | result = *location; |
| 3046 | } |
| 3047 | if (result.empty() && |
| 3048 | (this->GetType() == cmStateEnums::SHARED_LIBRARY || |
| 3049 | this->IsExecutableWithExports())) { |
| 3050 | impProp = cmStrCat("IMPORTED_IMPLIB", suffix); |
| 3051 | if (cmValue config_implib = this->GetProperty(impProp)) { |
| 3052 | result = *config_implib; |
| 3053 | } else if (cmValue implib = this->GetProperty("IMPORTED_IMPLIB")) { |
| 3054 | result = *implib; |
| 3055 | } |
| 3056 | } |
| 3057 | } |
| 3058 | if (this->IsApple() && |
| 3059 | (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY || |
| 3060 | this->impl->TargetType == cmStateEnums::STATIC_LIBRARY || |
| 3061 | this->impl->TargetType == cmStateEnums::UNKNOWN_LIBRARY) && |
| 3062 | cmSystemTools::IsPathToXcFramework(result)) { |
| 3063 | auto plist = cmParseXcFrameworkPlist(result, *this->impl->Makefile, |
| 3064 | this->impl->Backtrace); |
| 3065 | if (!plist) { |
| 3066 | return ""; |
| 3067 | } |
| 3068 | auto const* library = plist->SelectSuitableLibrary( |
| 3069 | *this->impl->Makefile, this->impl->Backtrace); |
no test coverage detected