comparison OrthancFramework/Resources/CMake/LibIcuConfiguration.cmake @ 4044:d25f4c0fa160 framework

splitting code into OrthancFramework and OrthancServer
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Jun 2020 20:30:34 +0200
parents Resources/CMake/LibIcuConfiguration.cmake@48231cfd2693
children 304842a0d152
comparison
equal deleted inserted replaced
4043:6c6239aec462 4044:d25f4c0fa160
1
2 # Check out: ../ThirdParty/icu/README.txt
3
4 # http://userguide.icu-project.org/packaging
5 # http://userguide.icu-project.org/howtouseicu
6
7 message("Using libicu")
8
9 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBICU)
10 include(${CMAKE_CURRENT_LIST_DIR}/../ThirdParty/icu/Version.cmake)
11 DownloadPackage(${LIBICU_MD5} ${LIBICU_URL} "${LIBICU_SOURCES_DIR}")
12
13 # Use the gzip-compressed data
14 DownloadFile(${LIBICU_DATA_COMPRESSED_MD5} ${LIBICU_DATA_URL})
15 set(LIBICU_RESOURCES
16 LIBICU_DATA ${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${LIBICU_DATA}
17 )
18
19 set_source_files_properties(
20 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}
21 PROPERTIES COMPILE_DEFINITIONS "char16_t=uint16_t"
22 )
23
24 include_directories(BEFORE
25 ${LIBICU_SOURCES_DIR}/source/common
26 ${LIBICU_SOURCES_DIR}/source/i18n
27 )
28
29 aux_source_directory(${LIBICU_SOURCES_DIR}/source/common LIBICU_SOURCES)
30 aux_source_directory(${LIBICU_SOURCES_DIR}/source/i18n LIBICU_SOURCES)
31
32 add_definitions(
33 #-DU_COMBINED_IMPLEMENTATION
34 #-DU_DEF_ICUDATA_ENTRY_POINT=icudt63l_dat
35 #-DU_LIB_SUFFIX_C_NAME=l
36
37 #-DUCONFIG_NO_SERVICE=1
38 -DU_COMMON_IMPLEMENTATION
39 -DU_STATIC_IMPLEMENTATION
40 -DU_ENABLE_DYLOAD=0
41 -DU_HAVE_STD_STRING=1
42 -DU_I18N_IMPLEMENTATION
43 -DU_IO_IMPLEMENTATION
44 -DU_STATIC_IMPLEMENTATION=1
45 #-DU_CHARSET_IS_UTF8
46 -DUNISTR_FROM_STRING_EXPLICIT=
47
48 -DORTHANC_STATIC_ICU=1
49 -DORTHANC_ICU_DATA_MD5="${LIBICU_DATA_UNCOMPRESSED_MD5}"
50 )
51
52 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
53 set_source_files_properties(
54 ${LIBICU_SOURCES_DIR}/source/common/locmap.c
55 PROPERTIES COMPILE_DEFINITIONS "LOCALE_SNAME=0x0000005c"
56 )
57 endif()
58
59 source_group(ThirdParty\\libicu REGULAR_EXPRESSION ${LIBICU_SOURCES_DIR}/.*)
60
61 else()
62 CHECK_INCLUDE_FILE_CXX(unicode/uvernum.h HAVE_ICU_H)
63 if (NOT HAVE_ICU_H)
64 message(FATAL_ERROR "Please install the libicu-dev package")
65 endif()
66
67 find_library(LIBICU_PATH_1 NAMES icuuc)
68 find_library(LIBICU_PATH_2 NAMES icui18n)
69
70 if (NOT LIBICU_PATH_1 OR
71 NOT LIBICU_PATH_2)
72 message(FATAL_ERROR "Please install the libicu-dev package")
73 else()
74 link_libraries(${LIBICU_PATH_1} ${LIBICU_PATH_2})
75 endif()
76
77 add_definitions(
78 -DORTHANC_STATIC_ICU=0
79 )
80 endif()