summaryrefslogtreecommitdiffstats
path: root/Source/cmCustomCommandGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-13 12:34:49 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-13 12:35:05 (GMT)
commit67810849b95acfe036a9a605dbda6f0a3d6f7493 (patch)
treefa63356603dd00956f306eb92d4ecdbca9e450d4 /Source/cmCustomCommandGenerator.cxx
parenta763cffd6b65bbe5572527e39969981bf31d5aca (diff)
parent7d5095796ab616cf9b709036387bb95ab9984141 (diff)
downloadCMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.zip
CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.tar.gz
CMake-67810849b95acfe036a9a605dbda6f0a3d6f7493.tar.bz2
Merge topic 'ranged-for'
7d509579 Meta: modernize old-fashioned loops to range-based `for`. Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1249
Diffstat (limited to 'Source/cmCustomCommandGenerator.cxx')
-rw-r--r--Source/cmCustomCommandGenerator.cxx20
1 files changed, 8 insertions, 12 deletions
diff --git a/Source/cmCustomCommandGenerator.cxx b/Source/cmCustomCommandGenerator.cxx
index fa1c70e..ff62a60 100644
--- a/Source/cmCustomCommandGenerator.cxx
+++ b/Source/cmCustomCommandGenerator.cxx
@@ -26,12 +26,10 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
, GE(new cmGeneratorExpression(cc.GetBacktrace()))
{
const cmCustomCommandLines& cmdlines = this->CC.GetCommandLines();
- for (cmCustomCommandLines::const_iterator cmdline = cmdlines.begin();
- cmdline != cmdlines.end(); ++cmdline) {
+ for (cmCustomCommandLine const& cmdline : cmdlines) {
cmCustomCommandLine argv;
- for (cmCustomCommandLine::const_iterator clarg = cmdline->begin();
- clarg != cmdline->end(); ++clarg) {
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*clarg);
+ for (std::string const& clarg : cmdline) {
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(clarg);
std::string parsed_arg = cge->Evaluate(this->LG, this->Config);
if (this->CC.GetCommandExpandLists()) {
std::vector<std::string> ExpandedArg;
@@ -45,16 +43,14 @@ cmCustomCommandGenerator::cmCustomCommandGenerator(cmCustomCommand const& cc,
}
std::vector<std::string> depends = this->CC.GetDepends();
- for (std::vector<std::string>::const_iterator i = depends.begin();
- i != depends.end(); ++i) {
- CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(*i);
+ for (std::string const& d : depends) {
+ CM_AUTO_PTR<cmCompiledGeneratorExpression> cge = this->GE->Parse(d);
std::vector<std::string> result;
cmSystemTools::ExpandListArgument(cge->Evaluate(this->LG, this->Config),
result);
- for (std::vector<std::string>::iterator it = result.begin();
- it != result.end(); ++it) {
- if (cmSystemTools::FileIsFullPath(it->c_str())) {
- *it = cmSystemTools::CollapseFullPath(*it);
+ for (std::string& it : result) {
+ if (cmSystemTools::FileIsFullPath(it.c_str())) {
+ it = cmSystemTools::CollapseFullPath(it);
}
}
this->Depends.insert(this->Depends.end(), result.begin(), result.end());