> On 03/03/2014 03:43 PM, Jiri Malak wrote:
>> I enclosed new updated version of patch.
>> It contains change of InstallRequiredSystemLibraries only.
>
> Thanks.  The lines:
>
>     set(_watcom_major ${_watcom_major} - 11)
>   ...
>   set(_watcom_minor ${_watcom_minor} / 10)
>
> should use math(EXPR) to do numerical computation.
>
> -Brad
>
>
Brad,

Sorry, I fixed it now.

Regards

Jiri
>From d6c9f6c631a7e85969d682889b4cbda1e3a3bdf2 Mon Sep 17 00:00:00 2001
From: Jiri Malak <[email protected]>
Date: Tue, 4 Mar 2014 16:35:44 +0100
Subject: [PATCH] Remove hard coded version of RTDLL for Open Watcom

Version number for RTDLL can be calculated from compiler version.
Code will be working properly with any new version of OW without
need any code change.
---
 Modules/InstallRequiredSystemLibraries.cmake | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 013a028..b382090 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -366,18 +366,22 @@ 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 )
+  if(CMAKE_C_COMPILER_VERSION)
+    set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+  else()
+    set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
   endif()
-  if(WATCOM19)
-     set( __install__libs ${CompilerPath}/clbr19.dll
-       ${CompilerPath}/mt7r19.dll ${CompilerPath}/plbr19.dll )
+  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} > 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 
+    ${CompilerPath}/plbr${_watcom_major}${_watcom_minor}.dll )
   foreach(lib
       ${__install__libs}
       )
-- 
1.8.1.4
-- 

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