diff options
author | David Cole <david.cole@kitware.com> | 2011-07-29 17:28:54 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-07-29 17:28:54 (GMT) |
commit | 80769cdd1e568c1dbc66651557d98bba0f70ea00 (patch) | |
tree | 6e0ecbdd871df1f01bd5eb9fe2eb4fe15d40dbb9 /Modules/Platform | |
parent | 5ef20b2dc54474ceba1c81a75e8c3fc558d505fa (diff) | |
download | CMake-80769cdd1e568c1dbc66651557d98bba0f70ea00.zip CMake-80769cdd1e568c1dbc66651557d98bba0f70ea00.tar.gz CMake-80769cdd1e568c1dbc66651557d98bba0f70ea00.tar.bz2 |
Add Watcom support to InstallRequiredSystemLibraries (#11866)
Also adds code to determine the version of the Watcom compiler
in use.
Thanks to J Decker for the patch.
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/Windows-wcl386.cmake | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index e96ebb5..c10fd78 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -81,3 +81,41 @@ SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -n -b '<TARGET_UNQ # 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 + RETURN_VALUE CMAKE_COMPILER_RETURN + ) + STRING(REGEX REPLACE "\n" " " compilerVersion "${CMAKE_COMPILER_OUTPUT}") + STRING(REGEX REPLACE ".*VERSION=(.*)" "\\1" + compilerVersion "${compilerVersion}") + IF(NOT CMAKE_COMPILER_RETURN) + 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() |