summaryrefslogtreecommitdiffstats
path: root/Source/cmOptionCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-08-08 15:54:46 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2001-08-08 15:54:46 (GMT)
commitdb1303aa7d00f49a0fdf66f120eb3e6cb0e445fe (patch)
treead569e72f02849e50e625faa1350bb05a3af08f9 /Source/cmOptionCommand.cxx
parent61ec323b6a1c4e5a44331014447e3d1d31dc1b6b (diff)
downloadCMake-db1303aa7d00f49a0fdf66f120eb3e6cb0e445fe.zip
CMake-db1303aa7d00f49a0fdf66f120eb3e6cb0e445fe.tar.gz
CMake-db1303aa7d00f49a0fdf66f120eb3e6cb0e445fe.tar.bz2
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
Diffstat (limited to 'Source/cmOptionCommand.cxx')
-rw-r--r--Source/cmOptionCommand.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 7a0e051..db3c007 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -52,7 +52,7 @@ bool cmOptionCommand::InitialPass(std::vector<std::string>& 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<std::string>& 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;