FindICU
Added in version 3.7.
Finds the International Components for Unicode (ICU) libraries and programs:
find_package(ICU [<version>] COMPONENTS <components>... [...])
Added in version 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:
-
data -
Finds 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. -
i18n -
Finds 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. -
io -
Finds the ICU Stream and I/O (Unicode stdio) library.
-
le -
Finds the deprecated ICU Layout Engine library, which has been removed as of ICU version 58.
-
lx -
Finds the ICU Layout Extensions Engine library, used for paragraph layout.
-
test -
Finds the ICU test suits.
-
tu -
Finds the ICU Tool Utility library.
-
uc -
Finds 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, use ICU::i18n for the Internationalization library.
Result Variables
This module defines the following variables:
-
ICU_FOUND -
Boolean indicating whether the (requested version of) main ICU programs and libraries were found.
-
ICU_VERSION -
The version of the ICU release found.
-
ICU_INCLUDE_DIRS -
The include directories containing the ICU headers.
-
ICU_LIBRARIES -
Component libraries to be linked.
ICU programs are defined in the following variables:
-
ICU_GENCNVAL_EXECUTABLE -
The path to the
gencnvalexecutable. -
ICU_ICUINFO_EXECUTABLE -
The path to the
icuinfoexecutable. -
ICU_GENBRK_EXECUTABLE -
The path to the
genbrkexecutable. -
ICU_ICU-CONFIG_EXECUTABLE -
The path to the
icu-configexecutable. -
ICU_GENRB_EXECUTABLE -
The path to the
genrbexecutable. -
ICU_GENDICT_EXECUTABLE -
The path to the
gendictexecutable. -
ICU_DERB_EXECUTABLE -
The path to the
derbexecutable. -
ICU_PKGDATA_EXECUTABLE -
The path to the
pkgdataexecutable. -
ICU_UCONV_EXECUTABLE -
The path to the
uconvexecutable. -
ICU_GENCFU_EXECUTABLE -
The path to the
gencfuexecutable. -
ICU_MAKECONV_EXECUTABLE -
The path to the
makeconvexecutable. -
ICU_GENNORM2_EXECUTABLE -
The path to the
gennorm2executable. -
ICU_GENCCODE_EXECUTABLE -
The path to the
genccodeexecutable. -
ICU_GENSPREP_EXECUTABLE -
The path to the
gensprepexecutable. -
ICU_ICUPKG_EXECUTABLE -
The path to the
icupkgexecutable. -
ICU_GENCMN_EXECUTABLE -
The path to the
gencmnexecutable.
ICU component libraries are defined in the following variables:
-
ICU_<COMPONENT>_FOUND -
Boolean indicating whether the ICU component was found; The
<COMPONENT>should be written in uppercase. -
ICU_<COMPONENT>_LIBRARIES -
Libraries for component; The
<COMPONENT>should be written in uppercase.
ICU datafiles are defined in the following variables:
-
ICU_MAKEFILE_INC -
The path to the
Makefile.incfile. -
ICU_PKGDATA_INC -
The path to the
pkgdata.incfile.
Cache Variables
The following cache variables may also be set:
-
ICU_<PROGRAM>_EXECUTABLE -
The path to executable
<PROGRAM>; The<PROGRAM>should be written in uppercase. These variables correspond to the ICU program result variables listed above. -
ICU_INCLUDE_DIR -
The directory containing the ICU headers.
-
ICU_<COMPONENT>_LIBRARY -
The library for the ICU component. The
<COMPONENT>should be written in uppercase.
Hints
This module reads hints about search results from:
-
ICU_ROOT -
The root of the ICU installation. The environment variable
ICU_ROOTmay also be used; theICU_ROOTvariable takes precedence.
Note
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.
Examples
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)
© 2000–2026 Kitware, Inc. and Contributors
Licensed under the BSD 3-clause License.
https://cmake.org/cmake/help/latest/module/FindICU.html