summaryrefslogtreecommitdiffstats
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-03-06 15:10:46 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-03-06 15:10:46 (GMT)
commit8aa3c35dadb67d63873d44a9ef55391e419376a1 (patch)
treecfcd77fefb78a136c8e312dedf1fa0ab1edf92e3 /Source/cmSystemTools.cxx
parent4651dbcfc64836988649c2ca7e3e30c811723eb2 (diff)
downloadCMake-8aa3c35dadb67d63873d44a9ef55391e419376a1.zip
CMake-8aa3c35dadb67d63873d44a9ef55391e419376a1.tar.gz
CMake-8aa3c35dadb67d63873d44a9ef55391e419376a1.tar.bz2
ENH: add suport for semi-colon separated list variables
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx34
1 files changed, 34 insertions, 0 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 9893b64..a7c68d3 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1474,3 +1474,37 @@ void cmSystemTools::GlobDirs(const char *fullPath,
}
}
}
+
+
+void cmSystemTools::ExpandListArguments(std::vector<std::string> const& arguments,
+ std::vector<std::string>& newargs)
+{
+ std::vector<std::string>::const_iterator i;
+ for(i = arguments.begin();i != arguments.end(); ++i)
+ {
+ if(i->find(';') != std::string::npos)
+ {
+ std::string::size_type start = 0;
+ std::string::size_type endpos = 0;
+ while(endpos != std::string::npos)
+ {
+ endpos = i->find(';', start);
+ std::string::size_type len;
+ if(endpos != std::string::npos)
+ {
+ len = endpos - start;
+ }
+ else
+ {
+ len = i->size()-start;
+ }
+ newargs.push_back(i->substr(start, len));
+ start = endpos+1;
+ }
+ }
+ else
+ {
+ newargs.push_back(*i);
+ }
+ }
+}