1CMAKE_SYSTEM_VERSION 2-------------------- 3 4The version of the operating system for which CMake is to build. 5See the :variable:`CMAKE_SYSTEM_NAME` variable for the OS name. 6 7System Version for Host Builds 8^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 9 10When the :variable:`CMAKE_SYSTEM_NAME` variable takes its default value 11then ``CMAKE_SYSTEM_VERSION`` is by default set to the same value as the 12:variable:`CMAKE_HOST_SYSTEM_VERSION` variable so that the build targets 13the host system version. 14 15In the case of a host build then ``CMAKE_SYSTEM_VERSION`` may be set 16explicitly when first configuring a new build tree in order to enable 17targeting the build for a different version of the host operating system 18than is actually running on the host. This is allowed and not considered 19cross compiling so long as the binaries built for the specified OS version 20can still run on the host. 21 22System Version for Cross Compiling 23^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 24 25When the :variable:`CMAKE_SYSTEM_NAME` variable is set explicitly to 26enable :ref:`cross compiling <Cross Compiling Toolchain>` then the 27value of ``CMAKE_SYSTEM_VERSION`` must also be set explicitly to specify 28the target system version. 29