CMAKE_SYSTEM_VERSION.rst 1.1 KB

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