Commit dbd3e2c5 authored by Craig Scott's avatar Craig Scott
Browse files

EXPORT_PROPERTIES: Prevent null dereference for undefined property

Fixes: #18260
parent b88bf679
......@@ -1143,6 +1143,11 @@ bool cmExportFileGenerator::PopulateExportProperties(
return false;
auto propertyValue = targetProperties.GetPropertyValue(prop);
if (propertyValue == nullptr) {
// Asked to export a property that isn't defined on the target. Do not
// consider this an error, there's just nothing to export.
std::string evaluatedValue = cmGeneratorExpression::Preprocess(
propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions);
if (evaluatedValue != propertyValue) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment