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

Method GetMappedConfigOld

Source/cmTarget.cxx:3318–3447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3316}
3317
3318bool 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) {

Callers 1

GetMappedConfigMethod · 0.95

Calls 13

GetTypeMethod · 0.95
GetPropertyMethod · 0.95
IsAIXMethod · 0.95
GetMakefileMethod · 0.95
assignMethod · 0.80
cmStrCatFunction · 0.70
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected