summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-01-08 14:11:03 -0500
committerBrad King <brad.king@kitware.com>2019-01-08 14:13:33 -0500
commit68bc9fcbb9a0d0a91d9c7b592c79b04d0f03fabc (patch)
treee17688823d066f672b92fdc464ef01eb072be89f
parent9bbfbd54ba04e07b0bf2eb8bb1056bca53d639c5 (diff)
parentd44f81c2173d56cba662bc414f7cd2dc030b74fe (diff)
downloadcmake-68bc9fcbb9a0d0a91d9c7b592c79b04d0f03fabc.tar.gz
Merge branch 'vs2017-skip-2019' into release-3.13
Merge-request: !2775
-rw-r--r--Source/cmVSSetupHelper.cxx9
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index 22fe007bae..19c96b3bb5 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -295,6 +295,9 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
return false;
}
+ // FIXME: Add a way for caller to specify other versions.
+ std::wstring wantVersion = std::to_wstring(15) + L'.';
+
SmartCOMPtr<ISetupInstance> instance;
while (SUCCEEDED(enumInstances->Next(1, &instance, NULL)) && instance) {
SmartCOMPtr<ISetupInstance2> instance2 = NULL;
@@ -310,6 +313,12 @@ bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
instance = instance2 = NULL;
if (isInstalled) {
+ // We are looking for a specific major version.
+ if (instanceInfo.Version.size() < wantVersion.size() ||
+ instanceInfo.Version.substr(0, wantVersion.size()) != wantVersion) {
+ continue;
+ }
+
if (!this->SpecifiedVSInstallLocation.empty()) {
// We are looking for a specific instance.
std::string currentVSLocation = instanceInfo.GetInstallLocation();