mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-04 05:10:10 -05:00
Genex: Fix CONFIG on imported target with no explicit mapping
When evaluating the `$<CONFIG>` genex on an imported target has the `IMPORTED_CONFIGURATIONS` property set, the current project has a config that does not match any of those, and no explicit configuration mappings are defined, fall back to the same configuration as `IMPORTED_LOCATION`. Fixes: #24222
This commit is contained in:
committed by
Brad King
parent
dcb1c9c080
commit
e455265d72
@@ -1388,6 +1388,14 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
} else if (!suffix.empty()) {
|
||||
// There is no explicit mapping for the tested config, so use
|
||||
// the configuration of the imported location that was selected.
|
||||
for (auto const& param : parameters) {
|
||||
if (cmStrCat('_', cmSystemTools::UpperCase(param)) == suffix) {
|
||||
return "1";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user