summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.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/cmMakefile.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/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx26
1 files changed, 25 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index f8603c4..804498e 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -571,12 +571,23 @@ void cmMakefile::AddIncludeDirectory(const char* inc)
}
}
+
void cmMakefile::AddDefinition(const char* name, const char* value)
{
m_Definitions.erase( DefinitionMap::key_type(name));
m_Definitions.insert(DefinitionMap::value_type(name, value));
}
+
+void cmMakefile::AddCacheDefinition(const char* name, const char* value,
+ const char* doc,
+ cmCacheManager::CacheEntryType type)
+{
+ cmCacheManager::GetInstance()->AddCacheEntry(name, value, doc, type);
+ this->AddDefinition(name, value);
+}
+
+
void cmMakefile::AddDefinition(const char* name, bool value)
{
if(value)
@@ -591,6 +602,13 @@ void cmMakefile::AddDefinition(const char* name, bool value)
}
}
+
+void cmMakefile::AddCacheDefinition(const char* name, bool value, const char* doc)
+{
+ cmCacheManager::GetInstance()->AddCacheEntry(name, value, doc);
+ this->AddDefinition(name, value);
+}
+
void cmMakefile::SetProjectName(const char* p)
{
m_ProjectName = p;
@@ -769,6 +787,12 @@ void cmMakefile::ExpandVariables()
}
}
+bool cmMakefile::IsOn(const char* name)
+{
+ const char* value = this->GetDefinition(name);
+ return cmSystemTools::IsOn(value);
+}
+
const char* cmMakefile::GetDefinition(const char* name)
{
DefinitionMap::iterator pos = m_Definitions.find(name);
@@ -776,7 +800,7 @@ const char* cmMakefile::GetDefinition(const char* name)
{
return (*pos).second.c_str();
}
- return 0;
+ return cmCacheManager::GetInstance()->GetCacheValue(name);
}
int cmMakefile::DumpDocumentationToFile(const char *fileName)