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.
This commit is contained in:
Vitaly Stakhovsky
2020-03-13 13:30:00 -04:00
parent 3766633b8a
commit 60f57d0dcc
12 changed files with 35 additions and 28 deletions

View File

@@ -585,7 +585,8 @@ const char* CCONV cmSourceFileGetProperty(void* arg, const char* prop)
if (!strcmp(prop, "LOCATION")) {
return sf->FullPath.c_str();
}
return sf->Properties.GetPropertyValue(prop);
cmProp retVal = sf->Properties.GetPropertyValue(prop);
return retVal ? retVal->c_str() : nullptr;
}
int CCONV cmSourceFileGetPropertyAsBool(void* arg, const char* prop)