CMAKE_SYSTEM_NAME¶
The name of the operating system for which CMake is to build.
See the CMAKE_SYSTEM_VERSION variable for the OS version.
Note that CMAKE_SYSTEM_NAME is not set to anything by default when running
in script mode, since it's not building anything.
System Name for Host Builds¶
CMAKE_SYSTEM_NAME is by default set to the same value as the
CMAKE_HOST_SYSTEM_NAME variable so that the build
targets the host system.
System Name for Cross Compiling¶
CMAKE_SYSTEM_NAME may be set explicitly when first configuring a new build
tree in order to enable cross compiling.
In this case the CMAKE_SYSTEM_VERSION variable must also be
set explicitly.
System Names Known to CMake¶
The following is a list of possible values, each associated with corresponding operating systems or environments.
Apple Platforms¶
DarwinApple stationary operating systems (macOS, OS X, etc.)
iOSAdded in version 3.14.
Apple mobile phone operating system
tvOSAdded in version 3.14.
Apple TV operating system
visionOSAdded in version 3.28.
Apple mixed reality operating system
watchOSAdded in version 3.14.
Apple watch operating system
UNIX Platforms¶
ADSPAnalog Devices Audio Digital Signal Processing
AIXIBM Unix operating system
AndroidAdded in version 3.1.
Android operating system
ARTOSAdded in version 3.4.
Operating system for microcontrollers
BeOSOperating system for personal computers (discontinued)
BlueGeneLBlue Gene/L static environment
BlueGeneP-dynamicBlue Gene/P dynamic environment
BlueGeneP-staticBlue Gene/P static environment
BlueGeneQ-dynamicAdded in version 3.3.
Blue Gene/Q dynamic environment
BlueGeneQ-staticAdded in version 3.3.
Blue Gene/Q static environment
BSDOSBSD operating system (discontinued)
CatamountOperating system for Cray XT series
CrayLinuxEnvironmentAdded in version 3.5.
Cray Linux Environment
DragonFlyBSD-derived operating system
eCosReal-time embedded operating system
EmscriptenAdded in version 4.2.
Compiler toolchain to WebAssembly.
EurosAdded in version 3.4.
Real-time operating system for embedded devices
FreeBSDFreeBSD operating system
FuchsiaAdded in version 3.8.
Operating system by Google based on the Zircon kernel
Generic-ADSPGeneric ADSP (Audio DSP) environment
Generic-ELFAdded in version 3.23.
Generic ELF (Executable and Linkable Format) environment
GenericSome platforms, e.g. bare metal embedded devices
GHS-MULTIAdded in version 3.3.
Green Hills Software MULTI environment
GNUGNU/Hurd-based operating system
HaikuUnix operating system inspired by BeOS
HP-UXHewlett Packard Unix (discontinued)
LinuxAll Linux-based distributions
MirBSDMirOS BSD operating system
MP-RASMP-RAS UNIX operating system
NetBSDNetBSD operating systems
OHOSAdded in version 3.30.
OpenHarmony family of operating systems (e.g., HarmonyOS)
Toolchain file can set this value when targeting OpenHarmony operating systems.
OpenBSDOpenBSD operating systems
OpenVMSOpenVMS operating system by HP
OS2Added in version 3.18.
OS/2 operating system
OSF1Compaq Tru64 UNIX (formerly DEC OSF/1, Digital Unix) (discontinued)
QNXUnix-like operating system by BlackBerry
RISCosRISC OS operating system
SCO_SVSCO OpenServer 5
SerenityOSAdded in version 3.25.
Unix-like operating system
SINIXSINIX operating system
SunOSOracle Solaris and all illumos operating systems
syllableSyllable operating system
Tru64Compaq Tru64 UNIX (formerly DEC OSF/1) operating system
ULTRIXUnix operating system (discontinued)
UNIX_SVSCO UnixWare (pre release 7)
UnixWareSCO UnixWare 7
WASIAdded in version 3.31.
WebAssembly System Interface
XenixSCO Xenix Unix operating system (discontinued)
Windows Platforms¶
CYGWINCygwin environment for Windows
Cygwin's
cmakepackage (/usr/bin/cmake) uses system nameCYGWIN. A non-cygwin CMake on Windows (e.g.$PROGRAMFILES/CMake/bin/cmake) uses system nameWindowseven when it runs under a Cygwin environment.DOSMS-DOS or compatible
MidipixAdded in version 3.10.
POSIX-compatible layer for Windows
MSYSMSYS environment (MSYSTEM=MSYS)
MSYS2's
msys/cmakepackage (/usr/bin/cmake) works only underMSYSTEM=MSYSenvironments, with system nameMSYS. Under other environments likeMSYSTEM=MINGW64, use another package such asmingw64/mingw-w64-x86_64-cmake(/mingw64/bin/cmake), which targetsMSYSTEM=MINGW64with system nameWindows.WindowsWindows stationary operating systems
WindowsCEWindows Embedded Compact
WindowsKernelModeDriverAdded in version 4.1.
Windows Kernel-Mode Driver
When building drivers for Kernel-Mode Driver Framework on Windows, toolchain file can set this value. See also the
CMAKE_WINDOWS_KMDF_VERSIONvariable.WindowsPhoneAdded in version 3.1.
Windows mobile phone operating system
WindowsStoreAdded in version 3.1.
Universal Windows Platform applications
Removed Platforms¶
The following platforms were once supported by CMake and got removed either due to platform's EOL, or other incompatibilities:
kFreeBSDChanged in version 4.1: Removed from CMake.
FreeBSD kernel with a GNU userland