diff Resources/CMake/OrthancFrameworkConfiguration.cmake @ 3228:4b9cfd92d1ae

preparing for libicu
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 14 Feb 2019 19:41:09 +0100
parents ef4d86d05503
children 32596919d729
line wrap: on
line diff
--- a/Resources/CMake/OrthancFrameworkConfiguration.cmake	Thu Feb 14 16:22:52 2019 +0100
+++ b/Resources/CMake/OrthancFrameworkConfiguration.cmake	Thu Feb 14 19:41:09 2019 +0100
@@ -94,7 +94,7 @@
 endif()
 
 if (NOT ENABLE_LOCALE)
-  unset(USE_SYSTEM_LIBICONV CACHE)
+  unset(BOOST_LOCALE_BACKEND CACHE)
   add_definitions(-DORTHANC_ENABLE_LOCALE=0)
 endif()
 
@@ -378,16 +378,24 @@
 
 
 ##
-## Locale support: libiconv
+## Locale support
 ##
 
 if (ENABLE_LOCALE)
   if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
     # In WebAssembly or asm.js, we rely on the version of iconv that
     # is shipped with the stdlib
-    unset(USE_BOOST_ICONV CACHE)
+    unset(BOOST_LOCALE_BACKEND CACHE)
   else()
-    include(${CMAKE_CURRENT_LIST_DIR}/LibIconvConfiguration.cmake)
+    if (BOOST_LOCALE_BACKEND STREQUAL "iconv")
+      include(${CMAKE_CURRENT_LIST_DIR}/LibIconvConfiguration.cmake)
+    elseif (BOOST_LOCALE_BACKEND STREQUAL "icu")
+      include(${CMAKE_CURRENT_LIST_DIR}/LibIcuConfiguration.cmake)
+    elseif (BOOST_LOCALE_BACKEND STREQUAL "wconv")
+      message("Using Microsoft Window's wconv")
+    else()
+      message(FATAL_ERROR "Invalid value for BOOST_LOCALE_BACKEND: ${BOOST_LOCALE_BACKEND}")
+    endif()
   endif()
   
   add_definitions(-DORTHANC_ENABLE_LOCALE=1)
@@ -610,6 +618,7 @@
   ${CURL_SOURCES}
   ${JSONCPP_SOURCES}
   ${LIBICONV_SOURCES}
+  ${LIBICU_SOURCES}
   ${LIBJPEG_SOURCES}
   ${LIBP11_SOURCES}
   ${LIBPNG_SOURCES}