diff options
author | Brad King <brad.king@kitware.com> | 2019-01-09 13:12:52 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-01-09 13:13:02 (GMT) |
commit | 90b08fc27bae5c08e1f91a130eabc27cb092c6f5 (patch) | |
tree | 7593c43f384b267e13c905f1cb031e843d1f309f /Source | |
parent | 98103e38d0f6b64ded0503462abfc7b09dc8bea7 (diff) | |
parent | d44f81c2173d56cba662bc414f7cd2dc030b74fe (diff) | |
download | CMake-90b08fc27bae5c08e1f91a130eabc27cb092c6f5.zip CMake-90b08fc27bae5c08e1f91a130eabc27cb092c6f5.tar.gz CMake-90b08fc27bae5c08e1f91a130eabc27cb092c6f5.tar.bz2 |
Merge topic 'vs2017-skip-2019'
d44f81c217 VS: Exclude VS 2019 instances when using VS 2017 generator
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !2775
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVSSetupHelper.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 7a54e12..d80b5a2 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -328,6 +328,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; @@ -343,6 +346,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(); |