FindIntl¶
在 3.2 版被加入.
Finds internationalization support that includes message translation functions
such as gettext()
. 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
在 3.20 版被加入.
Target encapsulating the Intl usage requirements, available if Intl is found.
結果變數¶
This module defines the following variables:
Intl_FOUND
Boolean indicating whether the Intl is found.
Intl_INCLUDE_DIRS
Include directories containing headers needed to use Intl.
Intl_LIBRARIES
The libraries needed to link against to use Intl.
Intl_VERSION
在 3.21 版被加入.
The version of the found Intl implementation or library, in the format
x.y.z
.備註
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
在 3.21 版被加入.
The major version of Intl found.
Intl_VERSION_MINOR
在 3.21 版被加入.
The minor version of Intl found.
Intl_VERSION_PATCH
在 3.21 版被加入.
The patch version of Intl found.
快取變數¶
The following cache variables may also be set:
Intl_INCLUDE_DIR
The directory containing the
libintl.h
header file.Intl_LIBRARY
The path to the Intl library (if any).
Intl_IS_BUILT_IN
在 3.20 版被加入.
Boolean indicating whether the found Intl functionality is provided by the standard C library rather than a separate
libintl
library.
備註
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.
範例¶
Finding the Intl support and linking the imported target for use in a project:
find_package(Intl)
target_link_libraries(app PRIVATE Intl::Intl)
另請參見¶
The
FindGettext
module to find and use the GNU gettext tools (msgmerge
,msgfmt
, etc.).