Skip to content

OW tools usage with CMake

Jiří Malák edited this page Jan 10, 2024 · 11 revisions

From CMake version 3.18 native build for Windows and Linux host system and cross-compilation for other target systems are included.

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

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 only on Windows and Linux hosts (OW doesn't support OSX). 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