diff options
Diffstat (limited to 'Source/cmGlobalVisualStudio10Generator.cxx')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 14 |
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; } |