Skip to content

OW tools usage with CMake

Jiří Malák edited this page Dec 16, 2025 · 17 revisions

Below is history of WATCOM/Open Watcom support in CMake. All features are available with latest Open Watcom version only. Most of these features is working with older WATCOM/Open Watcom versions, but some of them cannot be used with older versions (by example macOS host).

CMake version Description
2.3 only Windows host is supported and native support for Windows (WIN32) target
3.18 add Linux host support, native support for Linux, cross-compile support for DOS, OS/2, Linux and Windows (WIN32) targets
3.22 add macOS host support
3.26 add cross-compile support for 16-bit Windows 3.x (16-bit native and 32-bit Extender applications) targets

For cross-compilation it is not necessary to create special CMake file, because CMake contains cross-compilation support for OW. CMake with OW can be used on Windows, Linux and macOS hosts. Below is command line setup for native and cross-compilation build with OW.

CMake suppose to use standard OW installation for host even if you will cross compile for different target. You need installed all target support for which you will cross-compile.

Target build CMake command line OW specific options
native Windows -G "Watcom WMake"
native Linux -G "Watcom WMake"
DOS 16-bit -G "Watcom WMake" -D CMAKE_SYSTEM_NAME=DOS -D CMAKE_SYSTEM_PROCESSOR=I86
DOS 32-bit -G "Watcom WMake" -D CMAKE_SYSTEM_NAME=DOS -D CMAKE_SYSTEM_PROCESSOR=x86
OS/2 16-bit -G "Watcom WMake" -D CMAKE_SYSTEM_NAME=OS2 -D CMAKE_SYSTEM_PROCESSOR=I86
OS/2 32-bit -G "Watcom WMake" -D CMAKE_SYSTEM_NAME=OS2 -D CMAKE_SYSTEM_PROCESSOR=x86
Windows 3.x
(16-bit)
-G "Watcom WMake" -D CMAKE_SYSTEM_NAME=Windows3x -D CMAKE_SYSTEM_PROCESSOR=I86
Windows 3.x
(32-bit)
-G "Watcom WMake" -D CMAKE_SYSTEM_NAME=Windows3x -D CMAKE_SYSTEM_PROCESSOR=x86
Windows
(WIN32)
-G "Watcom WMake" -D CMAKE_SYSTEM_NAME=Windows -D CMAKE_SYSTEM_PROCESSOR=x86
Linux 32-bit -G "Watcom WMake" -D CMAKE_SYSTEM_NAME=Linux -D CMAKE_SYSTEM_PROCESSOR=x86

Useful CMake options:

  • -S <source path> (where your project is located)
  • -B <build path> (where your project create build)

Clone this wiki locally