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.
Value |
Name |
---|---|
|
Analog Devices Audio Digital Signal Processing |
|
IBM Unix operating system |
|
Android operating system |
|
Operating system for microcontrollers |
|
Operating system for personal computers (discontinued) |
|
Blue Gene/L static environment |
|
Blue Gene/P dynamic environment |
|
Blue Gene/P static environment |
|
Blue Gene/Q dynamic environment |
|
Blue Gene/Q static environment |
|
BSD operating system (discontinued) |
|
Operating system for Cray XT series |
|
Cray Linux Environment |
|
Cygwin environment for Windows |
|
Apple stationary operating systems (macOS, OS X, etc.) |
|
MS-DOS or compatible |
|
BSD-derived operating system |
|
Real-time embedded operating system |
|
Compiler toolchain to WebAssembly |
|
Real-time operating system for embedded devices |
|
FreeBSD operating system |
|
Operating system by Google based on the Zircon kernel |
|
Generic ADSP (Audio DSP) environment |
|
Generic ELF (Executable and Linkable Format) environment |
|
Some platforms, e.g. bare metal embedded devices |
|
Green Hills Software MULTI environment |
|
GNU/Hurd-based operating system |
|
Unix operating system inspired by BeOS |
|
Hewlett Packard Unix |
|
Apple mobile phone operating system |
|
FreeBSD kernel with a GNU userland |
|
All Linux-based distributions |
|
POSIX-compatible layer for Windows |
|
MirOS BSD operating system |
|
MP-RAS UNIX operating system |
|
MSYS environment (MSYSTEM=MSYS) |
|
NetBSD operating systems |
|
OpenBSD operating systems |
|
OpenVMS operating system by HP |
|
OS/2 operating system |
|
Compaq Tru64 UNIX (formerly DEC OSF/1, Digital Unix) (discontinued) |
|
Unix-like operating system by BlackBerry |
|
RISC OS operating system |
|
SCO OpenServer 5 |
|
Unix-like operating system |
|
SINIX operating system |
|
Oracle Solaris and all illumos operating systems |
|
Syllable operating system |
|
Compaq Tru64 UNIX (formerly DEC OSF/1) operating system |
|
Apple TV operating system |
|
Unix operating system (discontinued) |
|
SCO UnixWare (pre release 7) |
|
SCO UnixWare 7 |
|
Apple mixed reality operating system |
|
Apple watch operating system |
|
Windows stationary operating systems |
|
Windows Embedded Compact |
|
Windows mobile phone operating system |
|
Universal Windows Platform applications |
|
SCO Xenix Unix operating system (discontinued) |
Platform-specific notes:
MSYS2's
msys/cmake
package (/usr/bin/cmake
) works only underMSYSTEM=MSYS
environments, with system nameMSYS
. Under other environments likeMSYSTEM=MINGW64
, use another package such asmingw64/mingw-w64-x86_64-cmake
(/mingw64/bin/cmake
), which targetsMSYSTEM=MINGW64
with system nameWindows
.Cygwin's
cmake
package (/usr/bin/cmake
) uses system nameCYGWIN
. A non-cygwin CMake on Windows (e.g.$PROGRAMFILES/CMake/bin/cmake
) uses system nameWindows
even when it runs under a Cygwin environment.