summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalVisualStudio10Generator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-09-06 13:50:00 (GMT)
committerBrad King <brad.king@kitware.com>2016-09-06 14:22:39 (GMT)
commit042aca557defd72d7205becb7e54c9f93793b496 (patch)
treee4ea9abda3645f15eba01715c2d3eaaf3de471a8 /Source/cmGlobalVisualStudio10Generator.cxx
parenta756c74da58196f670633c1d08840dc6e3d62fea (diff)
downloadCMake-042aca557defd72d7205becb7e54c9f93793b496.zip
CMake-042aca557defd72d7205becb7e54c9f93793b496.tar.gz
CMake-042aca557defd72d7205becb7e54c9f93793b496.tar.bz2
VS: Verify that MSBuild.exe and devenv.com exist before using them
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r--Source/cmGlobalVisualStudio10Generator.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx
index 819feb1..ab87d67 100644
--- a/Source/cmGlobalVisualStudio10Generator.cxx
+++ b/Source/cmGlobalVisualStudio10Generator.cxx
@@ -350,16 +350,22 @@ std::string const& cmGlobalVisualStudio10Generator::GetMSBuildCommand()
std::string cmGlobalVisualStudio10Generator::FindMSBuildCommand()
{
std::string msbuild;
- std::string mskey =
- "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\";
+ std::string mskey;
+
+ // Search in standard location.
+ mskey = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\";
mskey += this->GetToolsVersion();
mskey += ";MSBuildToolsPath";
if (cmSystemTools::ReadRegistryValue(mskey.c_str(), msbuild,
cmSystemTools::KeyWOW64_32)) {
cmSystemTools::ConvertToUnixSlashes(msbuild);
- msbuild += "/";
+ msbuild += "/MSBuild.exe";
+ if (cmSystemTools::FileExists(msbuild, true)) {
+ return msbuild;
+ }
}
- msbuild += "MSBuild.exe";
+
+ msbuild = "MSBuild.exe";
return msbuild;
}