2023-08-15 16:20:26 +02:00
|
|
|
# SPDX-FileCopyrightText: 2012 Blender Authors
|
2023-06-14 14:49:59 +02:00
|
|
|
#
|
2022-02-11 04:23:56 +01:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2012-11-19 09:51:35 +01:00
|
|
|
# - Find static icu libraries
|
|
|
|
# Find the native static icu libraries (needed for static boost_locale :/ ).
|
|
|
|
# This module defines
|
|
|
|
# ICU_LIBRARIES, libraries to link against to use icu.
|
|
|
|
# ICU_ROOT_DIR, The base directory to search for icu.
|
|
|
|
# This can also be an environment variable.
|
|
|
|
# ICU_FOUND, If false, do not try to use icu.
|
|
|
|
#
|
|
|
|
# also defined, but not for general use are
|
|
|
|
# ICU_LIBRARY_xxx, where to find the icu libraries.
|
|
|
|
|
2023-07-29 05:47:55 +02:00
|
|
|
# If `ICU_ROOT_DIR` was defined in the environment, use it.
|
2023-08-17 05:15:56 +02:00
|
|
|
if(DEFINED ICU_ROOT_DIR)
|
2023-07-29 05:47:55 +02:00
|
|
|
# Pass.
|
2023-08-17 05:15:56 +02:00
|
|
|
elseif(DEFINED ENV{ICU_ROOT_DIR})
|
|
|
|
set(ICU_ROOT_DIR $ENV{ICU_ROOT_DIR})
|
|
|
|
else()
|
|
|
|
set(ICU_ROOT_DIR "")
|
|
|
|
endif()
|
2012-11-19 09:51:35 +01:00
|
|
|
|
|
|
|
if(Boost_USE_STATIC_LIBS)
|
|
|
|
set(_icu_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
|
|
|
|
endif()
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
set(_icu_SEARCH_DIRS
|
2012-11-19 09:51:35 +01:00
|
|
|
${ICU_ROOT_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
# We don't need includes, only libs to link against...
|
2023-08-17 05:15:56 +02:00
|
|
|
# find_path(ICU_INCLUDE_DIR
|
2019-10-28 15:32:33 +01:00
|
|
|
# NAMES
|
|
|
|
# utf.h
|
|
|
|
# HINTS
|
|
|
|
# ${_icu_SEARCH_DIRS}
|
|
|
|
# PATH_SUFFIXES
|
|
|
|
# include/unicode
|
|
|
|
# )
|
2012-11-19 09:51:35 +01:00
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_DATA
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
icudata
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_I18N
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
icui18n
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_IO
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
icuio
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_LE
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
icule
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_LX
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
iculx
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_TU
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
icutu
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
find_library(ICU_LIBRARY_UC
|
2012-11-19 09:51:35 +01:00
|
|
|
NAMES
|
|
|
|
icuuc
|
|
|
|
HINTS
|
|
|
|
${_icu_SEARCH_DIRS}
|
|
|
|
PATH_SUFFIXES
|
|
|
|
lib64 lib
|
|
|
|
)
|
|
|
|
|
|
|
|
# Restore the original find library ordering
|
|
|
|
if(Boost_USE_STATIC_LIBS)
|
|
|
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ${_icu_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
|
|
endif()
|
|
|
|
|
2018-06-10 08:12:13 +02:00
|
|
|
# handle the QUIETLY and REQUIRED arguments and set ICU_FOUND to TRUE if
|
2012-11-19 09:51:35 +01:00
|
|
|
# all listed variables are TRUE
|
2023-08-17 05:15:56 +02:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Icu DEFAULT_MSG
|
2012-11-19 09:51:35 +01:00
|
|
|
ICU_LIBRARY_DATA
|
|
|
|
ICU_LIBRARY_I18N
|
|
|
|
ICU_LIBRARY_IO
|
|
|
|
ICU_LIBRARY_LE
|
|
|
|
ICU_LIBRARY_LX
|
|
|
|
ICU_LIBRARY_TU
|
|
|
|
ICU_LIBRARY_UC
|
|
|
|
)
|
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
if(ICU_FOUND)
|
|
|
|
set(ICU_LIBRARIES ${ICU_LIBRARY_DATA} ${ICU_LIBRARY_I18N} ${ICU_LIBRARY_IO} ${ICU_LIBRARY_LE} ${ICU_LIBRARY_LX} ${ICU_LIBRARY_TU} ${ICU_LIBRARY_UC})
|
|
|
|
set(ICU_INCLUDE_DIRS ${ICU_INCLUDE_DIR})
|
|
|
|
endif()
|
2012-11-19 09:51:35 +01:00
|
|
|
|
2023-08-17 05:15:56 +02:00
|
|
|
mark_as_advanced(
|
2012-11-19 09:51:35 +01:00
|
|
|
ICU_INCLUDE_DIR
|
|
|
|
ICU_LIBRARY_DATA
|
|
|
|
ICU_LIBRARY_I18N
|
|
|
|
ICU_LIBRARY_IO
|
|
|
|
ICU_LIBRARY_LE
|
|
|
|
ICU_LIBRARY_LX
|
|
|
|
ICU_LIBRARY_TU
|
|
|
|
ICU_LIBRARY_UC
|
|
|
|
)
|
2024-03-08 00:53:03 +01:00
|
|
|
|
|
|
|
unset(_icu_SEARCH_DIRS)
|