summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-09-10 16:59:36 -0400
committerBrad King <brad.king@kitware.com>2009-09-10 16:59:36 -0400
commitafbe0883094afddb7cbaedcb8d89031ef503ed3b (patch)
tree1d8a7b3105ae2ca0b4fa0aff6da561fb973a8c1c
parent6097c04c4d5f847dc7de1fb32f1cfd12b405db81 (diff)
downloadcmake-afbe0883094afddb7cbaedcb8d89031ef503ed3b.tar.gz
Remove barely-used cmMakefile::AddCacheDefinition
The boolean overload of this method was used only to implement option(). We re-implement option() in terms of the main method and removes the now-unused signature. This removes some duplicate code that had already fallen behind on changes (it was not removing the local definition instead of setting it).
-rw-r--r--Source/cmMakefile.cxx17
-rw-r--r--Source/cmMakefile.h2
-rw-r--r--Source/cmOptionCommand.cxx6
3 files changed, 2 insertions, 23 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index ef9a726a34..6732eec0fa 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1720,23 +1720,6 @@ void cmMakefile::AddDefinition(const char* name, bool value)
#endif
}
-
-void cmMakefile::AddCacheDefinition(const char* name,
- bool value,
- const char* doc)
-{
- bool val = value;
- cmCacheManager::CacheIterator it =
- this->GetCacheManager()->GetCacheIterator(name);
- if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED) &&
- it.Initialized())
- {
- val = it.GetValueAsBool();
- }
- this->GetCacheManager()->AddCacheEntry(name, val, doc);
- this->AddDefinition(name, val);
-}
-
void cmMakefile::RemoveDefinition(const char* name)
{
this->Internal->VarStack.top().Set(name, 0);
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 7123eb5c26..6c3d218dd5 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -294,8 +294,6 @@ public:
* Add bool variable definition to the build.
*/
void AddDefinition(const char* name, bool);
- ///! Add a definition to this makefile and the global cmake cache.
- void AddCacheDefinition(const char* name, bool, const char* doc);
/**
* Remove a variable definition from the build. This is not valid
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx
index 0c704118a4..8f2bd663e3 100644
--- a/Source/cmOptionCommand.cxx
+++ b/Source/cmOptionCommand.cxx
@@ -69,9 +69,7 @@ bool cmOptionCommand
{
initialValue = args[2];
}
- this->Makefile->AddCacheDefinition(args[0].c_str(),
- cmSystemTools::IsOn(initialValue.c_str()),
- args[1].c_str());
-
+ this->Makefile->AddCacheDefinition(args[0].c_str(), initialValue.c_str(),
+ args[1].c_str(), cmCacheManager::BOOL);
return true;
}