summaryrefslogtreecommitdiffstats
path: root/Source/cmFindPackageCommand.cxx
diff options
context:
space:
mode:
authorRegina Pfeifer <regina@mailbox.org>2019-09-04 20:17:22 (GMT)
committerRegina Pfeifer <regina@mailbox.org>2019-09-10 20:21:41 (GMT)
commitd25a5a7ec91bfa072d3cf1a302830a54506c88c0 (patch)
treed06203c8e5b5fdd38645e0fb9b284ded26651f44 /Source/cmFindPackageCommand.cxx
parentbbf48c494ad28d1c8ac5aa6e4cecb35c2cbf1b84 (diff)
downloadCMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.zip
CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.tar.gz
CMake-d25a5a7ec91bfa072d3cf1a302830a54506c88c0.tar.bz2
clang-tidy: modernize-use-auto
Set the MinTypeNameLength option to an impossibly high value in order to limit the diagnostics to iterators. Leave new expressions and cast expressions for later.
Diffstat (limited to 'Source/cmFindPackageCommand.cxx')
-rw-r--r--Source/cmFindPackageCommand.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 9132760..2edf67b 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) {