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:
parent
1d96c943e0
commit
21fc04efaf
|
@ -204,9 +204,16 @@ bool cmGetPropertyCommand::StoreResult(const char* value)
|
|||
this->Makefile->AddDefinition(this->Variable.c_str(), value? "1":"0");
|
||||
}
|
||||
else // if(this->InfoType == OutValue)
|
||||
{
|
||||
if(value)
|
||||
{
|
||||
this->Makefile->AddDefinition(this->Variable.c_str(), value);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->Makefile->RemoveDefinition(this->Variable.c_str());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue