Procházet zdrojové kódy

Merge topic 'manual-toolchain'

004568a9f3 Help: Add links between cmake-{toolchains,presets}(7)

Acked-by: Kitware Robot <[email protected]>
Merge-request: !7650
Brad King před 3 roky
rodič
revize
bca403357e
2 změnil soubory, kde provedl 46 přidání a 33 odebrání
  1. 8 2
      Help/manual/cmake-presets.7.rst
  2. 38 31
      Help/manual/cmake-toolchains.7.rst

+ 8 - 2
Help/manual/cmake-presets.7.rst

@@ -10,6 +10,8 @@ cmake-presets(7)
 Introduction
 Introduction
 ============
 ============
 
 
+.. versionadded:: 3.19
+
 One problem that CMake users often face is sharing settings with other people
 One problem that CMake users often face is sharing settings with other people
 for common ways to configure a project. This may be done to support CI builds,
 for common ways to configure a project. This may be done to support CI builds,
 or for users who frequently use the same build. CMake supports two main files,
 or for users who frequently use the same build. CMake supports two main files,
@@ -190,8 +192,12 @@ that may contain the following fields:
 
 
 ``architecture``, ``toolset``
 ``architecture``, ``toolset``
   Optional fields representing the platform and toolset, respectively, for
   Optional fields representing the platform and toolset, respectively, for
-  generators that support them. Each may be either a string or an object
-  with the following fields:
+  :manual:`generators <cmake-generators(7)>` that support them.
+
+  See :option:`cmake -A` option for for possible values for ``architecture``
+  and :option:`cmake -T` for ``toolset``.
+
+  Each may be either a string or an object with the following fields:
 
 
   ``value``
   ``value``
     An optional string representing the value.
     An optional string representing the value.

+ 38 - 31
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
 defaults. In cross-compiling scenarios, a toolchain file may be specified
 with information about compiler and utility paths.
 with information about compiler and utility paths.
 
 
+.. versionadded:: 3.19
+  One may use :manual:`cmake-presets(7)` to specify toolchain files.
+
 Languages
 Languages
 =========
 =========
 
 
@@ -58,20 +61,24 @@ Variables and Properties
 ========================
 ========================
 
 
 Several variables relate to the language components of a toolchain which are
 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
 Toolchain Features
 ==================
 ==================
@@ -133,24 +140,24 @@ as:
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
   set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
   set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE 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`
 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.
 entries by default in all cases, as well as looking in the host system root prefix.