From 21fc04efaf2a77a346dd3e553be63cfe24f663ff Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 9 Mar 2009 17:57:12 -0400 Subject: 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. --- Source/cmGetPropertyCommand.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx index 93c724a..88a3e7c 100644 --- a/Source/cmGetPropertyCommand.cxx +++ b/Source/cmGetPropertyCommand.cxx @@ -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; } -- cgit v0.12