summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio14Generator.cxx
diff options
context:
space:
mode:
authorGilles Khouzam <gillesk@microsoft.com>2015-10-02 18:34:55 (GMT)
committerBrad King <brad.king@kitware.com>2015-10-02 20:18:44 (GMT)
commit458121116a05665ebc0cf6a066977c00b8e55e5c (patch)
tree41e6d34368b2783c6a7dc44148c27517fcf67b11 /Source/cmGlobalVisualStudio14Generator.cxx
parent3f077996f58ca905125fc2387614b24c68c6f09e (diff)
downloadCMake-458121116a05665ebc0cf6a066977c00b8e55e5c.zip
CMake-458121116a05665ebc0cf6a066977c00b8e55e5c.tar.gz
CMake-458121116a05665ebc0cf6a066977c00b8e55e5c.tar.bz2
VS: Select latest Windows 10 SDK if no specific version was requested
If CMAKE_SYSTEM_VERSION is just "10.0" then use the latest SDK available since no particular version was requested.
Diffstat (limited to 'Source/cmGlobalVisualStudio14Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio14Generator.cxx19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/cmGlobalVisualStudio14Generator.cxx b/Source/cmGlobalVisualStudio14Generator.cxx
index 74679d8..661dddd 100644
--- a/Source/cmGlobalVisualStudio14Generator.cxx
+++ b/Source/cmGlobalVisualStudio14Generator.cxx
@@ -202,14 +202,23 @@ std::string cmGlobalVisualStudio14Generator::GetWindows10SDKVersion()
// has a version less or equal to our version of the operating system
std::sort(sdks.begin(), sdks.end(), cmSystemTools::VersionCompareGreater);
- for (std::vector<std::string>::iterator i = sdks.begin();
- i != sdks.end(); ++i)
+ // Select a suitable SDK version.
+ if (this->SystemVersion == "10.0")
+ {
+ // Use the latest Windows 10 SDK since no build version was given.
+ return sdks.at(0);
+ }
+ else
{
// Find the SDK less or equal to our specified version
- if (!cmSystemTools::VersionCompareGreater(*i, this->SystemVersion))
+ for (std::vector<std::string>::iterator i = sdks.begin();
+ i != sdks.end(); ++i)
{
- // This is the most recent SDK that we can run safely
- return *i;
+ if (!cmSystemTools::VersionCompareGreater(*i, this->SystemVersion))
+ {
+ // This is the most recent SDK that we can run safely
+ return *i;
+ }
}
}
}