FindICU¶
在 3.7 版被加入.
Finds the International Components for Unicode (ICU) libraries and programs:
find_package(ICU [<version>] COMPONENTS <components>... [...])
在 3.11 版被加入: Support for static libraries on Windows.
Components¶
This module supports components, which can be specified with:
find_package(ICU COMPONENTS <components>...)
The following components are supported:
dataFinds the ICU Data library. On Windows, this library component is named
dt, otherwise any of these component names may be used, and the appropriate platform-specific library name will be automatically selected.i18nFinds the ICU Internationalization library. On Windows, this library component is named
in, otherwise any of these component names may be used, and the appropriate platform-specific library name will be automatically selected.ioFinds the ICU Stream and I/O (Unicode stdio) library.
leFinds the deprecated ICU Layout Engine library, which has been removed as of ICU version 58.
lxFinds the ICU Layout Extensions Engine library, used for paragraph layout.
testFinds the ICU test suits.
tuFinds the ICU Tool Utility library.
ucFinds the base ICU Common and Data libraries. This library is required by all other ICU libraries and is recommended to include when working with ICU components.
At least one component should be specified for this module to successfully find ICU.
Imported Targets¶
This module provides the following Imported Targets:
ICU::<component>
Target encapsulating the usage requirements for the specified ICU component, available only if that component is found. The
<component>should be written in lowercase, as listed above. For example, useICU::i18nfor the Internationalization library.
結果變數¶
該模組定義了以下變數:
ICU_FOUNDBoolean indicating whether the (requested version of) main ICU programs and libraries were found.
ICU_VERSIONThe version of the ICU release found.
ICU_INCLUDE_DIRSThe include directories containing the ICU headers.
ICU_LIBRARIESComponent libraries to be linked.
ICU programs are defined in the following variables:
ICU_GENCNVAL_EXECUTABLEThe path to the
gencnvalexecutable.ICU_ICUINFO_EXECUTABLEicuinfo執行檔的路徑。ICU_GENBRK_EXECUTABLEgenbrk執行檔的路徑。ICU_ICU-CONFIG_EXECUTABLEThe path to the
icu-configexecutable.ICU_GENRB_EXECUTABLEThe path to the
genrbexecutable.ICU_GENDICT_EXECUTABLEThe path to the
gendictexecutable.ICU_DERB_EXECUTABLEderb執行檔的路徑。ICU_PKGDATA_EXECUTABLEpkgdata執行檔的路徑。ICU_UCONV_EXECUTABLEuconv執行檔的路徑。ICU_GENCFU_EXECUTABLEgencfu執行檔的路徑。ICU_MAKECONV_EXECUTABLEmakeconv執行檔的路徑。ICU_GENNORM2_EXECUTABLEgennorm2執行檔的路徑。ICU_GENCCODE_EXECUTABLEgenccode執行檔的路徑。ICU_GENSPREP_EXECUTABLEgensprep執行檔的路徑。ICU_ICUPKG_EXECUTABLEicupkg執行檔的路徑。ICU_GENCMN_EXECUTABLEgencmn執行檔的路徑。
ICU component libraries are defined in the following variables:
ICU_<COMPONENT>_FOUNDBoolean indicating whether the ICU component was found; The
<COMPONENT>should be written in uppercase.ICU_<COMPONENT>_LIBRARIESLibraries for component; The
<COMPONENT>should be written in uppercase.
ICU datafiles are defined in the following variables:
ICU_MAKEFILE_INCThe path to the
Makefile.incfile.ICU_PKGDATA_INCThe path to the
pkgdata.incfile.
快取變數¶
The following cache variables may also be set:
ICU_<PROGRAM>_EXECUTABLEThe path to executable
<PROGRAM>; The<PROGRAM>should be written in uppercase. These variables correspond to the ICU program result variables listed above.ICU_INCLUDE_DIRThe directory containing the ICU headers.
ICU_<COMPONENT>_LIBRARYThe library for the ICU component. The
<COMPONENT>should be written in uppercase.
提示¶
This module reads hints about search results from:
ICU_ROOTThe root of the ICU installation. The environment variable
ICU_ROOTmay also be used; theICU_ROOTvariable takes precedence.
備註
In most cases, none of the above variables will need to be set, unless multiple versions of ICU are available and a specific version is required.
範例¶
Finding ICU components and linking them to a project target:
find_package(ICU COMPONENTS i18n io uc)
target_link_libraries(project_target PRIVATE ICU::i18n ICU::io ICU::uc)