summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-04-07 21:14:41 (GMT)
committerBrad King <brad.king@kitware.com>2015-04-07 21:15:04 (GMT)
commit3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94 (patch)
treed0372265c5b1f07f9b1a8a6cc9bedf96bed2dbcb /Source/cmakemain.cxx
parent9410e24a4ad3a21b2c27d057798f723e88d14d45 (diff)
downloadCMake-3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94.zip
CMake-3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94.tar.gz
CMake-3347c5e4f9fcdd36c06067d6c7cd5a985a9c5d94.tar.bz2
Revert topic 'refactor-cache-api'
This topic was never tested without some follow-up commits. The GetCacheEntryValue API returns a pointer to memory freed on return. It will have to be revised along with the rest of the original topic.
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx26
1 files changed, 10 insertions, 16 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 3b518be..ac73ad0 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -328,31 +328,25 @@ int do_cmake(int ac, char const* const* av)
int res = cm.Run(args, view_only);
if ( list_cached || list_all_cached )
{
+ cmCacheManager::CacheIterator it =
+ cm.GetCacheManager()->GetCacheIterator();
std::cout << "-- Cache values" << std::endl;
- std::vector<std::string> keys =
- cm.GetCacheManager()->GetCacheEntryKeys();
- for (std::vector<std::string>::const_iterator it = keys.begin();
- it != keys.end(); ++it)
+ for ( it.Begin(); !it.IsAtEnd(); it.Next() )
{
- cmCacheManager::CacheEntryType t =
- cm.GetCacheManager()->GetCacheEntryType(*it);
+ cmCacheManager::CacheEntryType t = it.GetType();
if ( t != cmCacheManager::INTERNAL && t != cmCacheManager::STATIC &&
t != cmCacheManager::UNINITIALIZED )
{
- const char* advancedProp =
- cm.GetCacheManager()->GetCacheEntryProperty(*it, "ADVANCED");
- if ( list_all_cached || !advancedProp)
+ bool advanced = it.PropertyExists("ADVANCED");
+ if ( list_all_cached || !advanced)
{
if ( list_help )
{
- std::cout << "// "
- << cm.GetCacheManager()->GetCacheEntryProperty(*it,
- "HELPSTRING") << std::endl;
+ std::cout << "// " << it.GetProperty("HELPSTRING") << std::endl;
}
- std::cout << *it << ":" <<
- cmCacheManager::TypeToString(t)
- << "=" << cm.GetCacheManager()->GetCacheEntryValue(*it)
- << std::endl;
+ std::cout << it.GetName() << ":" <<
+ cmCacheManager::TypeToString(it.GetType())
+ << "=" << it.GetValue() << std::endl;
if ( list_help )
{
std::cout << std::endl;