From d1d134534d36adc638e6a642bc1662f04ee3455f Mon Sep 17 00:00:00 2001 From: Nikita Nemkin Date: Fri, 31 Jan 2025 17:43:29 +0500 Subject: Help: Add formatting to FindGettext and FindGnuplot --- Modules/FindGettext.cmake | 94 ++++++++++++++++++++++++++++++----------------- Modules/FindGnuplot.cmake | 20 +++++----- 2 files changed, 70 insertions(+), 44 deletions(-) diff --git a/Modules/FindGettext.cmake b/Modules/FindGettext.cmake index c9937e7..940d2c0 100644 --- a/Modules/FindGettext.cmake +++ b/Modules/FindGettext.cmake @@ -5,57 +5,83 @@ FindGettext ----------- -Find GNU gettext tools +Find GNU gettext tools. -This module looks for the GNU gettext tools. This module defines the -following values: +This module looks for the GNU gettext tools. -:: +Result Variables +^^^^^^^^^^^^^^^^ - GETTEXT_MSGMERGE_EXECUTABLE: the full path to the msgmerge tool. - GETTEXT_MSGFMT_EXECUTABLE: the full path to the msgfmt tool. - GETTEXT_FOUND: True if gettext has been found. - GETTEXT_VERSION_STRING: the version of gettext found (since CMake 2.8.8) +This module defines the following variables: +``GETTEXT_FOUND`` + True if gettext has been found. +``GETTEXT_VERSION_STRING`` + The version of gettext found. -Additionally it provides the following macros: +``GETTEXT_MSGMERGE_EXECUTABLE`` + The full path to the msgmerge tool. -GETTEXT_CREATE_TRANSLATIONS ( outputFile [ALL] file1 ... fileN ) +``GETTEXT_MSGFMT_EXECUTABLE`` + The full path to the msgfmt tool. -:: +Functions +^^^^^^^^^ - This will create a target "translations" which will convert the - given input po files into the binary output mo file. If the - ALL option is used, the translations will also be created when - building the default target. +This module provides several function. -GETTEXT_PROCESS_POT_FILE( [ALL] [INSTALL_DESTINATION ] -LANGUAGES ... ) +.. command:: gettext_create_translations -:: + .. code-block:: cmake - Process the given pot file to mo files. - If INSTALL_DESTINATION is given then automatically install rules will - be created, the language subdirectory will be taken into account - (by default use share/locale/). - If ALL is specified, the pot file is processed when building the all target. - It creates a custom target "potfile". + gettext_create_translations( [ALL] ...) -GETTEXT_PROCESS_PO_FILES( [ALL] [INSTALL_DESTINATION ] -PO_FILES ... ) + This will create a target "translations" which will convert the + given input .po files into the binary output .mo file. Options: -:: + ``ALL`` + The translations will be created when building the default target. - Process the given po files to mo files for the given language. - If INSTALL_DESTINATION is given then automatically install rules will - be created, the language subdirectory will be taken into account - (by default use share/locale/). - If ALL is specified, the po files are processed when building the all target. - It creates a custom target "pofiles". +.. command:: gettext_process_pot_file + + .. code-block:: cmake + + gettext_process_pot_file( [ALL] + [INSTALL_DESTINATION ] + LANGUAGES ...) + + This function creates a custom target "potfile" which processes the given + .pot file to .mo files. Options: + + ``ALL`` + The .pot file will be processed when building the default target. + + ``INSTALL_DESTINATION`` + Install the results into the given directory (``share/locale/`` by + default). The language subdirectory will be taken into account. + +.. command:: gettext_process_po_files + + .. code-block:: cmake + + gettext_process_po_files( [ALL] + [INSTALL_DESTINATION ] + PO_FILES ...) + + This function creates a custom target "pofiles", which processes the given + .po files to .mo files for the given language. Options: + + ``ALL`` + The .po files will be processed when building the default target. + + ``INSTALL_DESTINATION`` + Install the results into the given directory (``share/locale/`` by + default). The language subdirectory will be taken into account . .. versionadded:: 3.2 - If you wish to use the Gettext library (libintl), use :module:`FindIntl`. + If you wish to use the Gettext runtime library (libintl), use + :module:`FindIntl`. #]=======================================================================] find_program(GETTEXT_MSGMERGE_EXECUTABLE msgmerge) diff --git a/Modules/FindGnuplot.cmake b/Modules/FindGnuplot.cmake index f61c406..07cfbd3 100644 --- a/Modules/FindGnuplot.cmake +++ b/Modules/FindGnuplot.cmake @@ -5,21 +5,21 @@ FindGnuplot ----------- -this module looks for gnuplot +This module looks for gnuplot. +Result Variables +^^^^^^^^^^^^^^^^ +``GNUPLOT_FOUND`` + System has Gnuplot. -Once done this will define +``GNUPLOT_EXECUTABLE`` + The Gnuplot executable. -:: +``GNUPLOT_VERSION_STRING`` + The version of Gnuplot found. - GNUPLOT_FOUND - system has Gnuplot - GNUPLOT_EXECUTABLE - the Gnuplot executable - GNUPLOT_VERSION_STRING - the version of Gnuplot found (since CMake 2.8.8) - - - -GNUPLOT_VERSION_STRING will not work for old versions like 3.7.1. + .. note:: Version string detection will not work for old versions like 3.7.1. #]=======================================================================] include(${CMAKE_CURRENT_LIST_DIR}/FindCygwin.cmake) -- cgit v0.12