mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-02 20:29:49 -05:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user