| 3316 | } |
| 3317 | |
| 3318 | bool cmTarget::GetMappedConfigOld(std::string const& desired_config, |
| 3319 | cmValue& loc, cmValue& imp, |
| 3320 | std::string& suffix) const |
| 3321 | { |
| 3322 | std::string config_upper; |
| 3323 | if (!desired_config.empty()) { |
| 3324 | config_upper = cmSystemTools::UpperCase(desired_config); |
| 3325 | } |
| 3326 | |
| 3327 | std::string locPropBase; |
| 3328 | if (this->GetType() == cmStateEnums::INTERFACE_LIBRARY) { |
| 3329 | locPropBase = "IMPORTED_LIBNAME"; |
| 3330 | } else if (this->GetType() == cmStateEnums::OBJECT_LIBRARY) { |
| 3331 | locPropBase = "IMPORTED_OBJECTS"; |
| 3332 | } else { |
| 3333 | locPropBase = "IMPORTED_LOCATION"; |
| 3334 | } |
| 3335 | |
| 3336 | // Track the configuration-specific property suffix. |
| 3337 | suffix = cmStrCat('_', config_upper); |
| 3338 | |
| 3339 | cmList mappedConfigs; |
| 3340 | { |
| 3341 | std::string mapProp = cmStrCat("MAP_IMPORTED_CONFIG_", config_upper); |
| 3342 | if (cmValue mapValue = this->GetProperty(mapProp)) { |
| 3343 | mappedConfigs.assign(*mapValue, cmList::EmptyElements::Yes); |
| 3344 | } |
| 3345 | } |
| 3346 | |
| 3347 | // If we needed to find one of the mapped configurations but did not |
| 3348 | // There may be only IMPORTED_IMPLIB for a shared library or an executable |
| 3349 | // with exports. |
| 3350 | bool allowImp = (this->GetType() == cmStateEnums::SHARED_LIBRARY || |
| 3351 | this->IsExecutableWithExports()) || |
| 3352 | (this->IsAIX() && this->IsExecutableWithExports()) || |
| 3353 | (this->GetMakefile()->PlatformSupportsAppleTextStubs() && |
| 3354 | this->IsSharedLibraryWithExports()); |
| 3355 | |
| 3356 | // If a mapping was found, check its configurations. |
| 3357 | for (auto mci = mappedConfigs.begin(); |
| 3358 | !loc && !imp && mci != mappedConfigs.end(); ++mci) { |
| 3359 | // Look for this configuration. |
| 3360 | if (mci->empty()) { |
| 3361 | // An empty string in the mapping has a special meaning: |
| 3362 | // look up the config-less properties. |
| 3363 | loc = this->GetProperty(locPropBase); |
| 3364 | if (allowImp) { |
| 3365 | imp = this->GetProperty("IMPORTED_IMPLIB"); |
| 3366 | } |
| 3367 | // If it was found, set the suffix. |
| 3368 | if (loc || imp) { |
| 3369 | suffix.clear(); |
| 3370 | } |
| 3371 | } else { |
| 3372 | std::string mcUpper = cmSystemTools::UpperCase(*mci); |
| 3373 | std::string locProp = cmStrCat(locPropBase, '_', mcUpper); |
| 3374 | loc = this->GetProperty(locProp); |
| 3375 | if (allowImp) { |
no test coverage detected