annotate Resources/CMake/LibIcuConfiguration.cmake @ 3286:2b547eaed193

upgrade to libjpeg 9c
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 21 Feb 2019 18:19:56 +0100
parents 92d679112657
children 2a38e00a0638
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3242
5d78df37c62f automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3241
diff changeset
1
5d78df37c62f automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3241
diff changeset
2 # Check out: ../ThirdParty/icu/README.txt
3231
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
3
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
4 # http://userguide.icu-project.org/packaging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
5 # http://userguide.icu-project.org/howtouseicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
6
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 message("Using libicu")
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
8
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBICU)
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
10 include(${CMAKE_CURRENT_LIST_DIR}/../ThirdParty/icu/Version.cmake)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
11 DownloadPackage(${LIBICU_MD5} ${LIBICU_URL} "${LIBICU_SOURCES_DIR}")
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
12
3266
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
13 if (MSVC AND
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
14 CMAKE_SIZEOF_VOID_P EQUAL 8)
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
15 # In Visual Studio 2015 64bit, we get the following error if using
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
16 # the plain C version of the ICU data: "icudt58l_dat.c(1638339):
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
17 # fatal error C1060: compiler is out of heap space" => we use a
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
18 # precompiled binary generated using MinGW on Linux
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
19 DownloadCompressedFile(${LIBICU_DATA_WIN64_MD5} ${LIBICU_DATA_WIN64_URL} ${LIBICU_DATA_WIN64})
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
20
3270
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3266
diff changeset
21 set(LIBICU_LIBRARIES
3266
25df9eae8891 fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3257
diff changeset
22 ${CMAKE_BINARY_DIR}/${LIBICU_DATA_WIN64}
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
23 )
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
24 else()
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
25 # Use plain C data library
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
26 DownloadCompressedFile(${LIBICU_DATA_MD5} ${LIBICU_DATA_URL} ${LIBICU_DATA})
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
27
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
28 set_source_files_properties(
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
29 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
30 PROPERTIES COMPILE_DEFINITIONS "char16_t=uint16_t"
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
31 )
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
32
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
33 set(LIBICU_SOURCES
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
34 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
35 )
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
36 endif()
3242
5d78df37c62f automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3241
diff changeset
37
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
38 include_directories(BEFORE
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
39 ${LIBICU_SOURCES_DIR}/source/common
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
40 ${LIBICU_SOURCES_DIR}/source/i18n
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
41 )
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
42
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
43 aux_source_directory(${LIBICU_SOURCES_DIR}/source/common LIBICU_SOURCES)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
44 aux_source_directory(${LIBICU_SOURCES_DIR}/source/i18n LIBICU_SOURCES)
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
46 add_definitions(
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
47 #-DU_COMBINED_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
48 #-DU_DEF_ICUDATA_ENTRY_POINT=icudt63l_dat
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
49 #-DU_LIB_SUFFIX_C_NAME=l
3241
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
50
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
51 #-DUCONFIG_NO_SERVICE=1
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
52 -DU_COMMON_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
53 -DU_ENABLE_DYLOAD=0
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
54 -DU_HAVE_STD_STRING=1
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
55 -DU_I18N_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
56 -DU_IO_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
57 -DU_STATIC_IMPLEMENTATION=1
3241
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
58 #-DU_CHARSET_IS_UTF8
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
59 -DUNISTR_FROM_STRING_EXPLICIT=
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
60 )
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
62 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
3244
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
63 set_source_files_properties(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
64 ${LIBICU_SOURCES_DIR}/source/common/locmap.c
3245
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3244
diff changeset
65 PROPERTIES COMPILE_DEFINITIONS "LOCALE_SNAME=0x0000005c"
3244
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
66 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
67 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
68
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
69 source_group(ThirdParty\\libicu REGULAR_EXPRESSION ${LIBICU_SOURCES_DIR}/.*)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
70
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 else()
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 CHECK_INCLUDE_FILE_CXX(unicode/uvernum.h HAVE_ICU_H)
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 if (NOT HAVE_ICU_H)
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 message(FATAL_ERROR "Please install the libicu-dev package")
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 endif()
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76
3230
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
77 find_library(LIBICU_PATH_1 NAMES icuuc)
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
78 find_library(LIBICU_PATH_2 NAMES icui18n)
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
79
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
80 if (NOT LIBICU_PATH_1 OR
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
81 NOT LIBICU_PATH_2)
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
82 message(FATAL_ERROR "Please install the libicu-dev package")
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 else()
3230
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
84 link_libraries(icuuc icui18n)
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 endif()
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 endif()