summaryrefslogtreecommitdiffstats
path: root/Source
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
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')
-rw-r--r--Source/cmLinkLibrariesCommand.cxx6
-rw-r--r--Source/cmMSDotNETGenerator.cxx31
-rw-r--r--Source/cmSystemTools.cxx34
-rw-r--r--Source/cmSystemTools.h7
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx6
5 files changed, 68 insertions, 16 deletions
diff --git a/Source/cmLinkLibrariesCommand.cxx b/Source/cmLinkLibrariesCommand.cxx
index e3d7453..1cc8b17 100644
--- a/Source/cmLinkLibrariesCommand.cxx
+++ b/Source/cmLinkLibrariesCommand.cxx
@@ -17,13 +17,15 @@
#include "cmLinkLibrariesCommand.h"
// cmLinkLibrariesCommand
-bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args)
+bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& argsIn)
{
- if(args.size() < 1 )
+ if(argsIn.size() < 1 )
{
this->SetError("called with incorrect number of arguments");
return false;
}
+ std::vector<std::string> args;
+ cmSystemTools::ExpandListArguments(argsIn, args);
// add libraries, nothe that there is an optional prefix
// of debug and optimized than can be used
for(std::vector<std::string>::const_iterator i = args.begin();
diff --git a/Source/cmMSDotNETGenerator.cxx b/Source/cmMSDotNETGenerator.cxx
index 1e99fac..fad8817 100644
--- a/Source/cmMSDotNETGenerator.cxx
+++ b/Source/cmMSDotNETGenerator.cxx
@@ -40,20 +40,27 @@ void cmMSDotNETGenerator::GenerateMakefile()
while(endpos != std::string::npos)
{
endpos = configTypes.find(' ', start);
+ std::string config;
+ std::string::size_type len;
if(endpos != std::string::npos)
{
- std::string config = configTypes.substr(start, endpos - start);
- if(config == "Debug" || config == "Release" ||
- config == "MinSizeRel" || config == "RelWithDebInfo")
- {
- m_Configurations.push_back(config);
- }
- else
- {
- cmSystemTools::Error("Invalid configuration type in CMAKE_CONFIGURATION_TYPES: ",
- config.c_str(),
- " (Valid types are Debug,Release,MinSizeRel,RelWithDebInfo)");
- }
+ len = endpos - start;
+ }
+ else
+ {
+ len = configTypes.size() - start;
+ }
+ config = configTypes.substr(start, len);
+ if(config == "Debug" || config == "Release" ||
+ config == "MinSizeRel" || config == "RelWithDebInfo")
+ {
+ m_Configurations.push_back(config);
+ }
+ else
+ {
+ cmSystemTools::Error("Invalid configuration type in CMAKE_CONFIGURATION_TYPES: ",
+ config.c_str(),
+ " (Valid types are Debug,Release,MinSizeRel,RelWithDebInfo)");
}
start = endpos+1;
}
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);
+ }
+ }
+}
diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h
index a48ea1b..d9e4796 100644
--- a/Source/cmSystemTools.h
+++ b/Source/cmSystemTools.h
@@ -43,6 +43,13 @@ public:
const char* replace,
const char* with);
+ /** Expand out any arguements in the vector that have ; separated
+ * strings into multiple arguements. A new vector is created
+ * containing the expanded versions of all arguments in argsIn.
+ */
+ static void ExpandListArguments(std::vector<std::string> const& argsIn,
+ std::vector<std::string>& argsOut);
+
/**
* Look for and replace registry values in a string
*/
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index 20c4efe..50396e5 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -17,13 +17,15 @@
#include "cmTargetLinkLibrariesCommand.h"
// cmTargetLinkLibrariesCommand
-bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& args)
+bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& argsIn)
{
- if(args.size() < 2)
+ if(argsIn.size() < 2)
{
this->SetError("called with incorrect number of arguments");
return false;
}
+ std::vector<std::string> args;
+ cmSystemTools::ExpandListArguments(argsIn, args);
// add libraries, nothe that there is an optional prefix
// of debug and optimized than can be used
std::vector<std::string>::const_iterator i = args.begin();