Mercurial > hg > orthanc
annotate Resources/ThirdParty/icu/CMakeLists.txt @ 3251:fcfd4f73228c
using masm if compiling icu with Visual Studio
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 16 Feb 2019 14:28:53 +0100 |
parents | cf0ad1fb2bb7 |
children | 768c219e7b11 |
rev | line source |
---|---|
3237 | 1 cmake_minimum_required(VERSION 2.8) |
2 project(IcuCodeGeneration) | |
3 | |
3241
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
4 set(USE_LEGACY_LIBICU OFF CACHE BOOL "Use icu icu4c-58_2, latest version not requiring a C++11 compiler (for LSB and old versions of Visual Studio)") |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
5 |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
6 if (NOT USE_LEGACY_LIBICU) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
7 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
8 endif() |
3237 | 9 |
10 include(${CMAKE_SOURCE_DIR}/../../CMake/Compiler.cmake) | |
11 include(${CMAKE_SOURCE_DIR}/../../CMake/DownloadPackage.cmake) | |
12 include(Version.cmake) | |
13 | |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
14 set(SOURCE_DATA |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
15 "${LIBICU_SOURCES_DIR}/source/data/in/${LIBICU_DATA_VERSION}${LIBICU_SUFFIX}.dat") |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
16 |
3237 | 17 set(ALLOW_DOWNLOADS ON) |
18 DownloadPackage(${LIBICU_MD5} ${LIBICU_URL} "${LIBICU_SOURCES_DIR}") | |
19 | |
20 include_directories( | |
21 ${LIBICU_SOURCES_DIR}/source/common | |
22 ${LIBICU_SOURCES_DIR}/source/i18n | |
23 ${LIBICU_SOURCES_DIR}/source/tools/toolutil/ | |
24 ) | |
25 | |
26 aux_source_directory(${LIBICU_SOURCES_DIR}/source/common LIBICU_SOURCES) | |
27 aux_source_directory(${LIBICU_SOURCES_DIR}/source/i18n LIBICU_SOURCES) | |
28 aux_source_directory(${LIBICU_SOURCES_DIR}/source/tools/toolutil LIBICU_SOURCES) | |
29 | |
3241
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
30 if (USE_LEGACY_LIBICU) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
31 list(APPEND LIBICU_SOURCES |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
32 ${LIBICU_SOURCES_DIR}/source/stubdata/stubdata.c |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
33 ) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
34 else() |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
35 list(APPEND LIBICU_SOURCES |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
36 ${LIBICU_SOURCES_DIR}/source/stubdata/stubdata.cpp |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
37 ) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
38 set_source_files_properties( |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
39 ${LIBICU_SOURCES_DIR}/source/tools/genccode/genccode.c |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
40 PROPERTIES COMPILE_DEFINITIONS "char16_t=uint16_t" |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
41 ) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
42 endif() |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
43 |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
44 |
3237 | 45 |
46 add_executable(IcuCodeGeneration | |
47 ${LIBICU_SOURCES_DIR}/source/tools/genccode/genccode.c | |
48 ${LIBICU_SOURCES} | |
49 ) | |
50 | |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
51 configure_file(${SOURCE_DATA} |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
52 ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}.dat |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
53 COPYONLY) |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
54 |
3237 | 55 add_custom_command( |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
56 OUTPUT ${CMAKE_BINARY_DIR}/${LIBICU_DATA} |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
57 COMMAND IcuCodeGeneration ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}.dat |
3237 | 58 DEPENDS IcuCodeGeneration |
59 ) | |
60 | |
3251
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
61 add_custom_command( |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
62 OUTPUT ${CMAKE_BINARY_DIR}/${LIBICU_MASM} |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
63 COMMAND IcuCodeGeneration ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}.dat --assembly masm |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
64 DEPENDS IcuCodeGeneration |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
65 ) |
3243
cf0ad1fb2bb7
trying a fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3242
diff
changeset
|
66 |
cf0ad1fb2bb7
trying a fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3242
diff
changeset
|
67 # "--no-name" is necessary for 7-zip on Windows to behave similarly to gunzip |
3237 | 68 add_custom_command( |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
69 OUTPUT ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
3243
cf0ad1fb2bb7
trying a fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3242
diff
changeset
|
70 COMMAND gzip ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat.c --no-name -c > ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
3237 | 71 DEPENDS ${LIBICU_DATA} |
72 ) | |
73 | |
3251
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
74 add_custom_command( |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
75 OUTPUT ${CMAKE_BINARY_DIR}/${LIBICU_MASM}.gz |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
76 COMMAND gzip ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat.S --no-name -c > ${CMAKE_BINARY_DIR}/${LIBICU_MASM}.gz |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
77 DEPENDS ${LIBICU_MASM} |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
78 ) |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
79 |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
80 add_custom_target(Final ALL DEPENDS |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
81 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
82 ${CMAKE_BINARY_DIR}/${LIBICU_MASM}.gz |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
83 ) |
3237 | 84 |
85 install( | |
3251
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
86 FILES |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
87 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
88 ${CMAKE_BINARY_DIR}/${LIBICU_MASM}.gz |
3237 | 89 DESTINATION ${CMAKE_SOURCE_DIR}/../../../ThirdPartyDownloads |
90 ) | |
91 | |
92 add_definitions( | |
93 #-DU_COMBINED_IMPLEMENTATION | |
94 -DUCONFIG_NO_SERVICE=1 | |
95 -DU_COMMON_IMPLEMENTATION | |
96 -DU_ENABLE_DYLOAD=0 | |
97 -DU_HAVE_STD_STRING=1 | |
98 -DU_I18N_IMPLEMENTATION | |
99 -DU_IO_IMPLEMENTATION | |
100 -DU_STATIC_IMPLEMENTATION=1 | |
101 -DU_TOOLUTIL_IMPLEMENTATION | |
102 ) |