diff options
author | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-23 12:49:54 (GMT) |
---|---|---|
committer | Sebastian Holtermann <sebholt@xwmw.org> | 2019-05-23 14:19:49 (GMT) |
commit | 006229278b54ee92003100773a0430565fb8fe87 (patch) | |
tree | 04a9927d32bf98df5685fde3b0e5be4811e67f8d /Source/cmCustomCommandGenerator.cxx | |
parent | 999516478d56d8604d1413fe3c677a860357516c (diff) | |
download | CMake-006229278b54ee92003100773a0430565fb8fe87.zip CMake-006229278b54ee92003100773a0430565fb8fe87.tar.gz CMake-006229278b54ee92003100773a0430565fb8fe87.tar.bz2 |
Use cmAppend to append ranges to std::vector instances
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r-- | Source/cmCustomCommandGenerator.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx index 6bf9946..e58fc76 100644 --- a/Source/cmCustomCommandGenerator.cxx +++ b/Source/cmCustomCommandGenerator.cxx @@ -2,6 +2,7 @@ file Copyright.txt or https://cmake.org/licensing for details. */ #include "cmCustomCommandGenerator.h" +#include "cmAlgorithms.h" #include "cmCustomCommand.h" #include "cmCustomCommandLines.h" #include "cmGeneratorExpression.h" @@ -33,9 +34,7 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, this->GE->Parse(clarg); std::string parsed_arg = cge->Evaluate(this->LG, this->Config); if (this->CC.GetCommandExpandLists()) { - std::vector<std::string> ExpandedArg; - cmSystemTools::ExpandListArgument(parsed_arg, ExpandedArg); - argv.insert(argv.end(), ExpandedArg.begin(), ExpandedArg.end()); + cmAppend(argv, cmSystemTools::ExpandedListArgument(parsed_arg)); } else { argv.push_back(std::move(parsed_arg)); } @@ -54,15 +53,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc, std::vector<std::string> depends = this->CC.GetDepends(); for (std::string const& d : depends) { std::unique_ptr<cmCompiledGeneratorExpression> cge = this->GE->Parse(d); - std::vector<std::string> result; - cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config), - result); + std::vector<std::string> result = cmSystemTools::ExpandedListArgument( + cge->Evaluate(this->LG, this->Config)); for (std::string& it : result) { if (cmSystemTools::FileIsFullPath(it)) { it = cmSystemTools::CollapseFullPath(it); } } - this->Depends.insert(this->Depends.end(), result.begin(), result.end()); + cmAppend(this->Depends, result); } const std::string& workingdirectory = this->CC.GetWorkingDirectory(); |