summaryrefslogtreecommitdiffstats
path: root/Source/cmGetPropertyCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2008-04-01 18:22:09 (GMT)
committerKen Martin <ken.martin@kitware.com>2008-04-01 18:22:09 (GMT)
commit16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1 (patch)
tree0926d56a73423ec3f875a88d5b72015597fa81e6 /Source/cmGetPropertyCommand.cxx
parentd00476610d830a0db96da26d6c87e33d36860120 (diff)
downloadCMake-16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1.zip
CMake-16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1.tar.gz
CMake-16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1.tar.bz2
ENH: support unset of properties
Diffstat (limited to 'Source/cmGetPropertyCommand.cxx')
-rw-r--r--Source/cmGetPropertyCommand.cxx21
1 files changed, 20 insertions, 1 deletions
diff --git a/Source/cmGetPropertyCommand.cxx b/Source/cmGetPropertyCommand.cxx
index 830be0c..3d2140c 100644
--- a/Source/cmGetPropertyCommand.cxx
+++ b/Source/cmGetPropertyCommand.cxx
@@ -94,6 +94,11 @@ bool cmGetPropertyCommand
doing = DoingNone;
this->InfoType = OutFullDoc;
}
+ else if(args[i] == "SET")
+ {
+ doing = DoingNone;
+ this->InfoType = OutSet;
+ }
else if(args[i] == "DEFINED")
{
doing = DoingNone;
@@ -158,6 +163,20 @@ bool cmGetPropertyCommand
}
this->Makefile->AddDefinition(this->Variable.c_str(), output.c_str());
}
+ else if(this->InfoType == OutDefined)
+ {
+ // Lookup if the property is defined
+ const char *value;
+ if(this->Makefile->GetCMakeInstance()->
+ GetPropertyDefinition(this->PropertyName.c_str(), scope))
+ {
+ this->Makefile->AddDefinition(this->Variable.c_str(), "1");
+ }
+ else
+ {
+ this->Makefile->AddDefinition(this->Variable.c_str(), "0");
+ }
+ }
else
{
// Dispatch property getting.
@@ -181,7 +200,7 @@ bool cmGetPropertyCommand
//----------------------------------------------------------------------------
bool cmGetPropertyCommand::StoreResult(const char* value)
{
- if(this->InfoType == OutDefined)
+ if(this->InfoType == OutSet)
{
this->Makefile->AddDefinition(this->Variable.c_str(), value? "1":"0");
}