mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
VS: Extract instance version from VS Installer
This commit is contained in:
@@ -366,6 +366,12 @@ bool cmGlobalVisualStudioVersionedGenerator::GetVSInstance(
|
||||
return vsSetupAPIHelper.GetVSInstanceInfo(dir);
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudioVersionedGenerator::GetVSInstanceVersion(
|
||||
unsigned long long& vsInstanceVersion) const
|
||||
{
|
||||
return vsSetupAPIHelper.GetVSInstanceVersion(vsInstanceVersion);
|
||||
}
|
||||
|
||||
bool cmGlobalVisualStudioVersionedGenerator::IsDefaultToolset(
|
||||
const std::string& version) const
|
||||
{
|
||||
|
||||
@@ -29,6 +29,8 @@ public:
|
||||
|
||||
bool GetVSInstance(std::string& dir) const;
|
||||
|
||||
bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion) const;
|
||||
|
||||
bool IsDefaultToolset(const std::string& version) const override;
|
||||
std::string GetAuxiliaryToolset() const override;
|
||||
|
||||
|
||||
@@ -258,6 +258,20 @@ bool cmVSSetupAPIHelper::GetVSInstanceInfo(std::string& vsInstallLocation)
|
||||
return isInstalled;
|
||||
}
|
||||
|
||||
bool cmVSSetupAPIHelper::GetVSInstanceVersion(
|
||||
unsigned long long& vsInstanceVersion)
|
||||
{
|
||||
vsInstanceVersion = 0;
|
||||
bool isInstalled = this->EnumerateAndChooseVSInstance();
|
||||
|
||||
if (isInstalled) {
|
||||
vsInstanceVersion =
|
||||
static_cast<unsigned long long>(chosenInstanceInfo.ullVersion);
|
||||
}
|
||||
|
||||
return isInstalled;
|
||||
}
|
||||
|
||||
bool cmVSSetupAPIHelper::GetVCToolsetVersion(std::string& vsToolsetVersion)
|
||||
{
|
||||
vsToolsetVersion.clear();
|
||||
|
||||
@@ -106,6 +106,7 @@ public:
|
||||
|
||||
bool IsVSInstalled();
|
||||
bool GetVSInstanceInfo(std::string& vsInstallLocation);
|
||||
bool GetVSInstanceVersion(unsigned long long& vsInstanceVersion);
|
||||
bool GetVCToolsetVersion(std::string& vsToolsetVersion);
|
||||
bool IsWin10SDKInstalled();
|
||||
bool IsWin81SDKInstalled();
|
||||
|
||||
Reference in New Issue
Block a user