diff options
author | Ken Martin <ken.martin@kitware.com> | 2007-06-25 13:51:37 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2007-06-25 13:51:37 (GMT) |
commit | 509f1fb9cb2d23938f4f4217a7f51597fa4af18a (patch) | |
tree | fcaaa9a18d57d26b72b108859ebd6844055170f6 /Source/cmake.cxx | |
parent | 2d1c85ade3f7824eeb3f342f4a96a8843ee7b7b8 (diff) | |
download | CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.zip CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.tar.gz CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.tar.bz2 |
ENH: some property cleanup and added GetProperty
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 378b6c9..f1d539f 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3028,6 +3028,40 @@ const char *cmake::GetProperty(const char* prop) const char *cmake::GetProperty(const char* prop, cmProperty::ScopeType scope) { bool chain = false; + + // watch for special properties + std::string propname = prop; + std::string output = ""; + if ( propname == "CACHE_VARIABLES" ) + { + cmCacheManager::CacheIterator cit = + this->GetCacheManager()->GetCacheIterator(); + for ( cit.Begin(); !cit.IsAtEnd(); cit.Next() ) + { + if ( output.size() ) + { + output += ";"; + } + output += cit.GetName(); + } + this->SetProperty("CACHE_VARIABLES", output.c_str()); + } + else if ( propname == "COMMANDS" ) + { + cmake::RegisteredCommandsMap::iterator cmds + = this->GetCommands()->begin(); + for (unsigned int cc=0 ; cmds != this->GetCommands()->end(); ++ cmds ) + { + if ( cc > 0 ) + { + output += ";"; + } + output += cmds->first.c_str(); + cc++; + } + this->SetProperty("COMMANDS",output.c_str()); + } + return this->Properties.GetPropertyValue(prop, scope, chain); } |