mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-18 13:10:17 -06:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user