diff options
author | Brad King <brad.king@kitware.com> | 2008-01-17 18:13:55 -0500 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-17 18:13:55 -0500 |
commit | caca9b80652c7c36ed1e39e1faeec64e3397f632 (patch) | |
tree | ed463885ac3f417fdc6838367019615fafef4108 /Source/cmPropertyMap.cxx | |
parent | 9e8a1c639a92a1c2e37f0beefb62204930e7e61e (diff) | |
download | cmake-caca9b80652c7c36ed1e39e1faeec64e3397f632.tar.gz |
ENH: Add AppendProperty methods for use by C++ code in CMake. Simplify implementation of SET_PROPERTY command by using them.
Diffstat (limited to 'Source/cmPropertyMap.cxx')
-rw-r--r-- | Source/cmPropertyMap.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmPropertyMap.cxx b/Source/cmPropertyMap.cxx index dcd3cb71af..db1f75b2cd 100644 --- a/Source/cmPropertyMap.cxx +++ b/Source/cmPropertyMap.cxx @@ -63,6 +63,32 @@ void cmPropertyMap::SetProperty(const char *name, const char *value, prop->Set(name,value); } +void cmPropertyMap::AppendProperty(const char* name, const char* value, + cmProperty::ScopeType scope) +{ + // Skip if nothing to append. + if(!name || !value || !*value) + { + return; + } +#ifdef CMAKE_STRICT + if (!this->CMakeInstance) + { + cmSystemTools::Error("CMakeInstance not set on a property map!"); + abort(); + } + else + { + this->CMakeInstance->RecordPropertyAccess(name,scope); + } +#else + (void)scope; +#endif + + cmProperty *prop = this->GetOrCreateProperty(name); + prop->Append(name,value); +} + const char *cmPropertyMap ::GetPropertyValue(const char *name, cmProperty::ScopeType scope, |