diff options
author | Brad King <brad.king@kitware.com> | 2013-06-28 23:38:02 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-06-28 23:38:44 (GMT) |
commit | 9a76d83f6d567516fcfd63ce778072ab4d5c766a (patch) | |
tree | b1dbb7b2207f50625232a70aaf764471e93c4b26 | |
parent | 4e5cb398ae392079031ae6a880569349c29770a6 (diff) | |
download | CMake-9a76d83f6d567516fcfd63ce778072ab4d5c766a.zip CMake-9a76d83f6d567516fcfd63ce778072ab4d5c766a.tar.gz CMake-9a76d83f6d567516fcfd63ce778072ab4d5c766a.tar.bz2 |
VS12: Find proper MSBuild for VSProjectInSubdir test
If the CTest make program is not msbuild we find the msbuild
corresponding to the current test generator. In the case of
VS 12 search for the msbuild it provides.
-rw-r--r-- | Tests/CMakeLists.txt | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index b660442..36cd7fd 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1541,9 +1541,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(CMAKE_TEST_MAKEPROGRAM MATCHES "[mM][sS][bB][uU][iI][lL][dD]\\.[eE][xX][eE]") set(MSBUILD_EXECUTABLE "${CMAKE_TEST_MAKEPROGRAM}") else() - set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]") - set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]") - find_program(MSBUILD_EXECUTABLE NAMES msbuild HINTS ${_FDIR}/${_FVER}) + if(CMAKE_TEST_GENERATOR MATCHES "Visual Studio (12)") + set(_msbuild_hints "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\${CMAKE_MATCH_1}.0;MSBuildToolsPath]") + else() + set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]") + set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]") + set(_msbuild_hints ${_FDIR}/${_FVER}) + endif() + find_program(MSBUILD_EXECUTABLE NAMES msbuild HINTS ${_msbuild_hints}) endif() if(MSBUILD_EXECUTABLE) add_test(NAME VSProjectInSubdir COMMAND ${CMAKE_CTEST_COMMAND} |