BUG: Fix get_property result for bad property

When a property does not exist we are supposed to return an empty value.
Previously if a property did not exist we just left the value of the
output variable unchanged.  This teaches CMake to remove the definition
of the output variable in this case.
This commit is contained in:
Brad King 2009-03-09 17:57:12 -04:00
parent 1d96c943e0
commit 21fc04efaf
1 changed files with 8 additions and 1 deletions

View File

@ -205,7 +205,14 @@ bool cmGetPropertyCommand::StoreResult(const char* value)
}
else // if(this->InfoType == OutValue)
{
this->Makefile->AddDefinition(this->Variable.c_str(), value);
if(value)
{
this->Makefile->AddDefinition(this->Variable.c_str(), value);
}
else
{
this->Makefile->RemoveDefinition(this->Variable.c_str());
}
}
return true;
}