diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-05-02 15:25:25 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-05-02 15:25:25 (GMT) |
commit | 36cf25e6a27520b168949090bd17f70b8021f48a (patch) | |
tree | 9030ddf02cf33a10aead13cbaa7109ff2d0d78db /Modules/CTest.cmake | |
parent | ab0c2757d5b0a74f98047921fc8384e2a78dbabe (diff) | |
download | CMake-36cf25e6a27520b168949090bd17f70b8021f48a.zip CMake-36cf25e6a27520b168949090bd17f70b8021f48a.tar.gz CMake-36cf25e6a27520b168949090bd17f70b8021f48a.tar.bz2 |
ENH: recognize vs 9 and possible 10 or greater when they come out...
Diffstat (limited to 'Modules/CTest.cmake')
-rw-r--r-- | Modules/CTest.cmake | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index 28d9b58..10d6ff5 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -11,6 +11,18 @@ OPTION(BUILD_TESTING "Build the testing tree." ON) +# function to turn generator name into a version string +# like vs7 vs71 vs8 vs9 +FUNCTION(GET_VS_VERSION_STRING generator var) + STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1" NUMBER "${generator}") + IF("${generator}" MATCHES "Visual Studio 7 .NET 2003") + SET(ver_string "vs71") + ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003") + SET(ver_string "vs${NUMBER}") + ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003") + SET(${var} ${ver_string} PARENT_SCOPE) +ENDFUNCTION(GET_VS_VERSION_STRING) + IF(BUILD_TESTING) # Setup some auxilary macros MACRO(SET_IF_NOT_SET var val) @@ -171,15 +183,7 @@ IF(BUILD_TESTING) SET(DART_CXX_NAME "vs60") ENDIF(DART_CXX_NAME MATCHES "msdev") IF(DART_CXX_NAME MATCHES "devenv") - IF(CMAKE_GENERATOR MATCHES "^Visual Studio 7$") - SET(DART_CXX_NAME "vs70") - ELSE(CMAKE_GENERATOR MATCHES "^Visual Studio 7$") - IF(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$") - SET(DART_CXX_NAME "vs71") - ELSE(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$") - SET(DART_CXX_NAME "vs8") - ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 7 .NET 2003$") - ENDIF(CMAKE_GENERATOR MATCHES "^Visual Studio 7$") + GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME) ENDIF(DART_CXX_NAME MATCHES "devenv") SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}") ENDIF(NOT BUILDNAME) |