# HG changeset patch # User Sebastien Jodogne # Date 1550172153 -3600 # Node ID 4b042ec734c1ab2d5e200fd8b194e1fb8276214f # Parent 77e8378f0323102655fff32c415ce46d7063789b dynamic linking against libicu diff -r 77e8378f0323 -r 4b042ec734c1 Core/Toolbox.cpp --- a/Core/Toolbox.cpp Thu Feb 14 19:52:35 2019 +0100 +++ b/Core/Toolbox.cpp Thu Feb 14 20:22:33 2019 +0100 @@ -499,7 +499,11 @@ return "GB18030"; case Encoding_Thai: +#if BOOST_LOCALE_WITH_ICU == 1 + return "tis620.2533"; +#else return "TIS620.2533-0"; +#endif case Encoding_Korean: return "ISO-IR-149"; diff -r 77e8378f0323 -r 4b042ec734c1 Resources/CMake/BoostConfiguration.cmake --- a/Resources/CMake/BoostConfiguration.cmake Thu Feb 14 19:52:35 2019 +0100 +++ b/Resources/CMake/BoostConfiguration.cmake Thu Feb 14 20:22:33 2019 +0100 @@ -228,6 +228,18 @@ if (NOT ENABLE_LOCALE) message("boost::locale is disabled") else() + set(BOOST_ICU_SOURCES + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/boundary.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/codecvt.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/collator.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/conversion.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/date_time.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/formatter.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/icu_backend.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/numeric.cpp + ${BOOST_SOURCES_DIR}/libs/locale/src/icu/time_zone.cpp + ) + list(APPEND BOOST_SOURCES ${BOOST_SOURCES_DIR}/libs/locale/src/encoding/codepage.cpp ${BOOST_SOURCES_DIR}/libs/locale/src/shared/generator.cpp @@ -263,6 +275,7 @@ add_definitions(-DBOOST_LOCALE_WITH_ICONV=1) elseif (BOOST_LOCALE_BACKEND STREQUAL "icu") add_definitions(-DBOOST_LOCALE_WITH_ICU=1) + list(APPEND BOOST_SOURCES ${BOOST_ICU_SOURCES}) else() message(FATAL_ERROR "Unsupported value for BOOST_LOCALE_BACKEND: ${BOOST_LOCALE_BACKEND}") endif() @@ -295,17 +308,7 @@ add_definitions(-DBOOST_LOCALE_WITH_ICONV=1) elseif (BOOST_LOCALE_BACKEND STREQUAL "icu") add_definitions(-DBOOST_LOCALE_WITH_ICU=1) - list(APPEND BOOST_SOURCES - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/boundary.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/codecvt.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/collator.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/conversion.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/date_time.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/formatter.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/icu_backend.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/numeric.cpp - ${BOOST_SOURCES_DIR}/libs/locale/src/icu/time_zone.cpp - ) + list(APPEND BOOST_SOURCES ${BOOST_ICU_SOURCES}) else() message(FATAL_ERROR "Unsupported value for BOOST_LOCALE_BACKEND: ${BOOST_LOCALE_BACKEND}") endif() @@ -334,6 +337,7 @@ add_definitions(-DBOOST_LOCALE_WITH_ICONV=1) elseif (BOOST_LOCALE_BACKEND STREQUAL "icu") add_definitions(-DBOOST_LOCALE_WITH_ICU=1) + list(APPEND BOOST_SOURCES ${BOOST_ICU_SOURCES}) elseif (BOOST_LOCALE_BACKEND STREQUAL "wconv") message("Using Window's wconv") else() diff -r 77e8378f0323 -r 4b042ec734c1 Resources/CMake/LibIcuConfiguration.cmake --- a/Resources/CMake/LibIcuConfiguration.cmake Thu Feb 14 19:52:35 2019 +0100 +++ b/Resources/CMake/LibIcuConfiguration.cmake Thu Feb 14 20:22:33 2019 +0100 @@ -73,11 +73,13 @@ message(FATAL_ERROR "Please install the libicu-dev package") endif() - CHECK_LIBRARY_EXISTS(icuuc udata_close "" HAVE_ICU_LIB) - if (NOT HAVE_ICU_LIB) - #message(FATAL_ERROR "Please install the libicu-dev package") - link_libraries(icuuc) + find_library(LIBICU_PATH_1 NAMES icuuc) + find_library(LIBICU_PATH_2 NAMES icui18n) + + if (NOT LIBICU_PATH_1 OR + NOT LIBICU_PATH_2) + message(FATAL_ERROR "Please install the libicu-dev package") else() - link_libraries(icuuc) + link_libraries(icuuc icui18n) endif() endif()