diff options
author | Brad King <brad.king@kitware.com> | 2009-03-09 21:57:12 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-09 21:57:12 (GMT) |
commit | 21fc04efaf2a77a346dd3e553be63cfe24f663ff (patch) | |
tree | a1d075563cc0ce298d11e9ffa767b1bebc2cc22b /Source | |
parent | 1d96c943e0d029c4ad0b98d5a08e34f54ed8a8e5 (diff) | |
download | CMake-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.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGetPropertyCommand.cxx | 9 |
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; } |