comparison Resources/CMake/LibIconvConfiguration.cmake @ 2367:2aff870c2c58

refactoring of BoostConfiguration.cmake
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 22 Aug 2017 17:32:13 +0200
parents 26f3a346226f
children 8ab3310dd4f7
comparison
equal deleted inserted replaced
2366:26f3a346226f 2367:2aff870c2c58
1 if (NOT USE_BOOST_ICONV) 1 if (NOT ENABLE_LOCALE)
2 message("Support for locales is disabled")
3
4 elseif (NOT USE_BOOST_ICONV)
2 message("Not using libiconv") 5 message("Not using libiconv")
3
4 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
5 # Starting with release 0.8.2, Orthanc statically links against
6 # libiconv, even on Windows. Indeed, the "WCONV" library of
7 # Windows XP seems not to support properly several codepages
8 # (notably "Latin3", "Hebrew", and "Arabic"). The flag
9 # "USE_BOOST_ICONV" allows to force the use of "WCONV".
10 add_definitions(-DBOOST_LOCALE_WITH_WCONV=1)
11 else()
12 message(FATAL_ERROR "Support your platform here")
13 endif()
14 6
15 else() 7 else()
16 message("Using libiconv") 8 message("Using libiconv")
17
18 add_definitions(
19 -DBOOST_LOCALE_WITH_ICONV=1
20 )
21 9
22 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBICONV) 10 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBICONV)
23 set(LIBICONV_SOURCES_DIR ${CMAKE_BINARY_DIR}/libiconv-1.15) 11 set(LIBICONV_SOURCES_DIR ${CMAKE_BINARY_DIR}/libiconv-1.15)
24 set(LIBICONV_URL "http://www.orthanc-server.com/downloads/third-party/libiconv-1.15.tar.gz") 12 set(LIBICONV_URL "http://www.orthanc-server.com/downloads/third-party/libiconv-1.15.tar.gz")
25 set(LIBICONV_MD5 "ace8b5f2db42f7b3b3057585e80d9808") 13 set(LIBICONV_MD5 "ace8b5f2db42f7b3b3057585e80d9808")
26 14
27 DownloadPackage(${LIBICONV_MD5} ${LIBICONV_URL} "${LIBICONV_SOURCES_DIR}") 15 DownloadPackage(${LIBICONV_MD5} ${LIBICONV_URL} "${LIBICONV_SOURCES_DIR}")
28 16
29 # Disable the support of libiconv that is shipped by default with 17 # Disable the support of libiconv that is shipped by default with
30 # the C standard library on Linux. Setting this macro redirects 18 # the C standard library on Linux. Setting this macro redirects
31 # calls from "iconv*()" to "libiconv*()" in the source code of 19 # calls from "iconv*()" to "libiconv*()" by defining macros in the
32 # "libiconv-1.15". 20 # C headers of "libiconv-1.15".
33 add_definitions(-DLIBICONV_PLUG=1) 21 add_definitions(-DLIBICONV_PLUG=1)
34 22
35 # https://groups.google.com/d/msg/android-ndk/AS1nkxnk6m4/EQm09hD1tigJ 23 # https://groups.google.com/d/msg/android-ndk/AS1nkxnk6m4/EQm09hD1tigJ
36 add_definitions( 24 add_definitions(
37 -DBUILDING_LIBICONV=1 25 -DBUILDING_LIBICONV=1