diff options
author | Brad King <brad.king@kitware.com> | 2019-09-12 13:15:09 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-09-12 13:15:38 (GMT) |
commit | 1a1508c8b840ae016dc8db9da6be4cbe59d5f1aa (patch) | |
tree | 0d43865e3fc9e04870c6d7e1360ee81d1da1a68c /Source/cmFindPackageCommand.cxx | |
parent | d83bff86409c0e414046d2aeb75946037e0d2de3 (diff) | |
parent | d25a5a7ec91bfa072d3cf1a302830a54506c88c0 (diff) | |
download | CMake-1a1508c8b840ae016dc8db9da6be4cbe59d5f1aa.zip CMake-1a1508c8b840ae016dc8db9da6be4cbe59d5f1aa.tar.gz CMake-1a1508c8b840ae016dc8db9da6be4cbe59d5f1aa.tar.bz2 |
Merge topic 'modernize-use-auto'
d25a5a7ec9 clang-tidy: modernize-use-auto
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3783
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r-- | Source/cmFindPackageCommand.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index d99b20b..8f76030 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -847,8 +847,7 @@ bool cmFindPackageCommand::HandlePackageMode( // If there are files in ConsideredConfigs, it means that FooConfig.cmake // have been found, but they didn't have appropriate versions. else if (!this->ConsideredConfigs.empty()) { - std::vector<ConfigFileInfo>::const_iterator duplicate_end = - cmRemoveDuplicates(this->ConsideredConfigs); + auto duplicate_end = cmRemoveDuplicates(this->ConsideredConfigs); e << "Could not find a configuration file for package \"" << this->Name << "\" that " << (this->VersionExact ? "exactly matches" : "is compatible with") @@ -1080,7 +1079,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) std::string tmp = foundProp; cmExpandList(tmp, foundContents, false); - std::vector<std::string>::iterator nameIt = + auto nameIt = std::find(foundContents.begin(), foundContents.end(), this->Name); if (nameIt != foundContents.end()) { foundContents.erase(nameIt); @@ -1094,7 +1093,7 @@ void cmFindPackageCommand::AppendToFoundProperty(bool found) std::string tmp = notFoundProp; cmExpandList(tmp, notFoundContents, false); - std::vector<std::string>::iterator nameIt = + auto nameIt = std::find(notFoundContents.begin(), notFoundContents.end(), this->Name); if (nameIt != notFoundContents.end()) { notFoundContents.erase(nameIt); @@ -1199,8 +1198,7 @@ void cmFindPackageCommand::FillPrefixesPackageRoot() cmSearchPath& paths = this->LabeledPaths[PathLabel::PackageRoot]; // Add the PACKAGE_ROOT_PATH from each enclosing find_package call. - for (std::deque<std::vector<std::string>>::const_reverse_iterator pkgPaths = - this->Makefile->FindPackageRootPathStack.rbegin(); + for (auto pkgPaths = this->Makefile->FindPackageRootPathStack.rbegin(); pkgPaths != this->Makefile->FindPackageRootPathStack.rend(); ++pkgPaths) { for (std::string const& path : *pkgPaths) { |