From 0e3c361f7733a073375d44802daa3c69016eb8d4 Mon Sep 17 00:00:00 2001
From: Brad King <brad.king@kitware.com>
Date: Thu, 18 Feb 2021 10:31:34 -0500
Subject: [PATCH] Help: Link to tool-specific preset arguments from
 cmake-presets(7)

Fixes: #21835
---
 Help/manual/cmake-presets.7.rst | 13 +++++++------
 Help/manual/ctest.1.rst         |  2 ++
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/Help/manual/cmake-presets.7.rst b/Help/manual/cmake-presets.7.rst
index 3be6c6f0c0..fb4babebe6 100644
--- a/Help/manual/cmake-presets.7.rst
+++ b/Help/manual/cmake-presets.7.rst
@@ -91,8 +91,8 @@ that may contain the following fields:
 ``name``
 
   A required string representing the machine-friendly name of the preset.
-  This identifier is used in the ``--preset`` argument. There must not be
-  two presets in the union of ``CMakePresets.json`` and
+  This identifier is used in the :ref:`cmake --preset <CMake Options>` option.
+  There must not be two presets in the union of ``CMakePresets.json`` and
   ``CMakeUserPresets.json`` in the same directory with the same name.
 
 ``hidden``
@@ -309,8 +309,9 @@ that may contain the following fields:
 ``name``
 
   A required string representing the machine-friendly name of the preset.
-  This identifier is used in the ``--preset`` argument. There must not be
-  two presets (configure, build, or test) in the union of
+  This identifier is used in the
+  :ref:`cmake --build --preset <Build Tool Mode>` option.
+  There must not be two presets (configure, build, or test) in the union of
   ``CMakePresets.json`` and ``CMakeUserPresets.json`` in the same
   directory with the same name.
 
@@ -427,8 +428,8 @@ that may contain the following fields:
 ``name``
 
   A required string representing the machine-friendly name of the preset.
-  This identifier is used in the ``--preset`` argument. There must not be
-  two presets (configure, build, or test) in the union of
+  This identifier is used in the :ref:`ctest --preset <CTest Options>` option.
+  There must not be two presets (configure, build, or test) in the union of
   ``CMakePresets.json`` and ``CMakeUserPresets.json`` in the same
   directory with the same name.
 
diff --git a/Help/manual/ctest.1.rst b/Help/manual/ctest.1.rst
index 43157b6d96..0a3614f94c 100644
--- a/Help/manual/ctest.1.rst
+++ b/Help/manual/ctest.1.rst
@@ -25,6 +25,8 @@ CMake-generated build trees created for projects that use the
 :command:`enable_testing` and :command:`add_test` commands have testing support.
 This program will run the tests and report results.
 
+.. _`CTest Options`:
+
 Options
 =======
 
-- 
GitLab