diff options
author | Brad King <brad.king@kitware.com> | 2014-12-23 13:53:50 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2014-12-23 13:53:50 (GMT) |
commit | 656af73bca01e4d0834b398685513be2a30c2c7d (patch) | |
tree | a09fb1e2c5d5e107972d032bd8f2c6a3990d52fe /Source | |
parent | a19a43a930a577edb7f2aa2fc11e28faf7134d9c (diff) | |
parent | e2a489c76aed54e96e85627a66692a11784e9824 (diff) | |
download | CMake-656af73bca01e4d0834b398685513be2a30c2c7d.zip CMake-656af73bca01e4d0834b398685513be2a30c2c7d.tar.gz CMake-656af73bca01e4d0834b398685513be2a30c2c7d.tar.bz2 |
Merge topic 'cleanup-ExpandListArgument-usage'
e2a489c7 Remove some temporary vectors for ExpandListArgument.
0f99feec cmGeneratorExpression: Remove unused header.
722f1a71 CTest: Expand a string directly into a container.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CTest/cmCTestTestHandler.cxx | 51 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 8 | ||||
-rw-r--r-- | Source/cmGeneratorExpression.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefileTargetGenerator.cxx | 8 | ||||
-rw-r--r-- | Source/cmQtAutoGenerators.cxx | 9 |
5 files changed, 11 insertions, 67 deletions
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index f330e58..78f1fd4 100644 --- a/Source/CTest/cmCTestTestHandler.cxx +++ b/Source/CTest/cmCTestTestHandler.cxx @@ -2153,25 +2153,11 @@ bool cmCTestTestHandler::SetTestsProperties( } if ( key == "ATTACHED_FILES" ) { - std::vector<std::string> lval; - cmSystemTools::ExpandListArgument(val, lval); - - for(std::vector<std::string>::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->AttachedFiles.push_back(*f); - } + cmSystemTools::ExpandListArgument(val, rtit->AttachedFiles); } if ( key == "ATTACHED_FILES_ON_FAIL" ) { - std::vector<std::string> lval; - cmSystemTools::ExpandListArgument(val, lval); - - for(std::vector<std::string>::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->AttachOnFail.push_back(*f); - } + cmSystemTools::ExpandListArgument(val, rtit->AttachOnFail); } if ( key == "RESOURCE_LOCK" ) { @@ -2195,14 +2181,7 @@ bool cmCTestTestHandler::SetTestsProperties( } if ( key == "REQUIRED_FILES" ) { - std::vector<std::string> lval; - cmSystemTools::ExpandListArgument(val, lval); - - for(std::vector<std::string>::iterator f = lval.begin(); - f != lval.end(); ++f) - { - rtit->RequiredFiles.push_back(*f); - } + cmSystemTools::ExpandListArgument(val, rtit->RequiredFiles); } if ( key == "RUN_SERIAL" ) { @@ -2239,33 +2218,15 @@ bool cmCTestTestHandler::SetTestsProperties( } if ( key == "DEPENDS" ) { - std::vector<std::string> lval; - cmSystemTools::ExpandListArgument(val, lval); - std::vector<std::string>::iterator crit; - for ( crit = lval.begin(); crit != lval.end(); ++ crit ) - { - rtit->Depends.push_back(*crit); - } + cmSystemTools::ExpandListArgument(val, rtit->Depends); } if ( key == "ENVIRONMENT" ) { - std::vector<std::string> lval; - cmSystemTools::ExpandListArgument(val, lval); - std::vector<std::string>::iterator crit; - for ( crit = lval.begin(); crit != lval.end(); ++ crit ) - { - rtit->Environment.push_back(*crit); - } + cmSystemTools::ExpandListArgument(val, rtit->Environment); } if ( key == "LABELS" ) { - std::vector<std::string> lval; - cmSystemTools::ExpandListArgument(val, lval); - std::vector<std::string>::iterator crit; - for ( crit = lval.begin(); crit != lval.end(); ++ crit ) - { - rtit->Labels.push_back(*crit); - } + cmSystemTools::ExpandListArgument(val, rtit->Labels); } if ( key == "MEASUREMENT" ) { diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 2bf7b77..80dbaf3 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2598,16 +2598,14 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const std::string& def, return; } cmCTestLog(this, DEBUG, "PopulateCustomVector: " << def << std::endl); - std::vector<std::string> slist; - cmSystemTools::ExpandListArgument(dval, slist); - std::vector<std::string>::iterator it; vec.clear(); + cmSystemTools::ExpandListArgument(dval, vec); - for ( it = slist.begin(); it != slist.end(); ++it ) + for (std::vector<std::string>::const_iterator it = vec.begin(); + it != vec.end(); ++it ) { cmCTestLog(this, DEBUG, " -- " << *it << std::endl); - vec.push_back(*it); } } diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx index b6fe414..861122c 100644 --- a/Source/cmGeneratorExpression.cxx +++ b/Source/cmGeneratorExpression.cxx @@ -15,8 +15,6 @@ #include "cmTarget.h" #include "assert.h" -#include <cmsys/String.h> - #include "cmGeneratorExpressionEvaluator.h" #include "cmGeneratorExpressionLexer.h" #include "cmGeneratorExpressionParser.h" diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx index 067714e..cbf8573 100644 --- a/Source/cmMakefileTargetGenerator.cxx +++ b/Source/cmMakefileTargetGenerator.cxx @@ -1193,13 +1193,7 @@ void cmMakefileTargetGenerator depends.push_back(source.GetFullPath()); if(const char* objectDeps = source.GetProperty("OBJECT_DEPENDS")) { - std::vector<std::string> deps; - cmSystemTools::ExpandListArgument(objectDeps, deps); - for(std::vector<std::string>::iterator i = deps.begin(); - i != deps.end(); ++i) - { - depends.push_back(*i); - } + cmSystemTools::ExpandListArgument(objectDeps, depends); } } diff --git a/Source/cmQtAutoGenerators.cxx b/Source/cmQtAutoGenerators.cxx index 0c38366..a01a384 100644 --- a/Source/cmQtAutoGenerators.cxx +++ b/Source/cmQtAutoGenerators.cxx @@ -2368,14 +2368,7 @@ bool cmQtAutoGenerators::GenerateQrc() = this->RccOptions.find(*si); if (optionIt != this->RccOptions.end()) { - std::vector<std::string> opts; - cmSystemTools::ExpandListArgument(optionIt->second, opts); - for(std::vector<std::string>::const_iterator optIt = opts.begin(); - optIt != opts.end(); - ++optIt) - { - command.push_back(*optIt); - } + cmSystemTools::ExpandListArgument(optionIt->second, command); } command.push_back("-name"); |