FindIntl — CMake 4.2.6 Documentation

# FindIntl

Added in version 3.2.

Finds internationalization support that includes message translation functions such as `gettext()`:

    find_package(Intl [<version>] [...])

These functions originate from the GNU `libintl` library, which is part of the GNU gettext utilities, but may also be provided by the standard C library.

## Imported Targets

This module provides the following Imported Targets:

`Intl::Intl`

  Added in version 3.20.

  Target encapsulating the Intl usage requirements, available if Intl is found.

## Result Variables

This module defines the following variables:

`Intl_FOUND`

  Boolean indicating whether (the requested version of) Intl was found.

`Intl_VERSION`

  Added in version 3.21.

  The version of the found Intl implementation or library, in the format `x.y.z`.

  Note

  Some Intl implementations don't embed the version in their header files. In this case the variables `Intl_VERSION*` will be empty.

`Intl_VERSION_MAJOR`

  Added in version 3.21.

  The major version of Intl found.

`Intl_VERSION_MINOR`

  Added in version 3.21.

  The minor version of Intl found.

`Intl_VERSION_PATCH`

  Added in version 3.21.

  The patch version of Intl found.

`Intl_INCLUDE_DIRS`

  Include directories containing headers needed to use Intl.

`Intl_LIBRARIES`

  The libraries needed to link against to use Intl.

## Cache Variables

The following cache variables may also be set:

`Intl_IS_BUILT_IN`

  Added in version 3.20.

  Boolean indicating whether the found Intl functionality is provided by the standard C library rather than a separate `libintl` library.

`Intl_INCLUDE_DIR`

  The directory containing the `libintl.h` header file.

`Intl_LIBRARY`

  The path to the Intl library (if any).

Note

On some platforms, such as Linux with GNU libc, the gettext functions are present in the C standard library and libintl is not required. The `Intl_LIBRARY` and `Intl_INCLUDE_DIR` will be empty in this case.

## Examples

Finding the Intl support and linking the imported target for use in a project:

    find_package(Intl)
    target_link_libraries(app PRIVATE Intl::Intl)

## See Also

- The `FindGettext` module to find and use the GNU gettext tools (`msgmerge`, `msgfmt`, etc.).