summaryrefslogtreecommitdiffstats
path: root/Help/manual/cmake-toolchains.7.rst
diff options
context:
space:
mode:
authorHinell <al.neodim@gmail.com>2022-09-06 14:26:54 (GMT)
committerBrad King <brad.king@kitware.com>2022-09-09 14:11:07 (GMT)
commit004568a9f399e89d01f5d16b5500c6fc010a6ea9 (patch)
treec12beb9caed7f918f38cda8ef80b5eaccb93cf0b /Help/manual/cmake-toolchains.7.rst
parentecfc63a9b0e73b2c9525a4ba65ceb22759ab00fd (diff)
downloadCMake-004568a9f399e89d01f5d16b5500c6fc010a6ea9.zip
CMake-004568a9f399e89d01f5d16b5500c6fc010a6ea9.tar.gz
CMake-004568a9f399e89d01f5d16b5500c6fc010a6ea9.tar.bz2
Help: Add links between cmake-{toolchains,presets}(7)
Also improve formatting and add `versionadded` markup.
Diffstat (limited to 'Help/manual/cmake-toolchains.7.rst')
-rw-r--r--Help/manual/cmake-toolchains.7.rst69
1 files changed, 38 insertions, 31 deletions
diff --git a/Help/manual/cmake-toolchains.7.rst b/Help/manual/cmake-toolchains.7.rst
index 7fa73e7..8a83807 100644
--- a/Help/manual/cmake-toolchains.7.rst
+++ b/Help/manual/cmake-toolchains.7.rst
@@ -17,6 +17,9 @@ determines the toolchain for host builds based on system introspection and
defaults. In cross-compiling scenarios, a toolchain file may be specified
with information about compiler and utility paths.
+.. versionadded:: 3.19
+ One may use :manual:`cmake-presets(7)` to specify toolchain files.
+
Languages
=========
@@ -58,20 +61,24 @@ Variables and Properties
========================
Several variables relate to the language components of a toolchain which are
-enabled. :variable:`CMAKE_<LANG>_COMPILER` is the full path to the compiler used
-for ``<LANG>``. :variable:`CMAKE_<LANG>_COMPILER_ID` is the identifier used
-by CMake for the compiler and :variable:`CMAKE_<LANG>_COMPILER_VERSION` is the
-version of the compiler.
-
-The :variable:`CMAKE_<LANG>_FLAGS` variables and the configuration-specific
-equivalents contain flags that will be added to the compile command when
-compiling a file of a particular language.
-
-As the linker is invoked by the compiler driver, CMake needs a way to determine
-which compiler to use to invoke the linker. This is calculated by the
-:prop_sf:`LANGUAGE` of source files in the target, and in the case of static
-libraries, the language of the dependent libraries. The choice CMake makes may
-be overridden with the :prop_tgt:`LINKER_LANGUAGE` target property.
+enabled:
+
+:variable:`CMAKE_<LANG>_COMPILER`
+ The full path to the compiler used for ``<LANG>``
+:variable:`CMAKE_<LANG>_COMPILER_ID`
+ The compiler identifier used by CMake
+:variable:`CMAKE_<LANG>_COMPILER_VERSION`
+ The version of the compiler.
+:variable:`CMAKE_<LANG>_FLAGS`
+ The variables and the configuration-specific equivalents contain flags that
+ will be added to the compile command when compiling a file of a particular
+ language.
+
+CMake needs a way to determine which compiler to use to invoke the linker.
+This is determined by the :prop_sf:`LANGUAGE` property of source files of the
+:manual:`target <cmake-buildsystem(7)>`, and in the case of static libraries,
+the ``LANGUAGE`` of the dependent libraries. The choice CMake makes may be overridden
+with the :prop_tgt:`LINKER_LANGUAGE` target property.
Toolchain Features
==================
@@ -133,24 +140,24 @@ as:
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
-The :variable:`CMAKE_SYSTEM_NAME` is the CMake-identifier of the target platform
-to build for.
-
-The :variable:`CMAKE_SYSTEM_PROCESSOR` is the CMake-identifier of the target architecture
-to build for.
+Where:
-The :variable:`CMAKE_SYSROOT` is optional, and may be specified if a sysroot
-is available.
-
-The :variable:`CMAKE_STAGING_PREFIX` is also optional. It may be used to specify
-a path on the host to install to. The :variable:`CMAKE_INSTALL_PREFIX` is always
-the runtime installation location, even when cross-compiling.
-
-The :variable:`CMAKE_<LANG>_COMPILER` variables may be set to full paths, or to
-names of compilers to search for in standard locations. For toolchains that
-do not support linking binaries without custom flags or scripts one may set
-the :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to ``STATIC_LIBRARY``
-to tell CMake not to try to link executables during its checks.
+:variable:`CMAKE_SYSTEM_NAME`
+ is the CMake-identifier of the target platform to build for.
+:variable:`CMAKE_SYSTEM_PROCESSOR`
+ is the CMake-identifier of the target architecture.
+:variable:`CMAKE_SYSROOT`
+ is optional, and may be specified if a sysroot is available.
+:variable:`CMAKE_STAGING_PREFIX`
+ is also optional. It may be used to specify a path on the host to install to.
+ The :variable:`CMAKE_INSTALL_PREFIX` is always the runtime installation
+ location, even when cross-compiling.
+:variable:`CMAKE_<LANG>_COMPILER`
+ variable may be set to full paths, or to names of compilers to search for
+ in standard locations. For toolchains that do not support linking binaries
+ without custom flags or scripts one may set the
+ :variable:`CMAKE_TRY_COMPILE_TARGET_TYPE` variable to ``STATIC_LIBRARY`` to
+ tell CMake not to try to link executables during its checks.
CMake ``find_*`` commands will look in the sysroot, and the :variable:`CMAKE_FIND_ROOT_PATH`
entries by default in all cases, as well as looking in the host system root prefix.