summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-10-22 13:08:15 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-10-22 13:08:15 (GMT)
commit7809adb8145ce0d1831dc34c49f1406ad7fa68ad (patch)
tree22a1b7cd6e577749e35aa0028860dfcecbb0f243 /Source
parentc9518497997845306b2d1127fbd7acf4e6081fe8 (diff)
parent4e184a21beda9de3703ecda94085c234f5bbd7da (diff)
downloadCMake-7809adb8145ce0d1831dc34c49f1406ad7fa68ad.zip
CMake-7809adb8145ce0d1831dc34c49f1406ad7fa68ad.tar.gz
CMake-7809adb8145ce0d1831dc34c49f1406ad7fa68ad.tar.bz2
Merge topic 'string-CONCAT-command'
4e184a2 string: Add CONCAT sub-command
Diffstat (limited to 'Source')
-rw-r--r--Source/cmStringCommand.cxx25
-rw-r--r--Source/cmStringCommand.h1
2 files changed, 26 insertions, 0 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index 68ba13f..f9b69e3 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -73,6 +73,10 @@ bool cmStringCommand
{
return this->HandleLengthCommand(args);
}
+ else if(subCommand == "CONCAT")
+ {
+ return this->HandleConcatCommand(args);
+ }
else if(subCommand == "SUBSTRING")
{
return this->HandleSubstringCommand(args);
@@ -768,6 +772,27 @@ bool cmStringCommand
//----------------------------------------------------------------------------
bool cmStringCommand
+::HandleConcatCommand(std::vector<std::string> const& args)
+{
+ if(args.size() < 2)
+ {
+ this->SetError("sub-command CONCAT requires at least one argument.");
+ return false;
+ }
+
+ std::string const& variableName = args[1];
+ std::string value;
+ for(unsigned int i = 2; i < args.size(); ++i)
+ {
+ value += args[i];
+ }
+
+ this->Makefile->AddDefinition(variableName.c_str(), value.c_str());
+ return true;
+}
+
+//----------------------------------------------------------------------------
+bool cmStringCommand
::HandleMakeCIdentifierCommand(std::vector<std::string> const& args)
{
if(args.size() != 3)
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 0e833c4..66b48e6 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -69,6 +69,7 @@ protected:
bool HandleReplaceCommand(std::vector<std::string> const& args);
bool HandleLengthCommand(std::vector<std::string> const& args);
bool HandleSubstringCommand(std::vector<std::string> const& args);
+ bool HandleConcatCommand(std::vector<std::string> const& args);
bool HandleStripCommand(std::vector<std::string> const& args);
bool HandleRandomCommand(std::vector<std::string> const& args);
bool HandleFindCommand(std::vector<std::string> const& args);