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.
This commit is contained in:
Brad King 2013-06-28 19:38:02 -04:00
parent 4e5cb398ae
commit 9a76d83f6d
1 changed files with 8 additions and 3 deletions

View File

@ -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}