diff options
author | Brad King <brad.king@kitware.com> | 2016-09-07 13:48:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2016-09-07 13:48:21 (GMT) |
commit | 6137054744e262cf8b1ddebfa4a08e00a0feffed (patch) | |
tree | 6e770ca6f3c2a62f1db4465791f92dd67410cc26 /Source | |
parent | 48b33b0633f61d453146e2ce4813b9731c6f0836 (diff) | |
parent | 042aca557defd72d7205becb7e54c9f93793b496 (diff) | |
download | CMake-6137054744e262cf8b1ddebfa4a08e00a0feffed.zip CMake-6137054744e262cf8b1ddebfa4a08e00a0feffed.tar.gz CMake-6137054744e262cf8b1ddebfa4a08e00a0feffed.tar.bz2 |
Merge topic 'vs-minor-cleanups'
042aca55 VS: Verify that MSBuild.exe and devenv.com exist before using them
a756c74d Help: Clarify meaning of MSVC<NN> variables
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmGlobalVisualStudio10Generator.cxx | 14 | ||||
-rw-r--r-- | Source/cmGlobalVisualStudio7Generator.cxx | 13 |
2 files changed, 20 insertions, 7 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; } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 08be304..8d3964f 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -150,13 +150,20 @@ std::string const& cmGlobalVisualStudio7Generator::GetDevEnvCommand() std::string cmGlobalVisualStudio7Generator::FindDevEnvCommand() { std::string vscmd; - std::string vskey = this->GetRegistryBase() + ";InstallDir"; + std::string vskey; + + // Search in standard location. + vskey = this->GetRegistryBase() + ";InstallDir"; if (cmSystemTools::ReadRegistryValue(vskey.c_str(), vscmd, cmSystemTools::KeyWOW64_32)) { cmSystemTools::ConvertToUnixSlashes(vscmd); - vscmd += "/"; + vscmd += "/devenv.com"; + if (cmSystemTools::FileExists(vscmd, true)) { + return vscmd; + } } - vscmd += "devenv.com"; + + vscmd = "devenv.com"; return vscmd; } |