diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2020-10-23 16:37:06 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2020-10-26 11:32:45 (GMT) |
commit | b7d7eca66db97f9dcb6068762733f06941c0c05a (patch) | |
tree | 17b111e02de883947dd10c1097ae14303906945b /Help | |
parent | f2a59d400e9ec2e937f6000000c2e9860e388ca7 (diff) | |
download | CMake-b7d7eca66db97f9dcb6068762733f06941c0c05a.zip CMake-b7d7eca66db97f9dcb6068762733f06941c0c05a.tar.gz CMake-b7d7eca66db97f9dcb6068762733f06941c0c05a.tar.bz2 |
CMakePresets.json: Rework how --preset argument is handled
If a path argument with no -S or -B leads to a cache directory,
use that directory as the binary directory. Otherwise, use the
binary directory from the preset.
Fixes: #21311
Diffstat (limited to 'Help')
-rw-r--r-- | Help/manual/cmake-gui.1.rst | 5 | ||||
-rw-r--r-- | Help/manual/cmake.1.rst | 32 |
2 files changed, 17 insertions, 20 deletions
diff --git a/Help/manual/cmake-gui.1.rst b/Help/manual/cmake-gui.1.rst index d9c8ed7..97b5731 100644 --- a/Help/manual/cmake-gui.1.rst +++ b/Help/manual/cmake-gui.1.rst @@ -11,7 +11,6 @@ Synopsis cmake-gui [<options>] cmake-gui [<options>] {<path-to-source> | <path-to-existing-build>} cmake-gui [<options>] -S <path-to-source> -B <path-to-build> - cmake-gui [<options>] -S <path-to-source> --preset=<preset-name> Description =========== @@ -38,8 +37,8 @@ Options If the directory doesn't already exist CMake will make it. ``--preset=<preset-name>`` - Name of the preset to use from the project's ``CMakePresets.json`` file, if it - has one. + Name of the preset to use from the project's + :manual:`presets <cmake-presets(7)>` files, if it has them. .. include:: OPTIONS_HELP.txt diff --git a/Help/manual/cmake.1.rst b/Help/manual/cmake.1.rst index 5452c79..921f5c4 100644 --- a/Help/manual/cmake.1.rst +++ b/Help/manual/cmake.1.rst @@ -12,7 +12,6 @@ Synopsis cmake [<options>] <path-to-source> cmake [<options>] <path-to-existing-build> cmake [<options>] -S <path-to-source> -B <path-to-build> - cmake [<options>] -S <path-to-source> --preset=<preset-name> `Build a Project`_ cmake --build <dir> [<options>] [-- <build-tool-options>] @@ -149,22 +148,6 @@ source and build trees and generate a buildsystem: $ cmake -S src -B build -``cmake [<options>] -S <path-to-source> --preset=<preset-name>`` - Uses ``<path-to-source>`` as the source tree and reads a - :manual:`preset <cmake-presets(7)>` from - ``<path-to-source>/CMakePresets.json`` and - ``<path-to-source>/CMakeUserPresets.json``. The preset specifies the - generator and the build directory, and optionally a list of variables and - other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can - also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For - full details on these files, see :manual:`cmake-presets(7)`. - - The presets are read before all other command line options. The options - specified by the preset (variables, generator, etc.) can all be overridden by - manually specifying them on the command line. For example, if the preset sets - a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a - ``-D`` argument, the value ``2`` is preferred. - In all cases the ``<options>`` may be zero or more of the `Options`_ below. After generating a buildsystem one may use the corresponding native @@ -394,6 +377,21 @@ Options about:tracing tab of Google Chrome or using a plugin for a tool like Trace Compass. +``--preset=<preset>`` + Reads a :manual:`preset <cmake-presets(7)>` from + ``<path-to-source>/CMakePresets.json`` and + ``<path-to-source>/CMakeUserPresets.json``. The preset specifies the + generator and the build directory, and optionally a list of variables and + other arguments to pass to CMake. The :manual:`CMake GUI <cmake-gui(1)>` can + also recognize ``CMakePresets.json`` and ``CMakeUserPresets.json`` files. For + full details on these files, see :manual:`cmake-presets(7)`. + + The presets are read before all other command line options. The options + specified by the preset (variables, generator, etc.) can all be overridden by + manually specifying them on the command line. For example, if the preset sets + a variable called ``MYVAR`` to ``1``, but the user sets it to ``2`` with a + ``-D`` argument, the value ``2`` is preferred. + .. _`Build Tool Mode`: Build a Project |