CMAKE_SYSTEM_NAME.rst 818 B

1234567891011121314151617181920212223
  1. CMAKE_SYSTEM_NAME
  2. -----------------
  3. The name of the operating system for which CMake is to build.
  4. See the :variable:`CMAKE_SYSTEM_VERSION` variable for the OS version.
  5. Note that ``CMAKE_SYSTEM_NAME`` is not set to anything by default when running
  6. in script mode, since it's not building anything.
  7. System Name for Host Builds
  8. ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  9. ``CMAKE_SYSTEM_NAME`` is by default set to the same value as the
  10. :variable:`CMAKE_HOST_SYSTEM_NAME` variable so that the build
  11. targets the host system.
  12. System Name for Cross Compiling
  13. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  14. ``CMAKE_SYSTEM_NAME`` may be set explicitly when first configuring a new build
  15. tree in order to enable :ref:`cross compiling <Cross Compiling Toolchain>`.
  16. In this case the :variable:`CMAKE_SYSTEM_VERSION` variable must also be
  17. set explicitly.