Commit b759f706 authored by Basil Fierz's avatar Basil Fierz Committed by Brad King
Browse files

cmVSSetupHelper: Expose default toolset version

We already detect the VS toolset version.  Expose it to clients.
parent d548994a
...@@ -199,6 +199,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo( ...@@ -199,6 +199,7 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(
if (!cmSystemTools::FileIsDirectory(vcToolsDir)) { if (!cmSystemTools::FileIsDirectory(vcToolsDir)) {
return false; return false;
} }
vsInstanceInfo.VCToolsetVersion = vcToolsVersion;
} }
// Reboot may have been required before the product package was registered // Reboot may have been required before the product package was registered
...@@ -254,6 +255,18 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation) ...@@ -254,6 +255,18 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation)
return isInstalled; 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 cmVSSetupAPIHelper::EnumerateAndChooseVSInstance()
{ {
bool isVSInstanceExists = false; bool isVSInstanceExists = false;
......
...@@ -107,6 +107,7 @@ struct VSInstanceInfo ...@@ -107,6 +107,7 @@ struct VSInstanceInfo
std::wstring InstanceId; std::wstring InstanceId;
std::wstring VSInstallLocation; std::wstring VSInstallLocation;
std::wstring Version; std::wstring Version;
std::string VCToolsetVersion;
ULONGLONG ullVersion = 0; ULONGLONG ullVersion = 0;
bool IsWin10SDKInstalled = false; bool IsWin10SDKInstalled = false;
bool IsWin81SDKInstalled = false; bool IsWin81SDKInstalled = false;
...@@ -126,6 +127,7 @@ public: ...@@ -126,6 +127,7 @@ public:
bool IsVS2017Installed(); bool IsVS2017Installed();
bool GetVSInstanceInfo(std::string& vsInstallLocation); bool GetVSInstanceInfo(std::string& vsInstallLocation);
bool GetVCToolsetVersion(std::string& vsToolsetVersion);
bool IsWin10SDKInstalled(); bool IsWin10SDKInstalled();
bool IsWin81SDKInstalled(); bool IsWin81SDKInstalled();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment