summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-07 20:46:41 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-07 20:46:41 (GMT)
commitbcfd6f7f690aed6d862d76a0e9617f73169a9897 (patch)
treed5fb7d180b5d6438a04280beb69593b362d8051d /Modules
parentccf1eed298cf4d17927da73066a453afab311a46 (diff)
downloadCMake-bcfd6f7f690aed6d862d76a0e9617f73169a9897.zip
CMake-bcfd6f7f690aed6d862d76a0e9617f73169a9897.tar.gz
CMake-bcfd6f7f690aed6d862d76a0e9617f73169a9897.tar.bz2
ENH: add better variables for MSVC versions
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-cl.cmake36
-rw-r--r--Modules/Platform/Windows-cl.cmake.in7
2 files changed, 32 insertions, 11 deletions
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index b401239..fceb68a 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -77,7 +77,9 @@ SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
# test results are saved in CMakeCPlatform.cmake, a file
# that is automatically copied into try_compile directories
# by the global generator.
+SET(MSVC_IDE 1)
IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
+ SET(MSVC_IDE 0)
IF(NOT CMAKE_VC_COMPILER_TESTS_RUN)
SET(CMAKE_VC_COMPILER_TESTS 1)
SET(testNmakeCLVersionFile
@@ -97,16 +99,28 @@ IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1"
compilerVersion "${compilerVersion}")
MESSAGE(STATUS "Check for CL compiler version - ${compilerVersion}")
- IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
- SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
- ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
+ SET(MSVC60)
+ SET(MSVC70)
+ SET(MSVC71)
+ SET(MSVC80)
+ SET(CMAKE_COMPILER_2005)
+ IF("${compilerVersion}" LESS 1300)
+ SET(MSVC60 1)
SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
- ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
- IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
+ ENDIF("${compilerVersion}" LESS 1300)
+ IF("${compilerVersion}" EQUAL 1300)
+ SET(MSVC70 1)
+ SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
+ ENDIF("${compilerVersion}" EQUAL 1300)
+ IF("${compilerVersion}" EQUAL 1310)
+ SET(MSVC71 1)
+ SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
+ ENDIF("${compilerVersion}" EQUAL 1310)
+ IF("${compilerVersion}" GREATER 1400)
+ SET(MSVC80 1)
SET(CMAKE_COMPILER_2005 1)
- ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
- SET(CMAKE_COMPILER_2005 0)
- ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[4-9][0-9][0-9].*" )
+ ENDIF("${compilerVersion}" GREATER 1400)
+ SET(MSVC_VERSION "${compilerVersion}")
ELSE(NOT CMAKE_COMPILER_RETURN)
MESSAGE(STATUS "Check for CL compiler version - failed")
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeFiles/CMakeError.log
@@ -173,7 +187,7 @@ ENDIF(CMAKE_FORCE_WIN64)
# default to Debug builds
-IF(CMAKE_COMPILER_2005)
+IF(MSVC80)
# for 2005 make sure the manifest is put in the dll with mt
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}"
"mt /manifest <TARGET>.manifest /outputresource:<TARGET>\;#2")
@@ -199,7 +213,7 @@ IF(CMAKE_COMPILER_2005)
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib " CACHE STRING
"Libraries linked by defalut with all applications.")
-ELSE(CMAKE_COMPILER_2005)
+ELSE(MSVC80)
IF(CMAKE_USING_VC_FREE_TOOLS)
MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available")
SET(CMAKE_BUILD_TYPE_INIT Release)
@@ -232,7 +246,7 @@ ELSE(CMAKE_COMPILER_2005)
SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING
"Libraries linked by defalut with all applications.")
ENDIF(CMAKE_USING_VC_FREE_TOOLS)
-ENDIF(CMAKE_COMPILER_2005)
+ENDIF(MSVC80)
MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES)
diff --git a/Modules/Platform/Windows-cl.cmake.in b/Modules/Platform/Windows-cl.cmake.in
index 2e01327..0ac9ed8 100644
--- a/Modules/Platform/Windows-cl.cmake.in
+++ b/Modules/Platform/Windows-cl.cmake.in
@@ -3,3 +3,10 @@ SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE @CMAKE_COMPILER_SUPPORTS_PDBTYPE@)
SET(CMAKE_COMPILER_2005 @CMAKE_COMPILER_2005@)
SET(CMAKE_USING_VC_FREE_TOOLS @CMAKE_USING_VC_FREE_TOOLS@)
SET(CMAKE_CL_64 @CMAKE_CL_64@)
+SET(MSVC60 @MSVC60@)
+SET(MSVC70 @MSVC70@)
+SET(MSVC71 @MSVC71@)
+SET(MSVC80 @MSVC80@)
+SET(MSVC_IDE @MSVC_IDE@)
+SET(MSVC_VERSION @MSVC_VERSION@)
+SET(WIN32 1)