summaryrefslogtreecommitdiffstats
path: root/Source/cmSetPropertyCommand.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/cmSetPropertyCommand.cxx
parentd00476610d830a0db96da26d6c87e33d36860120 (diff)
downloadCMake-16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1.zip
CMake-16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1.tar.gz
CMake-16f1cc9b59c59dcd763ea9d2b65548fa5f7b4fa1.tar.bz2
ENH: support unset of properties
Diffstat (limited to 'Source/cmSetPropertyCommand.cxx')
-rw-r--r--Source/cmSetPropertyCommand.cxx48
1 files changed, 38 insertions, 10 deletions
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index c1ed54b..21eeaf1 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -23,6 +23,7 @@
cmSetPropertyCommand::cmSetPropertyCommand()
{
this->AppendMode = false;
+ this->Remove = true;
}
//----------------------------------------------------------------------------
@@ -96,6 +97,7 @@ bool cmSetPropertyCommand
this->PropertyValue += sep;
sep = ";";
this->PropertyValue += *arg;
+ this->Remove = false;
}
else
{
@@ -141,13 +143,18 @@ bool cmSetPropertyCommand::HandleGlobalMode()
// Set or append the property.
cmake* cm = this->Makefile->GetCMakeInstance();
const char* name = this->PropertyName.c_str();
+ const char *value = this->PropertyValue.c_str();
+ if (this->Remove)
+ {
+ value = 0;
+ }
if(this->AppendMode)
{
- cm->AppendProperty(name, this->PropertyValue.c_str());
+ cm->AppendProperty(name, value);
}
else
{
- cm->SetProperty(name, this->PropertyValue.c_str());
+ cm->SetProperty(name, value);
}
return true;
@@ -202,13 +209,18 @@ bool cmSetPropertyCommand::HandleDirectoryMode()
// Set or append the property.
const char* name = this->PropertyName.c_str();
+ const char *value = this->PropertyValue.c_str();
+ if (this->Remove)
+ {
+ value = 0;
+ }
if(this->AppendMode)
{
- mf->AppendProperty(name, this->PropertyValue.c_str());
+ mf->AppendProperty(name, value);
}
else
{
- mf->SetProperty(name, this->PropertyValue.c_str());
+ mf->SetProperty(name, value);
}
return true;
@@ -245,13 +257,18 @@ bool cmSetPropertyCommand::HandleTarget(cmTarget* target)
{
// Set or append the property.
const char* name = this->PropertyName.c_str();
+ const char *value = this->PropertyValue.c_str();
+ if (this->Remove)
+ {
+ value = 0;
+ }
if(this->AppendMode)
{
- target->AppendProperty(name, this->PropertyValue.c_str());
+ target->AppendProperty(name, value);
}
else
{
- target->SetProperty(name, this->PropertyValue.c_str());
+ target->SetProperty(name, value);
}
return true;
@@ -287,13 +304,19 @@ bool cmSetPropertyCommand::HandleSource(cmSourceFile* sf)
{
// Set or append the property.
const char* name = this->PropertyName.c_str();
+ const char *value = this->PropertyValue.c_str();
+ if (this->Remove)
+ {
+ value = 0;
+ }
+
if(this->AppendMode)
{
- sf->AppendProperty(name, this->PropertyValue.c_str());
+ sf->AppendProperty(name, value);
}
else
{
- sf->SetProperty(name, this->PropertyValue.c_str());
+ sf->SetProperty(name, value);
}
return true;
}
@@ -343,13 +366,18 @@ bool cmSetPropertyCommand::HandleTest(cmTest* test)
{
// Set or append the property.
const char* name = this->PropertyName.c_str();
+ const char *value = this->PropertyValue.c_str();
+ if (this->Remove)
+ {
+ value = 0;
+ }
if(this->AppendMode)
{
- test->AppendProperty(name, this->PropertyValue.c_str());
+ test->AppendProperty(name, value);
}
else
{
- test->SetProperty(name, this->PropertyValue.c_str());
+ test->SetProperty(name, value);
}
return true;