summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2012-08-13 17:42:00 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:18:28 (GMT)
commitbe9db98946b7918f279812fd0616abb650eebed0 (patch)
treef5bbde79899d73aa4faed2c2d2df0ac1913a5037 /Modules/Platform
parentf0295575d7fa4b554abc4d6b2af07b9f6cbde437 (diff)
parentaf42ae4f8190c5c0257703b04671f35e66dfaa05 (diff)
downloadCMake-be9db98946b7918f279812fd0616abb650eebed0.zip
CMake-be9db98946b7918f279812fd0616abb650eebed0.tar.gz
CMake-be9db98946b7918f279812fd0616abb650eebed0.tar.bz2
Merge topic 'watcom-compiler-version'
af42ae4 Watcom: Simplify compiler version detection (#11866)
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Windows-wcl386.cmake61
1 files changed, 24 insertions, 37 deletions
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 14b3b81..21c4a69 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -83,40 +83,27 @@ SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b '<TARGET_
# create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
-IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN)
- SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 1)
- SET(testWatcomVersionFile
- "${CMAKE_ROOT}/Modules/CMakeTestWatcomVersion.c")
- STRING(REGEX REPLACE "/" "\\\\" testWatcomVersionFile "${testWatcomVersionFile}")
- MESSAGE(STATUS "Check for Watcom compiler version")
- SET(CMAKE_TEST_COMPILER ${CMAKE_C_COMPILER})
- IF (NOT CMAKE_C_COMPILER)
- SET(CMAKE_TEST_COMPILER ${CMAKE_CXX_COMPILER})
- ENDIF()
- EXECUTE_PROCESS(COMMAND ${CMAKE_TEST_COMPILER}
- -q -pc \"${testWatcomVersionFile}\"
- OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
- RESULT_VARIABLE CMAKE_COMPILER_RETURN
- )
- STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}")
- STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1"
- compilerVersion "${compilerVersion}")
- IF("${CMAKE_COMPILER_RETURN}" STREQUAL "0")
- SET(WATCOM16)
- SET(WATCOM17)
- SET(WATCOM18)
- SET(WATCOM19)
- IF("${compilerVersion}" LESS 1270)
- SET(WATCOM16 1)
- ENDIF()
- IF("${compilerVersion}" EQUAL 1270)
- SET(WATCOM17 1)
- ENDIF()
- IF("${compilerVersion}" EQUAL 1280)
- SET(WATCOM18 1)
- ENDIF()
- IF("${compilerVersion}" EQUAL 1290)
- SET(WATCOM19 1)
- ENDIF()
- ENDIF()
-ENDIF()
+if(NOT _CMAKE_WATCOM_VERSION)
+ set(_CMAKE_WATCOM_VERSION 1)
+ if(CMAKE_C_COMPILER_VERSION)
+ set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+ else()
+ set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+ endif()
+ set(WATCOM16)
+ set(WATCOM17)
+ set(WATCOM18)
+ set(WATCOM19)
+ if("${_compiler_version}" LESS 12.70)
+ set(WATCOM16 1)
+ endif()
+ if("${_compiler_version}" EQUAL 12.70)
+ set(WATCOM17 1)
+ endif()
+ if("${_compiler_version}" EQUAL 12.80)
+ set(WATCOM18 1)
+ endif()
+ if("${_compiler_version}" EQUAL 12.90)
+ set(WATCOM19 1)
+ endif()
+endif()