summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeCCompilerId.c.in17
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in17
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake4
-rw-r--r--Modules/Platform/Windows-wcl386.cmake24
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx2
5 files changed, 40 insertions, 24 deletions
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 561ccf2..16e19cd 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -68,10 +68,19 @@
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
- /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
+# if __WATCOMC__ < 1200
+# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRP */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# else
+# define COMPILER_ID "OpenWatcom"
+ /* __WATCOMC__ = VVRP + 1100 */
+# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
+# endif
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
#elif defined(__SUNPRO_C)
# define COMPILER_ID "SunPro"
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 6c602d4..d81df77 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -73,10 +73,19 @@
# define COMPILER_VERSION_MINOR HEX(__BORLANDC__ & 0xFF)
#elif defined(__WATCOMC__)
-# define COMPILER_ID "Watcom"
- /* __WATCOMC__ = VVRR */
-# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
-# define COMPILER_VERSION_MINOR DEC(__WATCOMC__ % 100)
+# if __WATCOMC__ < 1200
+# define COMPILER_ID "Watcom"
+ /* __WATCOMC__ = VVRP */
+# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
+# else
+# define COMPILER_ID "OpenWatcom"
+ /* __WATCOMC__ = VVRP + 1100 */
+# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
+# endif
+# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
+# if (__WATCOMC__ % 10) > 0
+# define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
+# endif
#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 7e68e8f..4b551e6 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -374,10 +374,6 @@ if(WATCOM)
string(REGEX MATCHALL "[0-9]+" _watcom_version_list "${_compiler_version}")
list(GET _watcom_version_list 0 _watcom_major)
list(GET _watcom_version_list 1 _watcom_minor)
- if(${_watcom_major} GREATER 11)
- math(EXPR _watcom_major "${_watcom_major} - 11")
- endif()
- math(EXPR _watcom_minor "${_watcom_minor} / 10")
set( __install__libs
${CompilerPath}/clbr${_watcom_major}${_watcom_minor}.dll
${CompilerPath}/mt7r${_watcom_major}${_watcom_minor}.dll
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index d40d718..6b1cfd1 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -93,16 +93,18 @@ if(NOT _CMAKE_WATCOM_VERSION)
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)
+ if("${_compiler_id}" STREQUAL "OpenWatcom")
+ if("${_compiler_version}" VERSION_LESS 1.7)
+ set(WATCOM16 1)
+ endif()
+ if("${_compiler_version}" VERSION_EQUAL 1.7)
+ set(WATCOM17 1)
+ endif()
+ if("${_compiler_version}" VERSION_EQUAL 1.8)
+ set(WATCOM18 1)
+ endif()
+ if("${_compiler_version}" VERSION_EQUAL 1.9)
+ set(WATCOM19 1)
+ endif()
endif()
endif()
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index dba2406..e99bf04 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -715,7 +715,7 @@ std::string cmExtraCodeBlocksGenerator::GetCBCompilerId(const cmMakefile* mf)
{
compiler = "icc";
}
- else if (compilerId == "Watcom")
+ else if (compilerId == "Watcom" || compilerId == "OpenWatcom")
{
compiler = "ow";
}