diff options
author | Brad King <brad.king@kitware.com> | 2015-06-08 17:54:11 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2015-06-08 17:54:11 (GMT) |
commit | d17aa60659a1a69f9101c61a149eca5842291226 (patch) | |
tree | 3f174d1aeb08bacf51bb523841a066a8d25c4339 /Source/cmState.cxx | |
parent | ccc6fe94453444ebd5e655a9f90a5d074049f846 (diff) | |
parent | 8174e5cd9424a7f45174562f21eb80eb06a3f3d0 (diff) | |
download | CMake-d17aa60659a1a69f9101c61a149eca5842291226.zip CMake-d17aa60659a1a69f9101c61a149eca5842291226.tar.gz CMake-d17aa60659a1a69f9101c61a149eca5842291226.tar.bz2 |
Merge topic 'data-layout'
8174e5cd cmCustomCommand: Remove special member functions.
34e1d6db cmCustomCommand: Re-arrange data layout.
54cb76f2 cmComputeLinkDepends: Re-arrange data layout.
b661d6c6 cmQtAutoGenerators: Re-arrange data layout.
40844a14 cmProcessTools: Re-arrange data layout.
b1ff32af cmOrderDirectories: Re-arrange data layout.
dd0417c7 cmInstallTargetGenerator: Re-arrange data layout.
125c4866 cmInstallFilesGenerator: Re-arrange data layout.
92b8b1fc cmGraphVizWriter: Re-arrange data layout.
7f3e1623 cmGlobalGenerator: Re-arrange data layout.
d9df7fa7 cmComputeComponentGraph: Re-arrange data layout.
db24e41b cmCommandArgumentParserHelper: Re-arrange data.
4cd13e80 cmComputeLinkInformation: Re-arrange data layout.
3e087a40 cmLocalUnixMakefileGenerator: Re-arrange data layout.
e0421701 cmMakefile: Re-arrange data layout.
c26696eb cmSourceFile: Re-arrange data.
...
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index 6ca875d..a13c13f 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -259,27 +259,41 @@ void cmState::DefineProperty(const std::string& name, chained); } -cmPropertyDefinition *cmState +cmPropertyDefinition const* cmState ::GetPropertyDefinition(const std::string& name, - cmProperty::ScopeType scope) + cmProperty::ScopeType scope) const { if (this->IsPropertyDefined(name,scope)) { - return &(this->PropertyDefinitions[scope][name]); + cmPropertyDefinitionMap const& defs = + this->PropertyDefinitions.find(scope)->second; + return &defs.find(name)->second; } return 0; } bool cmState::IsPropertyDefined(const std::string& name, - cmProperty::ScopeType scope) + cmProperty::ScopeType scope) const { - return this->PropertyDefinitions[scope].IsPropertyDefined(name); + std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>::const_iterator it + = this->PropertyDefinitions.find(scope); + if (it == this->PropertyDefinitions.end()) + { + return false; + } + return it->second.IsPropertyDefined(name); } bool cmState::IsPropertyChained(const std::string& name, - cmProperty::ScopeType scope) + cmProperty::ScopeType scope) const { - return this->PropertyDefinitions[scope].IsPropertyChained(name); + std::map<cmProperty::ScopeType, cmPropertyDefinitionMap>::const_iterator it + = this->PropertyDefinitions.find(scope); + if (it == this->PropertyDefinitions.end()) + { + return false; + } + return it->second.IsPropertyChained(name); } void cmState::SetLanguageEnabled(std::string const& l) @@ -427,14 +441,13 @@ void cmState::RemoveUserDefinedCommands() void cmState::SetGlobalProperty(const std::string& prop, const char* value) { - this->GlobalProperties.SetProperty(prop, value, cmProperty::GLOBAL); + this->GlobalProperties.SetProperty(prop, value); } void cmState::AppendGlobalProperty(const std::string& prop, const char* value, bool asString) { - this->GlobalProperties.AppendProperty(prop, value, - cmProperty::GLOBAL, asString); + this->GlobalProperties.AppendProperty(prop, value, asString); } const char *cmState::GetGlobalProperty(const std::string& prop) @@ -472,9 +485,7 @@ const char *cmState::GetGlobalProperty(const std::string& prop) return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; } #undef STRING_LIST_ELEMENT - bool dummy = false; - return this->GlobalProperties.GetPropertyValue(prop, cmProperty::GLOBAL, - dummy); + return this->GlobalProperties.GetPropertyValue(prop); } bool cmState::GetGlobalPropertyAsBool(const std::string& prop) |