diff options
author | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-08 13:26:55 (GMT) |
---|---|---|
committer | Andy Cedilnik <andy.cedilnik@kitware.com> | 2003-08-08 13:26:55 (GMT) |
commit | 2003b4987a92be9c58cfb75c9cccdd39b8ab3c85 (patch) | |
tree | 3660aebc6a91322b16b2c02a0726e19f7a47027c /Source/cmMakefile.cxx | |
parent | 91065673d61318a9ab7aebd3459af710abe75fa3 (diff) | |
download | CMake-2003b4987a92be9c58cfb75c9cccdd39b8ab3c85.zip CMake-2003b4987a92be9c58cfb75c9cccdd39b8ab3c85.tar.gz CMake-2003b4987a92be9c58cfb75c9cccdd39b8ab3c85.tar.bz2 |
ENH: Handle untyped but initialized values for boolean AddCacheDefinition. Closes Bug #118 - Specifying cache entries with -D should not need the type
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 4569ec7..09c475b 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -874,8 +874,16 @@ void cmMakefile::AddDefinition(const char* name, bool value) void cmMakefile::AddCacheDefinition(const char* name, bool value, const char* doc) { - this->GetCacheManager()->AddCacheEntry(name, value, doc); - this->AddDefinition(name, value); + 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) |