[Cmake-commits] [cmake-commits] martink committed cmGetPropertyCommand.cxx 1.7 1.8 cmGetPropertyCommand.h 1.6 1.7 cmSetPropertyCommand.cxx 1.6 1.7 cmSetPropertyCommand.h 1.3 1.4 cmSourceFile.cxx 1.47 1.48 cmTarget.cxx 1.211 1.212 cmTest.cxx 1.9 1.10
cmake-commits at cmake.org
cmake-commits at cmake.org
Tue Apr 1 14:22:12 EDT 2008
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv30886/Source
Modified Files:
cmGetPropertyCommand.cxx cmGetPropertyCommand.h
cmSetPropertyCommand.cxx cmSetPropertyCommand.h
cmSourceFile.cxx cmTarget.cxx cmTest.cxx
Log Message:
ENH: support unset of properties
Index: cmTest.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTest.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -C 2 -d -r1.9 -r1.10
*** cmTest.cxx 17 Jan 2008 23:13:55 -0000 1.9
--- cmTest.cxx 1 Apr 2008 18:22:07 -0000 1.10
***************
*** 77,84 ****
return;
}
- if (!value)
- {
- value = "NOTFOUND";
- }
this->Properties.SetProperty(prop, value, cmProperty::TEST);
--- 77,80 ----
Index: cmSetPropertyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetPropertyCommand.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** cmSetPropertyCommand.cxx 15 Feb 2008 16:22:23 -0000 1.6
--- cmSetPropertyCommand.cxx 1 Apr 2008 18:22:06 -0000 1.7
***************
*** 24,27 ****
--- 24,28 ----
{
this->AppendMode = false;
+ this->Remove = true;
}
***************
*** 97,100 ****
--- 98,102 ----
sep = ";";
this->PropertyValue += *arg;
+ this->Remove = false;
}
else
***************
*** 142,152 ****
cmake* cm = this->Makefile->GetCMakeInstance();
const char* name = this->PropertyName.c_str();
if(this->AppendMode)
{
! cm->AppendProperty(name, this->PropertyValue.c_str());
}
else
{
! cm->SetProperty(name, this->PropertyValue.c_str());
}
--- 144,159 ----
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, value);
}
else
{
! cm->SetProperty(name, value);
}
***************
*** 203,213 ****
// Set or append the property.
const char* name = this->PropertyName.c_str();
if(this->AppendMode)
{
! mf->AppendProperty(name, this->PropertyValue.c_str());
}
else
{
! mf->SetProperty(name, this->PropertyValue.c_str());
}
--- 210,225 ----
// 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, value);
}
else
{
! mf->SetProperty(name, value);
}
***************
*** 246,256 ****
// Set or append the property.
const char* name = this->PropertyName.c_str();
if(this->AppendMode)
{
! target->AppendProperty(name, this->PropertyValue.c_str());
}
else
{
! target->SetProperty(name, this->PropertyValue.c_str());
}
--- 258,273 ----
// 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, value);
}
else
{
! target->SetProperty(name, value);
}
***************
*** 288,298 ****
// Set or append the property.
const char* name = this->PropertyName.c_str();
if(this->AppendMode)
{
! sf->AppendProperty(name, this->PropertyValue.c_str());
}
else
{
! sf->SetProperty(name, this->PropertyValue.c_str());
}
return true;
--- 305,321 ----
// 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, value);
}
else
{
! sf->SetProperty(name, value);
}
return true;
***************
*** 344,354 ****
// Set or append the property.
const char* name = this->PropertyName.c_str();
if(this->AppendMode)
{
! test->AppendProperty(name, this->PropertyValue.c_str());
}
else
{
! test->SetProperty(name, this->PropertyValue.c_str());
}
--- 367,382 ----
// 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, value);
}
else
{
! test->SetProperty(name, value);
}
Index: cmSourceFile.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSourceFile.cxx,v
retrieving revision 1.47
retrieving revision 1.48
diff -C 2 -d -r1.47 -r1.48
*** cmSourceFile.cxx 18 Feb 2008 21:38:34 -0000 1.47
--- cmSourceFile.cxx 1 Apr 2008 18:22:07 -0000 1.48
***************
*** 263,270 ****
return;
}
- if (!value)
- {
- value = "NOTFOUND";
- }
this->Properties.SetProperty(prop, value, cmProperty::SOURCE_FILE);
--- 263,266 ----
Index: cmGetPropertyCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetPropertyCommand.cxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -C 2 -d -r1.7 -r1.8
*** cmGetPropertyCommand.cxx 30 Jan 2008 16:21:54 -0000 1.7
--- cmGetPropertyCommand.cxx 1 Apr 2008 18:22:06 -0000 1.8
***************
*** 95,98 ****
--- 95,103 ----
this->InfoType = OutFullDoc;
}
+ else if(args[i] == "SET")
+ {
+ doing = DoingNone;
+ this->InfoType = OutSet;
+ }
else if(args[i] == "DEFINED")
{
***************
*** 159,162 ****
--- 164,181 ----
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
{
***************
*** 182,186 ****
bool cmGetPropertyCommand::StoreResult(const char* value)
{
! if(this->InfoType == OutDefined)
{
this->Makefile->AddDefinition(this->Variable.c_str(), value? "1":"0");
--- 201,205 ----
bool cmGetPropertyCommand::StoreResult(const char* value)
{
! if(this->InfoType == OutSet)
{
this->Makefile->AddDefinition(this->Variable.c_str(), value? "1":"0");
Index: cmTarget.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmTarget.cxx,v
retrieving revision 1.211
retrieving revision 1.212
diff -C 2 -d -r1.211 -r1.212
*** cmTarget.cxx 28 Mar 2008 17:07:03 -0000 1.211
--- cmTarget.cxx 1 Apr 2008 18:22:07 -0000 1.212
***************
*** 1592,1599 ****
return;
}
- if (!value)
- {
- value = "NOTFOUND";
- }
this->Properties.SetProperty(prop, value, cmProperty::TARGET);
--- 1592,1595 ----
Index: cmSetPropertyCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmSetPropertyCommand.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C 2 -d -r1.3 -r1.4
*** cmSetPropertyCommand.h 23 Jan 2008 15:27:59 -0000 1.3
--- cmSetPropertyCommand.h 1 Apr 2008 18:22:07 -0000 1.4
***************
*** 93,96 ****
--- 93,97 ----
std::string PropertyName;
std::string PropertyValue;
+ bool Remove;
bool AppendMode;
Index: cmGetPropertyCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmGetPropertyCommand.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C 2 -d -r1.6 -r1.7
*** cmGetPropertyCommand.h 23 Jan 2008 15:27:59 -0000 1.6
--- cmGetPropertyCommand.h 1 Apr 2008 18:22:06 -0000 1.7
***************
*** 69,73 ****
" VARIABLE>\n"
" PROPERTY <name>\n"
! " [DEFINED | BRIEF_DOCS | FULL_DOCS])\n"
"Get one property from one object in a scope. "
"The first argument specifies the variable in which to store the "
--- 69,73 ----
" VARIABLE>\n"
" PROPERTY <name>\n"
! " [SET | DEFINED | BRIEF_DOCS | FULL_DOCS])\n"
"Get one property from one object in a scope. "
"The first argument specifies the variable in which to store the "
***************
*** 86,91 ****
"of the property to get. "
"If the property is not set an empty value is returned. "
"If the DEFINED option is given the variable is set to a boolean "
! "value indicating whether the property has been set. "
"If BRIEF_DOCS or FULL_DOCS is given then the variable is set to "
"a string containing documentation for the requested property. "
--- 86,94 ----
"of the property to get. "
"If the property is not set an empty value is returned. "
+ "If the SET option is given the variable is set to a boolean "
+ "value indicating whether the property has been set."
"If the DEFINED option is given the variable is set to a boolean "
! "value indicating whether the property has been defined "
! "such as with define_property. "
"If BRIEF_DOCS or FULL_DOCS is given then the variable is set to "
"a string containing documentation for the requested property. "
***************
*** 96,100 ****
cmTypeMacro(cmGetPropertyCommand, cmCommand);
private:
! enum OutType { OutValue, OutDefined, OutBriefDoc, OutFullDoc };
std::string Variable;
std::string Name;
--- 99,103 ----
cmTypeMacro(cmGetPropertyCommand, cmCommand);
private:
! enum OutType { OutValue, OutDefined, OutBriefDoc, OutFullDoc, OutSet };
std::string Variable;
std::string Name;
More information about the Cmake-commits
mailing list