summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-27 15:21:22 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-27 15:43:01 (GMT)
commitcf784d9ff5555eda82d6790c359b6d6ea7f88345 (patch)
tree25362854e2dd875388d3a1b30d616bca434824c5 /Source
parent082c0375d9f21ada36bdd8fd710720e553bcdbbb (diff)
downloadCMake-cf784d9ff5555eda82d6790c359b6d6ea7f88345.zip
CMake-cf784d9ff5555eda82d6790c359b6d6ea7f88345.tar.gz
CMake-cf784d9ff5555eda82d6790c359b6d6ea7f88345.tar.bz2
Add undocumented CMake language means to find VS 2017
Add a query to the `cmake_host_system_information` command to get the location of a VS 2017 installation. Leave it undocumented and for internal use for now.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 7da93ac..e135ac6 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -7,6 +7,12 @@
#include "cmMakefile.h"
#include "cmsys/SystemInformation.hxx"
+#if defined(_WIN32)
+#include "cmSystemTools.h"
+#include "cmVSSetupHelper.h"
+#define HAVE_VS_SETUP_HELPER
+#endif
+
class cmExecutionStatus;
// cmCMakeHostSystemInformation
@@ -70,6 +76,13 @@ bool cmCMakeHostSystemInformationCommand::GetValue(
value = this->ValueToString(info.GetTotalPhysicalMemory());
} else if (key == "AVAILABLE_PHYSICAL_MEMORY") {
value = this->ValueToString(info.GetAvailablePhysicalMemory());
+#ifdef HAVE_VS_SETUP_HELPER
+ } else if (key == "VS_15_DIR") {
+ cmVSSetupAPIHelper vsSetupAPIHelper;
+ if (vsSetupAPIHelper.GetVSInstanceInfo(value)) {
+ cmSystemTools::ConvertToUnixSlashes(value);
+ }
+#endif
} else {
std::string e = "does not recognize <key> " + key;
this->SetError(e);