summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorExpressionNode.cxx
diff options
context:
space:
mode:
authorLuis Caro Campos <3535649+jcar87@users.noreply.github.com>2022-12-15 14:58:43 (GMT)
committerBrad King <brad.king@kitware.com>2022-12-16 14:00:34 (GMT)
commite455265d72e42ccf47c27dc5068f664f9e84012d (patch)
tree8142d32c875ddce1dc9103af72e89829571410ca /Source/cmGeneratorExpressionNode.cxx
parentdcb1c9c080d9dc7231893baf8bd71713ed2fe021 (diff)
downloadCMake-e455265d72e42ccf47c27dc5068f664f9e84012d.zip
CMake-e455265d72e42ccf47c27dc5068f664f9e84012d.tar.gz
CMake-e455265d72e42ccf47c27dc5068f664f9e84012d.tar.bz2
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
Diffstat (limited to 'Source/cmGeneratorExpressionNode.cxx')
-rw-r--r--Source/cmGeneratorExpressionNode.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmGeneratorExpressionNode.cxx b/Source/cmGeneratorExpressionNode.cxx
index c14012e..e33ebd7 100644
--- a/Source/cmGeneratorExpressionNode.cxx
+++ b/Source/cmGeneratorExpressionNode.cxx
@@ -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";
+ }
+ }
}
}
}