summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio15Generator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmGlobalVisualStudio15Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio15Generator.cxx48
1 files changed, 36 insertions, 12 deletions
diff --git a/Source/cmGlobalVisualStudio15Generator.cxx b/Source/cmGlobalVisualStudio15Generator.cxx
index 4299081..d11ee7c 100644
--- a/Source/cmGlobalVisualStudio15Generator.cxx
+++ b/Source/cmGlobalVisualStudio15Generator.cxx
@@ -8,6 +8,7 @@
#include "cmMakefile.h"
#include "cmVS141CLFlagTable.h"
#include "cmVS141CSharpFlagTable.h"
+#include "cmVSSetupHelper.h"
static const char vs15generatorName[] = "Visual Studio 15 2017";
@@ -126,21 +127,44 @@ bool cmGlobalVisualStudio15Generator::SelectWindowsStoreToolset(
bool cmGlobalVisualStudio15Generator::IsWindowsDesktopToolsetInstalled() const
{
- const char desktop10Key[] = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
- "VisualStudio\\15.0\\VC\\Runtimes";
-
- std::vector<std::string> vc15;
- return cmSystemTools::GetRegistrySubKeys(desktop10Key, vc15,
- cmSystemTools::KeyWOW64_32);
+ return vsSetupAPIHelper.IsVS2017Installed();
}
bool cmGlobalVisualStudio15Generator::IsWindowsStoreToolsetInstalled() const
{
- const char universal10Key[] =
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\"
- "VisualStudio\\15.0\\Setup\\Build Tools for Windows 10;SrcPath";
+ return vsSetupAPIHelper.IsWin10SDKInstalled();
+}
+
+std::string cmGlobalVisualStudio15Generator::FindMSBuildCommand()
+{
+ std::string msbuild;
+
+ // Ask Visual Studio Installer tool.
+ std::string vs;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
+ msbuild = vs + "/MSBuild/15.0/Bin/MSBuild.exe";
+ if (cmSystemTools::FileExists(msbuild)) {
+ return msbuild;
+ }
+ }
+
+ msbuild = "MSBuild.exe";
+ return msbuild;
+}
+
+std::string cmGlobalVisualStudio15Generator::FindDevEnvCommand()
+{
+ std::string devenv;
+
+ // Ask Visual Studio Installer tool.
+ std::string vs;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(vs)) {
+ devenv = vs + "/Common7/IDE/devenv.com";
+ if (cmSystemTools::FileExists(devenv)) {
+ return devenv;
+ }
+ }
- std::string win10SDK;
- return cmSystemTools::ReadRegistryValue(universal10Key, win10SDK,
- cmSystemTools::KeyWOW64_32);
+ devenv = "devenv.com";
+ return devenv;
}