summaryrefslogtreecommitdiffstats
path: root/Source/cmCMakeHostSystemInformationCommand.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-10-20 16:05:24 (GMT)
committerBrad King <brad.king@kitware.com>2021-10-20 17:00:25 (GMT)
commit44a86d0b3890848e2df702dc87d625a19216641e (patch)
tree522d19f52ac8bc3d6b900d9d98b96d3a92eff5b2 /Source/cmCMakeHostSystemInformationCommand.cxx
parent6999b871335c26d9d39b05023559254b1437bcf5 (diff)
downloadCMake-44a86d0b3890848e2df702dc87d625a19216641e.zip
CMake-44a86d0b3890848e2df702dc87d625a19216641e.tar.gz
CMake-44a86d0b3890848e2df702dc87d625a19216641e.tar.bz2
cmake_host_system_information: Add undocumented VS_MSBUILD_COMMAND key
When using the Visual Studio generator for VS 10 or above, offer this key to get the location of the MSBuild command before the first `project()` or `enable_language()` command has finished running. This will be needed only by one of our own modules, so leave it undocumented for now.
Diffstat (limited to 'Source/cmCMakeHostSystemInformationCommand.cxx')
-rw-r--r--Source/cmCMakeHostSystemInformationCommand.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/cmCMakeHostSystemInformationCommand.cxx b/Source/cmCMakeHostSystemInformationCommand.cxx
index 74071ff..3922c56 100644
--- a/Source/cmCMakeHostSystemInformationCommand.cxx
+++ b/Source/cmCMakeHostSystemInformationCommand.cxx
@@ -27,6 +27,7 @@
#ifdef _WIN32
# include "cmAlgorithms.h"
# include "cmGlobalGenerator.h"
+# include "cmGlobalVisualStudio10Generator.h"
# include "cmGlobalVisualStudioVersionedGenerator.h"
# include "cmVSSetupHelper.h"
# define HAVE_VS_SETUP_HELPER
@@ -434,6 +435,12 @@ cm::optional<std::string> GetValue(cmExecutionStatus& status,
}
}
+ if (key == "VS_MSBUILD_COMMAND"_s && gg->IsVisualStudioAtLeast10()) {
+ cmGlobalVisualStudio10Generator* vs10gen =
+ static_cast<cmGlobalVisualStudio10Generator*>(gg);
+ return vs10gen->FindMSBuildCommandEarly(&status.GetMakefile());
+ }
+
return {};
}
#endif