diff options
author | Craig Scott <craig.scott@crascit.com> | 2018-08-18 00:51:06 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2018-08-18 00:51:17 (GMT) |
commit | 6b1089399a54269b8e12830a655dc9f0ae18995a (patch) | |
tree | 4a248c8f07335123d8a5b760a7eb9053421278e2 /Source | |
parent | 43027ce56dfc8b11519a4ef1a11f5543d8568e03 (diff) | |
parent | dbd3e2c53d2fb0c19a08a0fe8780df5eb4f89476 (diff) | |
download | CMake-6b1089399a54269b8e12830a655dc9f0ae18995a.zip CMake-6b1089399a54269b8e12830a655dc9f0ae18995a.tar.gz CMake-6b1089399a54269b8e12830a655dc9f0ae18995a.tar.bz2 |
Merge topic 'export-properties-undefined'
dbd3e2c53d EXPORT_PROPERTIES: Prevent null dereference for undefined property
b88bf6796e EXPORT_PROPERTIES: Add test for an undefined property
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2294
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 002fae6..75d3374 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1174,6 +1174,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. + continue; + } std::string evaluatedValue = cmGeneratorExpression::Preprocess( propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions); if (evaluatedValue != propertyValue) { |