summaryrefslogtreecommitdiffstats
path: root/Source/cmBuildNameCommand.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/cmBuildNameCommand.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/cmBuildNameCommand.cxx')
-rw-r--r--Source/cmBuildNameCommand.cxx27
1 files changed, 9 insertions, 18 deletions
diff --git a/Source/cmBuildNameCommand.cxx b/Source/cmBuildNameCommand.cxx
index 9bf4b1a..5016825 100644
--- a/Source/cmBuildNameCommand.cxx
+++ b/Source/cmBuildNameCommand.cxx
@@ -49,7 +49,7 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string>& args)
return false;
}
const char* cacheValue
- = cmCacheManager::GetInstance()->GetCacheValue("BUILDNAME");
+ = m_Makefile->GetDefinition("BUILDNAME");
if(cacheValue)
{
// do we need to correct the value?
@@ -60,16 +60,10 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string>& args)
cmSystemTools::ReplaceString(cv,"/", "_");
cmSystemTools::ReplaceString(cv,"(", "_");
cmSystemTools::ReplaceString(cv,")", "_");
- cmCacheManager::GetInstance()->
- AddCacheEntry("BUILDNAME",
- cv.c_str(),
- "Name of build.",
- cmCacheManager::STRING);
- m_Makefile->AddDefinition("BUILDNAME", cv.c_str());
- }
- else
- {
- m_Makefile->AddDefinition("BUILDNAME", cacheValue);
+ m_Makefile->AddCacheDefinition("BUILDNAME",
+ cv.c_str(),
+ "Name of build.",
+ cmCacheManager::STRING);
}
return true;
}
@@ -101,13 +95,10 @@ bool cmBuildNameCommand::InitialPass(std::vector<std::string>& args)
cmSystemTools::ReplaceString(buildname,
")", "_");
- cmCacheManager::GetInstance()->
- AddCacheEntry("BUILDNAME",
- buildname.c_str(),
- "Name of build.",
- cmCacheManager::STRING);
-
- m_Makefile->AddDefinition("BUILDNAME", buildname.c_str());
+ m_Makefile->AddCacheDefinition("BUILDNAME",
+ buildname.c_str(),
+ "Name of build.",
+ cmCacheManager::STRING);
return true;
}