Hi,

I enclosed next patch for Open Watcom toolchain, which remove hardcoded version 
number for RTDLL.
It is derived from compiler version now that it will be working with OW version 
above 1.9.

Regards

Jiri

>From d00ad6f72f48575e36a06949cead524f35f56de4 Mon Sep 17 00:00:00 2001
From: Jiri Malak <[email protected]>
Date: Sat, 1 Mar 2014 03:32:28 +0100
Subject: [PATCH] Open Watcom remove hard coded version of C/C++ run-time DLL

Version number for RTDLL can be calculated from compiler version, now it will be working properly with any new version of OW
---
 Modules/InstallRequiredSystemLibraries.cmake | 16 ++++------------
 Modules/Platform/Windows-wcl386.cmake        | 27 +++++++++------------------
 2 files changed, 13 insertions(+), 30 deletions(-)

diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 013a028..90f09d9 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -366,18 +366,10 @@ endif()
 
 if(WATCOM)
   get_filename_component( CompilerPath ${CMAKE_C_COMPILER} PATH )
-  if(WATCOM17)
-     set( __install__libs ${CompilerPath}/clbr17.dll
-       ${CompilerPath}/mt7r17.dll ${CompilerPath}/plbr17.dll )
-  endif()
-  if(WATCOM18)
-     set( __install__libs ${CompilerPath}/clbr18.dll
-       ${CompilerPath}/mt7r18.dll ${CompilerPath}/plbr18.dll )
-  endif()
-  if(WATCOM19)
-     set( __install__libs ${CompilerPath}/clbr19.dll
-       ${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll )
-  endif()
+  set( __install__libs
+       ${CompilerPath}/clbr${WATCOM_RTDLL_VERSION}.dll
+       ${CompilerPath}/mt7r${WATCOM_RTDLL_VERSION}.dll 
+       ${CompilerPath}/plbr${WATCOM_RTDLL_VERSION}.dll )
   foreach(lib
       ${__install__libs}
       )
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index d40d718..067065d 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -40,13 +40,12 @@ set (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib  l
 set (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
 
 set(CMAKE_C_CREATE_IMPORT_LIBRARY
-  "wlib -c -q -n -b <TARGET_IMPLIB> +<TARGET_QUOTED>")
+    "wlib -c -q -n -b <TARGET_IMPLIB> +<TARGET_QUOTED>")
 set(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
 
 set(CMAKE_C_LINK_EXECUTABLE
     "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
 
-
 set(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
 
 # compile a C++ file into an object file
@@ -77,7 +76,7 @@ set(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
 set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_MODULE})
 
 # create a C++ static library
-set(CMAKE_CXX_CREATE_STATIC_LIBRARY  "wlib ${CMAKE_LIB_QUIET} -c -n -b <TARGET_QUOTED> <LINK_FLAGS> <OBJECTS> ")
+set(CMAKE_CXX_CREATE_STATIC_LIBRARY "wlib ${CMAKE_LIB_QUIET} -c -n -b <TARGET_QUOTED> <LINK_FLAGS> <OBJECTS>")
 
 # create a C static library
 set(CMAKE_C_CREATE_STATIC_LIBRARY ${CMAKE_CXX_CREATE_STATIC_LIBRARY})
@@ -89,20 +88,12 @@ if(NOT _CMAKE_WATCOM_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)
+  string(REGEX MATCHALL "[0-9]+" _ow_version_list "${_compiler_version}")
+  list(GET _ow_version_list 0 _major)
+  list(GET _ow_version_list 1 _minor)
+  if(_major GREATER 11)
+    math(EXPR _major ${_major} - 11)
   endif()
+  math(EXPR _minor ${_minor} / 10)
+  set(WATCOM_RTDLL_VERSION "${_major}${_minor}")
 endif()
-- 
1.8.0.msysgit.0

 
-- 

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to