FindGettext — CMake 4.0.3-dirty Documentation

# FindGettext

Find GNU gettext tools.

This module looks for the GNU gettext tools.

## Result Variables

This module defines the following variables:

`GETTEXT_FOUND`

  True if gettext has been found.

`GETTEXT_VERSION_STRING`

  The version of gettext found.

`GETTEXT_MSGMERGE_EXECUTABLE`

  The full path to the msgmerge tool.

`GETTEXT_MSGFMT_EXECUTABLE`

  The full path to the msgfmt tool.

## Functions

This module provides several function.

gettext_create_translations

      gettext_create_translations(<mofile> [ALL] <file>...)

  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.

gettext_process_pot_file

      gettext_process_pot_file(<potfile> [ALL]
                               [INSTALL_DESTINATION <destdir>]
                               LANGUAGES <lang>...)

  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.

gettext_process_po_files

      gettext_process_po_files(<lang> [ALL]
                               [INSTALL_DESTINATION <dir>]
                               PO_FILES <pofile>...)

  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 .

Added in version 3.2: If you wish to use the Gettext runtime library (libintl), use `FindIntl`.