summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-09 21:57:12 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-09 21:57:12 (GMT)
commit21fc04efaf2a77a346dd3e553be63cfe24f663ff (patch)
treea1d075563cc0ce298d11e9ffa767b1bebc2cc22b
parent1d96c943e0d029c4ad0b98d5a08e34f54ed8a8e5 (diff)
downloadCMake-21fc04efaf2a77a346dd3e553be63cfe24f663ff.zip
CMake-21fc04efaf2a77a346dd3e553be63cfe24f663ff.tar.gz
CMake-21fc04efaf2a77a346dd3e553be63cfe24f663ff.tar.bz2
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.
-rw-r--r--Source/cmGetPropertyCommand.cxx9
1 files changed, 8 insertions, 1 deletions
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;
}