cmVSSetupHelper: Expose default toolset version

We already detect the VS toolset version.  Expose it to clients.
This commit is contained in:
Basil Fierz
2018-06-20 22:34:54 +02:00
committed by Brad King
parent d548994afc
commit b759f7068f
2 changed files with 15 additions and 0 deletions

View File

@@ -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;

View File

@@ -107,6 +107,7 @@ struct VSInstanceInfo
std::wstring InstanceId;
std::wstring VSInstallLocation;
std::wstring Version;
std::string VCToolsetVersion;
ULONGLONG ullVersion = 0;
bool IsWin10SDKInstalled = false;
bool IsWin81SDKInstalled = false;
@@ -126,6 +127,7 @@ public:
bool IsVS2017Installed();
bool GetVSInstanceInfo(std::string& vsInstallLocation);
bool GetVCToolsetVersion(std::string& vsToolsetVersion);
bool IsWin10SDKInstalled();
bool IsWin81SDKInstalled();