diff options
author | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-03-13 17:30:00 (GMT) |
---|---|---|
committer | Vitaly Stakhovsky <vvs31415@gitlab.org> | 2020-03-13 17:32:17 (GMT) |
commit | 60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14 (patch) | |
tree | 575fad8fdaf9dd42c0d88785a5aa6b361406fe80 /Source/cmExportFileGenerator.cxx | |
parent | 3766633b8a49cb24f4849721bb22a0feb9ba1f60 (diff) | |
download | CMake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.zip CMake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.tar.gz CMake-60f57d0dccb18bfcb37e6bd0c6496cc2e7996d14.tar.bz2 |
cmPropertyMap: Introduce cmProp as return type for GetProperty() functions
Currently properties are usually stored internally as `std::string`.
However, family of GetProperty() functions return them as `const char *` using `c_str()`.
The proposed `cmProp`, typedef'ed as `const std::string *` will expose properties
more naturally.
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 6441e6f..72a0d74 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1215,9 +1215,9 @@ bool cmExportFileGenerator::PopulateExportProperties( std::string& errorMessage) { auto& targetProperties = gte->Target->GetProperties(); - if (const char* exportProperties = + if (cmProp exportProperties = targetProperties.GetPropertyValue("EXPORT_PROPERTIES")) { - for (auto& prop : cmExpandedList(exportProperties)) { + for (auto& prop : cmExpandedList(*exportProperties)) { /* Black list reserved properties */ if (cmHasLiteralPrefix(prop, "IMPORTED_") || cmHasLiteralPrefix(prop, "INTERFACE_")) { @@ -1228,15 +1228,15 @@ bool cmExportFileGenerator::PopulateExportProperties( errorMessage = e.str(); return false; } - auto propertyValue = targetProperties.GetPropertyValue(prop); + cmProp 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) { + *propertyValue, cmGeneratorExpression::StripAllGeneratorExpressions); + if (evaluatedValue != *propertyValue) { std::ostringstream e; e << "Target \"" << gte->Target->GetName() << "\" contains property \"" << prop << "\" in EXPORT_PROPERTIES but this property contains a " @@ -1244,7 +1244,7 @@ bool cmExportFileGenerator::PopulateExportProperties( errorMessage = e.str(); return false; } - properties[prop] = propertyValue; + properties[prop] = *propertyValue; } } return true; |