diff options
author | Brad King <brad.king@kitware.com> | 2016-10-11 17:09:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-10-11 17:17:48 (GMT) |
commit | 6db64ad43202af66270d996775e1504ba676b63d (patch) | |
tree | 4e9f9b3be93b09f435e37612d1c94d4296a46c57 /Source | |
parent | d3df00ae5330de935eafd0f315017ae0f89a6968 (diff) | |
download | CMake-6db64ad43202af66270d996775e1504ba676b63d.zip CMake-6db64ad43202af66270d996775e1504ba676b63d.tar.gz CMake-6db64ad43202af66270d996775e1504ba676b63d.tar.bz2 |
cmake: Use array iteration for default generator list
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmake.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index d74b7c1..6ffa308 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1466,18 +1466,18 @@ void cmake::CreateDefaultGlobalGenerator() { "11.0", "Visual Studio 11 2012" }, { "12.0", "Visual Studio 12 2013" }, { "14.0", "Visual Studio 14 2015" }, - { "15.0", "Visual Studio 15" }, - { 0, 0 } + { "15.0", "Visual Studio 15" } }; - for (int i = 0; vsGenerators[i].MSVersion != 0; i++) { + for (VSVersionedGenerator const* g = cmArrayBegin(vsGenerators); + g != cmArrayEnd(vsGenerators); ++g) { for (size_t b = 0; b < vsVerions.size(); b++) { - std::string reg = vsregBase + vsVerions[b] + vsGenerators[i].MSVersion; + std::string reg = vsregBase + vsVerions[b] + g->MSVersion; reg += ";InstallDir"; std::string dir; if (cmSystemTools::ReadRegistryValue(reg, dir, cmSystemTools::KeyWOW64_32) && cmSystemTools::PathExists(dir)) { - found = vsGenerators[i].GeneratorName; + found = g->GeneratorName; break; } } |