diff options
author | Basil Fierz <basil.fierz@hotmail.com> | 2018-06-20 20:34:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-06-22 14:07:09 (GMT) |
commit | b759f7068f4e263917ab029f9e9a518dfd386ddb (patch) | |
tree | 93b55090a09b54786a8c03eb8adfd527d1c0d583 /Source/cmVSSetupHelper.cxx | |
parent | d548994afcfccbff17fcba5698ed10f083142059 (diff) | |
download | CMake-b759f7068f4e263917ab029f9e9a518dfd386ddb.zip CMake-b759f7068f4e263917ab029f9e9a518dfd386ddb.tar.gz CMake-b759f7068f4e263917ab029f9e9a518dfd386ddb.tar.bz2 |
cmVSSetupHelper: Expose default toolset version
We already detect the VS toolset version. Expose it to clients.
Diffstat (limited to 'Source/cmVSSetupHelper.cxx')
-rw-r--r-- | Source/cmVSSetupHelper.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx index 4ca847e..22fe007 100644 --- a/Source/cmVSSetupHelper.cxx +++ b/Source/cmVSSetupHelper.cxx @@ -199,6 +199,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo( if (!cmSystemTools::FileIsDirectory(vcToolsDir)) { return false; } + vsInstanceInfo.VCToolsetVersion = vcToolsVersion; } // Reboot may have been required before the product package was registered @@ -254,6 +255,18 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation) return isInstalled; } +bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion) +{ + vsToolsetVersion.clear(); + bool isInstalled = this->EnumerateAndChooseVSInstance(); + + if (isInstalled) { + vsToolsetVersion = chosenInstanceInfo.VCToolsetVersion; + } + + return isInstalled && !vsToolsetVersion.empty(); +} + bool cmVSSetupAPIHelper::EnumerateAndChooseVSInstance() { bool isVSInstanceExists = false; |