From 50769f3f10e1145739ba1fd28e6e27cac23589fb Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Mon, 12 May 2025 23:21:18 +0200 Subject: [PATCH] FindHg: Sync module documentation - Added intro code block with find_package() showing how to find the package with this module. - Used "command" instead of "macro". - Synced descriptions with other similar find modules. --- Help/release/3.1.rst | 2 +- Modules/FindHg.cmake | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Help/release/3.1.rst b/Help/release/3.1.rst index 1596da148e..fa70367c3a 100644 --- a/Help/release/3.1.rst +++ b/Help/release/3.1.rst @@ -235,7 +235,7 @@ Modules * The :module:`FindGLUT` module now provides imported targets. -* The :module:`FindHg` module gained a new ``Hg_WC_INFO`` macro to +* The :module:`FindHg` module gained a new ``Hg_WC_INFO`` command to help run ``hg`` to extract information about a Mercurial work copy. * The :module:`FindOpenCL` module was introduced. diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake index c88a523213..f4f30743da 100644 --- a/Modules/FindHg.cmake +++ b/Modules/FindHg.cmake @@ -6,16 +6,21 @@ FindHg ------ Finds the Mercurial command-line client executable (``hg``) and provides a -command for extracting information from a Mercurial working copy. +command for extracting information from a Mercurial working copy: + +.. code-block:: cmake + + find_package(Hg [] [...]) Result Variables ^^^^^^^^^^^^^^^^ -This module sets the following variables: +This module defines the following variables: ``Hg_FOUND`` - Boolean indicating whether the Mercurial client was found. For backward - compatibility, the ``HG_FOUND`` variable is also set to the same value. + Boolean indicating whether (the requested version of) Mercurial client is + found. For backward compatibility, the ``HG_FOUND`` variable is also set + to the same value. ``HG_VERSION_STRING`` The version of Mercurial found. @@ -31,7 +36,7 @@ The following cache variables may also be set: Commands ^^^^^^^^ -This module defines the following command when Mercurial client (``hg``) is +This module provides the following command when Mercurial client (``hg``) is found: .. command:: Hg_WC_INFO @@ -44,7 +49,7 @@ found: Hg_WC_INFO( ) - This macro defines the following variables if running Mercurial client on + This command defines the following variables if running Mercurial client on working copy located at a given location ```` succeeds; otherwise a ``SEND_ERROR`` message is generated: