MantisBT - CMake
View Issue Details
0011866CMakeCMakepublic2011-02-15 18:232013-01-09 10:57
d3x0r 
Brad King 
normalminoralways
closedfixed 
WindowsWindows7
CMake 2.8.3 
CMake 2.8.10CMake 2.8.10 
0011866: InstallRequiredSystemLibraries Watcom Support Patch
Attached diff from git vs today's head 6720f97d3b07f89af283024d29fad2194edd06f7 (I think)


use Include(installRequiredSystemLibraries) and use target generator "watcom wmake"
No tags attached.
patch watcom-cmake.patch (3,649) 2011-02-15 18:23
https://public.kitware.com/Bug/file/3705/watcom-cmake.patch
Issue History
2011-02-15 18:23d3x0rNew Issue
2011-02-15 18:23d3x0rFile Added: watcom-cmake.patch
2011-05-18 20:09d3x0rNote Added: 0026547
2011-07-29 08:51David ColeAssigned To => David Cole
2011-07-29 08:51David ColeStatusnew => assigned
2011-07-29 11:39David ColeTarget Version => CMake 2.8.6
2011-07-29 15:01David ColeNote Added: 0027122
2011-07-29 15:01David ColeStatusassigned => resolved
2011-07-29 15:01David ColeFixed in Version => CMake 2.8.6
2011-07-29 15:01David ColeResolutionopen => fixed
2012-01-02 15:56David ColeNote Added: 0028114
2012-01-02 15:56David ColeStatusresolved => closed
2012-07-03 12:34d3x0rNote Added: 0029897
2012-07-03 12:34d3x0rStatusclosed => feedback
2012-07-03 12:34d3x0rResolutionfixed => reopened
2012-08-09 20:59d3x0rNote Edited: 0029897bug_revision_view_page.php?bugnote_id=29897#r761
2012-08-09 20:59d3x0rNote Edited: 0029897bug_revision_view_page.php?bugnote_id=29897#r762
2012-08-10 08:21Brad KingNote Added: 0030204
2012-08-10 14:08d3x0rNote Added: 0030208
2012-08-10 14:08d3x0rStatusfeedback => assigned
2012-08-10 14:21Brad KingNote Added: 0030209
2012-08-10 16:04d3x0rNote Added: 0030212
2012-08-10 16:48David ColeFixed in VersionCMake 2.8.6 =>
2012-08-10 16:48David ColeTarget VersionCMake 2.8.6 => CMake 2.8.10
2012-08-13 08:22Brad KingNote Added: 0030465
2012-08-13 08:22Brad KingStatusassigned => resolved
2012-08-13 08:22Brad KingResolutionreopened => fixed
2012-08-13 08:22Brad KingFixed in Version => CMake 2.8.10
2012-08-13 10:53David ColeAssigned ToDavid Cole => Brad King
2013-01-09 10:57Robert MaynardNote Added: 0032053
2013-01-09 10:57Robert MaynardStatusresolved => closed

Notes
(0026547)
d3x0r   
2011-05-18 20:09   
This patch should still work. Just copied said changes into the 2.4.8 distribution files and libraries work just dandy.
(0027122)
David Cole   
2011-07-29 15:01   
Fix pushed to CMake 'next' with this commit:

  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=80769cdd1e568c1dbc66651557d98bba0f70ea00 [^]
(0028114)
David Cole   
2012-01-02 15:56   
Closing resolved issues that have not been updated in more than 4 months.
(0029897)
d3x0r   
2012-07-03 12:34   
(edited on: 2012-08-09 20:59)
The EXECUTE_PROCESS for watcom version check has extra quotes now. so the file looks like "\"CMakeTestWatcomVersion.c\"" sort-of.

in windows-wcl386.cmake line 97 needs the quotes removed

96: EXECUTE_PROCESS(COMMAND ${CMAKE_TEST_COMPILER}
97: -q -pc \"${testWatcomVersionFile}\"
98: OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
99: RESULT_VARIABLE CMAKE_COMPILER_RETURN
100: )

should be.... (after removing the \" quotes)

96: EXECUTE_PROCESS(COMMAND ${CMAKE_TEST_COMPILER}
97: -q -pc ${testWatcomVersionFile}
98: OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
99: RESULT_VARIABLE CMAKE_COMPILER_RETURN
100: )

(0030204)
Brad King   
2012-08-10 08:21   
Since these commits:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=c198730b [^]
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=fa7141f5 [^]

the CMAKE_(C|CXX)_COMPILER_VERSION variables should have the version number in them. Can this be used instead of a dedicated execute_process?
(0030208)
d3x0r   
2012-08-10 14:08   
In that case different mods need to be made.

share/cmake-2.8/modules/platform/Windows-wcl386.cmake

The last IF block is IF( NOT CMAKE_WATCOM_COMPILER_TESTS_RUN ) and needs to be replaced with the following IF block. (Removes the execute process and other setup code, and uses the version variable instead)

IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN)
  SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 1)
    SET(WATCOM16)
    SET(WATCOM17)
    SET(WATCOM18)
    SET(WATCOM19)
    IF("${CMAKE_C_COMPILER_VERSION}" LESS 12.70)
      SET(WATCOM16 1)
    ENDIF()
    IF("${CMAKE_C_COMPILER_VERSION}" EQUAL 12.70)
      SET(WATCOM17 1)
    ENDIF()
    IF("${CMAKE_C_COMPILER_VERSION}" EQUAL 12.80)
      SET(WATCOM18 1)
    ENDIF()
    IF("${CMAKE_C_COMPILER_VERSION}" EQUAL 12.90)
      SET(WATCOM19 1)
    ENDIF()
ENDIF()

##############
This is what the above IF looked like before....

IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN)
  SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 1)
  SET(testWatcomVersionFile
    "${CMAKE_ROOT}/Modules/CMakeTestWatcomVersion.c")
  STRNG(REGEXREPLACE "/" "\\\\"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()


################


And a small mod to share/cmake-2.8/modules/CMakeDetermineCCompiler.cmake

Insert at line 139

  ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
    SET(CMAKE_COMPILER_IS_CYGWIN 1)
+ ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Watcom")
+ SET(CMAKE_COMPILER_IS_WATCOM 1)
  ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
(0030209)
Brad King   
2012-08-10 14:21   
There is no need for a CMAKE_COMPILER_IS_WATCOM variable. The other CMAKE_COMPILER_IS_* variables predate CMAKE_C_COMPILER_ID and only exist for compatibility.

How about this block?

IF(NOT CMAKE_WATCOM_COMPILER_TESTS_RUN)
  SET(CMAKE_WATCOM_COMPILER_TESTS_RUN 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()
(0030212)
d3x0r   
2012-08-10 16:04   
Tests OK.
(0030465)
Brad King   
2012-08-13 08:22   
Applied change from 0011866:0030209:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=af42ae4f [^]

Thanks for testing.
(0032053)
Robert Maynard   
2013-01-09 10:57   
Closing resolved issues that have not been updated in more than 4 months.