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

Method ImportedGetFullPath

Source/cmTarget.cxx:3012–3136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3010}
3011
3012std::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);

Callers 8

GenerateCommandsMethod · 0.80
cmTarget.cxxFile · 0.80
GetFullPathMethod · 0.80
ImportedGetLocationMethod · 0.80
GetFullNameImportedMethod · 0.80
GetDirectoryMethod · 0.80
DumpArtifactsMethod · 0.80

Calls 13

GetTypeMethod · 0.95
GetMappedConfigMethod · 0.95
GetPropertyMethod · 0.95
IsAppleMethod · 0.95
GetPolicyStatusMethod · 0.95
cmParseXcFrameworkPlistFunction · 0.85
SelectSuitableLibraryMethod · 0.80
cmStrCatFunction · 0.70
IsImportedMethod · 0.45
emptyMethod · 0.45
GetNameMethod · 0.45

Tested by

no test coverage detected