ENH: Handle untyped but initialized values for boolean AddCacheDefinition. Closes Bug #118 - Specifying cache entries with -D should not need the type
This commit is contained in:
parent
91065673d6
commit
2003b4987a
|
@ -874,8 +874,16 @@ void cmMakefile::AddDefinition(const char* name, bool value)
|
||||||
|
|
||||||
void cmMakefile::AddCacheDefinition(const char* name, bool value, const char* doc)
|
void cmMakefile::AddCacheDefinition(const char* name, bool value, const char* doc)
|
||||||
{
|
{
|
||||||
this->GetCacheManager()->AddCacheEntry(name, value, doc);
|
bool val = value;
|
||||||
this->AddDefinition(name, 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)
|
void cmMakefile::RemoveDefinition(const char* name)
|
||||||
|
|
Loading…
Reference in New Issue