summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-01 18:10:26 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2003-08-01 18:10:26 (GMT)
commit2f98c791fae6f46af4463e9eed5d5a674d6f1ddb (patch)
treeb2022ff1d3310b88ee917368a444bceafd4c3beb /Source/cmMakefile.cxx
parent7d33e05a15bfb56c8dfba4731c2008567f244972 (diff)
downloadCMake-2f98c791fae6f46af4463e9eed5d5a674d6f1ddb.zip
CMake-2f98c791fae6f46af4463e9eed5d5a674d6f1ddb.tar.gz
CMake-2f98c791fae6f46af4463e9eed5d5a674d6f1ddb.tar.bz2
ENH: Allow specifying cmake variables on the command line without specifying the type Bug #118 - Specifying cache entries with -D should not need the type
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx11
1 files changed, 9 insertions, 2 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index e891aa0..36997c6 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -839,8 +839,15 @@ void cmMakefile::AddCacheDefinition(const char* name, const char* value,
const char* doc,
cmCacheManager::CacheEntryType type)
{
- this->GetCacheManager()->AddCacheEntry(name, value, doc, type);
- this->AddDefinition(name, value);
+ const char* val = value;
+ cmCacheManager::CacheIterator it =
+ this->GetCacheManager()->GetCacheIterator(name);
+ if(!it.IsAtEnd() && (it.GetType() == cmCacheManager::UNINITIALIZED))
+ {
+ val = it.GetValue();
+ }
+ this->GetCacheManager()->AddCacheEntry(name, val, doc, type);
+ this->AddDefinition(name, val);
}