summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-03-12 14:52:40 (GMT)
committerBrad King <brad.king@kitware.com>2009-03-12 14:52:40 (GMT)
commitdd7b48c9c386ffd7fa184284403988df85a38279 (patch)
treefe110d5cc93dbd658c20f1310f717b559b3fa48c
parent1b43bea91c9b6dd4d83b55631273db648766463d (diff)
downloadCMake-dd7b48c9c386ffd7fa184284403988df85a38279.zip
CMake-dd7b48c9c386ffd7fa184284403988df85a38279.tar.gz
CMake-dd7b48c9c386ffd7fa184284403988df85a38279.tar.bz2
ENH: Define STRINGS cache entry property
This property defines a list of values for a cache entry of type STRING. A CMake GUI may optionally use a drop-down selection widget for the entry instead of a generic text entry field. We do not enforce that the value of the entry match one of the strings listed.
-rw-r--r--Source/cmCacheManager.cxx11
-rw-r--r--Source/cmSetPropertyCommand.cxx3
2 files changed, 13 insertions, 1 deletions
diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx
index f65c80d..bc3830f 100644
--- a/Source/cmCacheManager.cxx
+++ b/Source/cmCacheManager.cxx
@@ -357,6 +357,7 @@ const char* cmCacheManager::PersistentProperties[] =
{
"ADVANCED",
"MODIFIED",
+ "STRINGS",
0
};
@@ -988,6 +989,16 @@ void cmCacheManager::DefineProperties(cmake *cm)
);
cm->DefineProperty
+ ("STRINGS", cmProperty::CACHE,
+ "Enumerate possible STRING entry values for GUI selection.",
+ "For cache entries with type STRING, this enumerates a set of values. "
+ "CMake GUIs may use this to provide a selection widget instead of a "
+ "generic string entry field. "
+ "This is for convenience only. "
+ "CMake does not enforce that the value matches one of those listed."
+ );
+
+ cm->DefineProperty
("VALUE", cmProperty::CACHE,
"Value of a cache entry.",
"This property maps to the actual value of a cache entry. "
diff --git a/Source/cmSetPropertyCommand.cxx b/Source/cmSetPropertyCommand.cxx
index fbe877b..caed6dc 100644
--- a/Source/cmSetPropertyCommand.cxx
+++ b/Source/cmSetPropertyCommand.cxx
@@ -419,12 +419,13 @@ bool cmSetPropertyCommand::HandleCacheMode()
}
}
else if(this->PropertyName != "HELPSTRING" &&
+ this->PropertyName != "STRINGS" &&
this->PropertyName != "VALUE")
{
cmOStringStream e;
e << "given invalid CACHE property " << this->PropertyName << ". "
<< "Settable CACHE properties are: "
- << "ADVANCED, HELPSTRING, TYPE, and VALUE.";
+ << "ADVANCED, HELPSTRING, STRINGS, TYPE, and VALUE.";
this->SetError(e.str().c_str());
return false;
}