summaryrefslogtreecommitdiffstats
path: root/Source/cmakewizard.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-08-28 18:51:10 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-08-28 18:51:10 (GMT)
commitd0be2896d7191e56818aaac48f7177b9d92a9693 (patch)
tree42c3a9c07f1ccd9fe8683051c921463e9d639dc7 /Source/cmakewizard.cxx
parent4855fe5c10841fd3641b7405522de3278732987f (diff)
downloadCMake-d0be2896d7191e56818aaac48f7177b9d92a9693.zip
CMake-d0be2896d7191e56818aaac48f7177b9d92a9693.tar.gz
CMake-d0be2896d7191e56818aaac48f7177b9d92a9693.tar.bz2
changed cache manager and registered generators to no longer be singletons
Diffstat (limited to 'Source/cmakewizard.cxx')
-rw-r--r--Source/cmakewizard.cxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/Source/cmakewizard.cxx b/Source/cmakewizard.cxx
index 0b759c4..2880a85 100644
--- a/Source/cmakewizard.cxx
+++ b/Source/cmakewizard.cxx
@@ -24,7 +24,8 @@ cmakewizard::cmakewizard()
}
-void cmakewizard::AskUser(const char* key, cmCacheManager::CacheEntry & entry)
+void cmakewizard::AskUser(const char* key, cmCacheManager::CacheEntry & entry,
+ cmCacheManager *cacheManager)
{
std::cout << "Variable Name: " << key << "\n";
std::cout << "Description: " << entry.m_HelpString << "\n";
@@ -35,8 +36,7 @@ void cmakewizard::AskUser(const char* key, cmCacheManager::CacheEntry & entry)
std::cin.getline(buffer, sizeof(buffer));
if(buffer[0])
{
- cmCacheManager::CacheEntry *entry =
- cmCacheManager::GetInstance()->GetCacheEntry(key);
+ cmCacheManager::CacheEntry *entry = cacheManager->GetCacheEntry(key);
if(entry)
{
entry->m_Value = buffer;
@@ -101,7 +101,7 @@ void cmakewizard::RunWizard(std::vector<std::string> const& args)
make.Generate(args);
this->ShowMessage("\n");
// load the cache from disk
- cmCacheManager *cachem = cmCacheManager::GetInstance();
+ cmCacheManager *cachem = make.GetCacheManager();
cachem->
LoadCache(cmSystemTools::GetCurrentWorkingDirectory().c_str());
cmCacheManager::CacheIterator i = cachem->NewIterator();
@@ -120,25 +120,24 @@ void cmakewizard::RunWizard(std::vector<std::string> const& args)
cmCacheManager::CacheEntry& e = askedCache.find(key)->second;
if(e.m_Value != ce.m_Value)
{
- if(m_ShowAdvanced || !cmCacheManager::GetInstance()->IsAdvanced(key.c_str()))
+ if(m_ShowAdvanced || !cachem->IsAdvanced(key.c_str()))
{
- this->AskUser(key.c_str(), ce);
+ this->AskUser(key.c_str(), ce, cachem);
asked = true;
}
}
}
else
{
- if(m_ShowAdvanced || !cmCacheManager::GetInstance()->IsAdvanced(key.c_str()))
+ if(m_ShowAdvanced || !cachem->IsAdvanced(key.c_str()))
{
- this->AskUser(key.c_str(), ce);
+ this->AskUser(key.c_str(), ce, cachem);
asked = true;
}
}
askedCache[key] = i.GetEntry();
}
- cmCacheManager::GetInstance()->
- SaveCache(cmSystemTools::GetCurrentWorkingDirectory().c_str());
+ cachem->SaveCache(cmSystemTools::GetCurrentWorkingDirectory().c_str());
}
while(asked);
this->ShowMessage("CMake complete, run make to build project.\n");