summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.cxx6
-rw-r--r--Source/cmGlobalVisualStudioVersionedGenerator.h2
-rw-r--r--Source/cmVSSetupHelper.cxx14
-rw-r--r--Source/cmVSSetupHelper.h1
4 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.cxx b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
index 13ae32a554..d44433b339 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.cxx
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.cxx
@@ -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
{
diff --git a/Source/cmGlobalVisualStudioVersionedGenerator.h b/Source/cmGlobalVisualStudioVersionedGenerator.h
index abb609536e..bcf8546131 100644
--- a/Source/cmGlobalVisualStudioVersionedGenerator.h
+++ b/Source/cmGlobalVisualStudioVersionedGenerator.h
@@ -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;
diff --git a/Source/cmVSSetupHelper.cxx b/Source/cmVSSetupHelper.cxx
index dd9f058b89..9626599a30 100644
--- a/Source/cmVSSetupHelper.cxx
+++ b/Source/cmVSSetupHelper.cxx
@@ -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();
diff --git a/Source/cmVSSetupHelper.h b/Source/cmVSSetupHelper.h
index a2fd3d5548..a926eee924 100644
--- a/Source/cmVSSetupHelper.h
+++ b/Source/cmVSSetupHelper.h
@@ -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();