2022-10-20 05:32:31 +03:00
|
|
|
# Try to find International Components for Unicode, once done this will define:
|
2019-11-21 18:18:37 +00:00
|
|
|
#
|
|
|
|
# ICU_FOUND - system has ICU
|
|
|
|
# ICU_INCLUDES - the ICU include directory
|
2019-11-25 05:56:32 +00:00
|
|
|
# ICU_LIBRARIES - the libraries needed to use ICU
|
2019-11-21 18:18:37 +00:00
|
|
|
#
|
2022-10-20 05:32:31 +03:00
|
|
|
# Copyright (C) 2015 Ivailo Monev <xakepa10@gmail.com>
|
2019-11-21 18:18:37 +00:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
|
2022-10-02 10:34:18 +03:00
|
|
|
find_package(PkgConfig REQUIRED)
|
2020-12-03 16:33:21 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
|
2020-10-26 16:27:43 +02:00
|
|
|
pkg_check_modules(PC_ICU QUIET icu-i18n)
|
|
|
|
pkg_check_modules(PC_ICUUC QUIET icu-uc)
|
|
|
|
|
2020-12-01 17:30:43 +00:00
|
|
|
find_path(ICU_INCLUDES
|
|
|
|
NAMES
|
|
|
|
unicode/unistr.h
|
|
|
|
HINTS $ENV{ICUDIR}/include ${PC_ICU_INCLUDEDIR}
|
|
|
|
)
|
2020-02-10 21:21:33 +00:00
|
|
|
|
2020-12-01 17:30:43 +00:00
|
|
|
find_library(ICU_LIBRARIES
|
|
|
|
NAME icui18n
|
|
|
|
HINTS $ENV{ICUDIR}/lib ${PC_ICU_LIBDIR}
|
|
|
|
)
|
2020-02-10 21:21:33 +00:00
|
|
|
|
2020-12-01 17:30:43 +00:00
|
|
|
find_library(ICUUC_LIBRARIES
|
|
|
|
NAMES icuuc
|
|
|
|
HINTS $ENV{ICUDIR}/lib ${PC_ICUUC_LIBDIR}
|
|
|
|
)
|
2019-11-21 18:18:37 +00:00
|
|
|
|
|
|
|
if(ICU_LIBRARIES AND ICUUC_LIBRARIES)
|
|
|
|
set(ICU_LIBRARIES ${ICU_LIBRARIES} ${ICUUC_LIBRARIES})
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_package_handle_standard_args(ICU
|
|
|
|
VERSION_VAR PC_ICU_VERSION
|
|
|
|
REQUIRED_VARS ICU_LIBRARIES ICUUC_LIBRARIES ICU_INCLUDES
|
|
|
|
)
|
|
|
|
|
|
|
|
mark_as_advanced(ICU_INCLUDES ICU_LIBRARIES ICUUC_LIBRARIES)
|