From db1303aa7d00f49a0fdf66f120eb3e6cb0e445fe Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 8 Aug 2001 11:54:46 -0400 Subject: ENH: big change, only allow commands access to the cache via the cmMakefile class and GetDefinition, also the cmMakefile is the only way for commands to add to the cache. Also, some changes to configure.in that check for for scoping --- Source/cmOptionCommand.cxx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'Source/cmOptionCommand.cxx') diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx index 7a0e051a3a..db3c0071a0 100644 --- a/Source/cmOptionCommand.cxx +++ b/Source/cmOptionCommand.cxx @@ -52,7 +52,7 @@ bool cmOptionCommand::InitialPass(std::vector& args) // Now check and see if the value has been stored in the cache // already, if so use that value and don't look for the program const char* cacheValue - = cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str()); + = m_Makefile->GetDefinition(args[0].c_str()); if(!cacheValue) { const char* initialValue = "Off"; @@ -60,17 +60,14 @@ bool cmOptionCommand::InitialPass(std::vector& args) { initialValue = args[2].c_str(); } - cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(), - cmSystemTools::IsOn(initialValue), - args[1].c_str()); - m_Makefile->AddDefinition(args[0].c_str(), initialValue); + m_Makefile->AddCacheDefinition(args[0].c_str(), + cmSystemTools::IsOn(initialValue), + args[1].c_str()); } else { - m_Makefile->AddDefinition(args[0].c_str(), cacheValue); - cmCacheManager::GetInstance()-> - AddCacheEntry(args[0].c_str(), - cmSystemTools::IsOn(cacheValue), args[1].c_str()); + m_Makefile->AddCacheDefinition(args[0].c_str(), + cmSystemTools::IsOn(cacheValue), args[1].c_str()); } return true; -- cgit v1.2.1