summaryrefslogtreecommitdiffstats
path: root/Source/CPack/IFW/cmCPackIFWGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-09-19 13:07:33 (GMT)
committerKitware Robot <kwrobot@kitware.com>2017-09-19 13:07:48 (GMT)
commit4547d9a83030f8ae7e636cef16a261c65e6feb40 (patch)
tree3b695694b889d506c61d010102e3824e89e39581 /Source/CPack/IFW/cmCPackIFWGenerator.cxx
parent7c28081c147e2eb6c7ad6dee0aada77219af7a6d (diff)
parentf43baf69814176f52b2b229667c4d3e88154bdea (diff)
downloadCMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.zip
CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.tar.gz
CMake-4547d9a83030f8ae7e636cef16a261c65e6feb40.tar.bz2
Merge topic 'ranged-for'
f43baf69 Meta: modernize old-fashioned loops to range-based `for` (CPack). Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1274
Diffstat (limited to 'Source/CPack/IFW/cmCPackIFWGenerator.cxx')
-rw-r--r--Source/CPack/IFW/cmCPackIFWGenerator.cxx29
1 files changed, 10 insertions, 19 deletions
diff --git a/Source/CPack/IFW/cmCPackIFWGenerator.cxx b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
index 574c9cf..825a888 100644
--- a/Source/CPack/IFW/cmCPackIFWGenerator.cxx
+++ b/Source/CPack/IFW/cmCPackIFWGenerator.cxx
@@ -49,19 +49,15 @@ int cmCPackIFWGenerator::PackageFiles()
ifwCmd += " -p " + this->toplevel + "/packages";
if (!this->PkgsDirsVector.empty()) {
- for (std::vector<std::string>::iterator it =
- this->PkgsDirsVector.begin();
- it != this->PkgsDirsVector.end(); ++it) {
- ifwCmd += " -p " + *it;
+ for (std::string const& it : this->PkgsDirsVector) {
+ ifwCmd += " -p " + it;
}
}
if (!this->RepoDirsVector.empty()) {
if (!this->IsVersionLess("3.1")) {
- for (std::vector<std::string>::iterator it =
- this->RepoDirsVector.begin();
- it != this->RepoDirsVector.end(); ++it) {
- ifwCmd += " --repository " + *it;
+ for (std::string const& rd : this->RepoDirsVector) {
+ ifwCmd += " --repository " + rd;
}
} else {
cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
@@ -137,19 +133,15 @@ int cmCPackIFWGenerator::PackageFiles()
ifwCmd += " -p " + this->toplevel + "/packages";
if (!this->PkgsDirsVector.empty()) {
- for (std::vector<std::string>::iterator it =
- this->PkgsDirsVector.begin();
- it != this->PkgsDirsVector.end(); ++it) {
- ifwCmd += " -p " + *it;
+ for (std::string const& it : this->PkgsDirsVector) {
+ ifwCmd += " -p " + it;
}
}
if (!this->RepoDirsVector.empty()) {
if (!this->IsVersionLess("3.1")) {
- for (std::vector<std::string>::iterator it =
- this->RepoDirsVector.begin();
- it != this->RepoDirsVector.end(); ++it) {
- ifwCmd += " --repository " + *it;
+ for (std::string const& rd : this->RepoDirsVector) {
+ ifwCmd += " --repository " + rd;
}
} else {
cmCPackIFWLogger(WARNING, "The \"CPACK_IFW_REPOSITORIES_DIRECTORIES\" "
@@ -321,9 +313,8 @@ int cmCPackIFWGenerator::InitializeInternal()
if (const char* RepoAllStr = this->GetOption("CPACK_IFW_REPOSITORIES_ALL")) {
std::vector<std::string> RepoAllVector;
cmSystemTools::ExpandListArgument(RepoAllStr, RepoAllVector);
- for (std::vector<std::string>::iterator rit = RepoAllVector.begin();
- rit != RepoAllVector.end(); ++rit) {
- this->GetRepository(*rit);
+ for (std::string const& r : RepoAllVector) {
+ this->GetRepository(r);
}
}