Mercurial > hg > orthanc
annotate OrthancFramework/Resources/ThirdParty/icu/CMakeLists.txt @ 4304:50b0c69b653a
continued abi
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 06 Nov 2020 16:33:52 +0100 |
parents | 304842a0d152 |
children | d9473bd5ed43 |
rev | line source |
---|---|
4120
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
1 # Orthanc - A Lightweight, RESTful DICOM Store |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
2 # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
3 # Department, University Hospital of Liege, Belgium |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
4 # Copyright (C) 2017-2020 Osimis S.A., Belgium |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
5 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
6 # This program is free software: you can redistribute it and/or |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
7 # modify it under the terms of the GNU Lesser General Public License |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
8 # as published by the Free Software Foundation, either version 3 of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
9 # the License, or (at your option) any later version. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
10 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, but |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
12 # WITHOUT ANY WARRANTY; without even the implied warranty of |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
14 # Lesser General Public License for more details. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
15 # |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
16 # You should have received a copy of the GNU Lesser General Public |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
17 # License along with this program. If not, see |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
18 # <http://www.gnu.org/licenses/>. |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
19 |
304842a0d152
adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
4044
diff
changeset
|
20 |
3237 | 21 cmake_minimum_required(VERSION 2.8) |
22 project(IcuCodeGeneration) | |
23 | |
3241
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
24 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
|
25 |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
26 if (NOT USE_LEGACY_LIBICU) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
27 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
|
28 endif() |
3237 | 29 |
30 include(${CMAKE_SOURCE_DIR}/../../CMake/Compiler.cmake) | |
31 include(${CMAKE_SOURCE_DIR}/../../CMake/DownloadPackage.cmake) | |
32 include(Version.cmake) | |
33 | |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
34 set(SOURCE_DATA |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
35 "${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
|
36 |
3237 | 37 set(ALLOW_DOWNLOADS ON) |
38 DownloadPackage(${LIBICU_MD5} ${LIBICU_URL} "${LIBICU_SOURCES_DIR}") | |
39 | |
40 include_directories( | |
41 ${LIBICU_SOURCES_DIR}/source/common | |
42 ${LIBICU_SOURCES_DIR}/source/i18n | |
43 ${LIBICU_SOURCES_DIR}/source/tools/toolutil/ | |
44 ) | |
45 | |
46 aux_source_directory(${LIBICU_SOURCES_DIR}/source/common LIBICU_SOURCES) | |
47 aux_source_directory(${LIBICU_SOURCES_DIR}/source/i18n LIBICU_SOURCES) | |
48 aux_source_directory(${LIBICU_SOURCES_DIR}/source/tools/toolutil LIBICU_SOURCES) | |
49 | |
3241
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
50 if (USE_LEGACY_LIBICU) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
51 list(APPEND LIBICU_SOURCES |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
52 ${LIBICU_SOURCES_DIR}/source/stubdata/stubdata.c |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
53 ) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
54 else() |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
55 list(APPEND LIBICU_SOURCES |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
56 ${LIBICU_SOURCES_DIR}/source/stubdata/stubdata.cpp |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
57 ) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
58 set_source_files_properties( |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
59 ${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
|
60 PROPERTIES COMPILE_DEFINITIONS "char16_t=uint16_t" |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
61 ) |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
62 endif() |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
63 |
32596919d729
first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3237
diff
changeset
|
64 |
3237 | 65 |
66 add_executable(IcuCodeGeneration | |
67 ${LIBICU_SOURCES_DIR}/source/tools/genccode/genccode.c | |
68 ${LIBICU_SOURCES} | |
69 ) | |
70 | |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
71 configure_file(${SOURCE_DATA} |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
72 ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}.dat |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
73 COPYONLY) |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
74 |
3237 | 75 add_custom_command( |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
76 OUTPUT ${CMAKE_BINARY_DIR}/${LIBICU_DATA} |
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
77 COMMAND IcuCodeGeneration ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}.dat |
3237 | 78 DEPENDS IcuCodeGeneration |
79 ) | |
80 | |
3243
cf0ad1fb2bb7
trying a fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3242
diff
changeset
|
81 # "--no-name" is necessary for 7-zip on Windows to behave similarly to gunzip |
3237 | 82 add_custom_command( |
3242
5d78df37c62f
automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3241
diff
changeset
|
83 OUTPUT ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
3243
cf0ad1fb2bb7
trying a fix for windows
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3242
diff
changeset
|
84 COMMAND gzip ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat.c --no-name -c > ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
3237 | 85 DEPENDS ${LIBICU_DATA} |
86 ) | |
87 | |
3266
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
88 |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
89 if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux") |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
90 # Generate a precompiled version for Visual Studio 64bit |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
91 set(TMP_ASSEMBLER ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat.S) |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
92 set(TMP_OBJECT ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat-x86_64-mingw32.o) |
3269 | 93 set(TMP_LIBRARY ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat-x86_64-mingw32.lib) |
94 set(PRECOMPILED_WIN64 ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}_dat-x86_64-mingw32.lib.gz) | |
3266
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
95 |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
96 add_custom_command( |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
97 OUTPUT ${TMP_ASSEMBLER} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
98 COMMAND IcuCodeGeneration ${CMAKE_BINARY_DIR}/${LIBICU_DATA_VERSION}.dat --assembly gcc-mingw64 |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
99 DEPENDS IcuCodeGeneration |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
100 ) |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
101 |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
102 add_custom_command( |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
103 OUTPUT ${TMP_OBJECT} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
104 COMMAND x86_64-w64-mingw32-gcc -c ${TMP_ASSEMBLER} -o ${TMP_OBJECT} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
105 DEPENDS ${TMP_ASSEMBLER} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
106 ) |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
107 |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
108 add_custom_command( |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
109 OUTPUT ${TMP_LIBRARY} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
110 COMMAND x86_64-w64-mingw32-ar qc ${TMP_LIBRARY} ${TMP_OBJECT} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
111 COMMAND x86_64-w64-mingw32-ranlib ${TMP_LIBRARY} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
112 DEPENDS ${TMP_OBJECT} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
113 ) |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
114 |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
115 # "--no-name" is necessary for 7-zip on Windows to behave similarly to gunzip |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
116 add_custom_command( |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
117 OUTPUT ${PRECOMPILED_WIN64} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
118 COMMAND gzip ${TMP_LIBRARY} --no-name -c > ${PRECOMPILED_WIN64} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
119 DEPENDS ${TMP_LIBRARY} |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
120 ) |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
121 endif() |
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
122 |
3251
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
123 |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
124 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
|
125 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
3266
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
126 ${PRECOMPILED_WIN64} |
3251
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
127 ) |
3237 | 128 |
129 install( | |
3251
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
130 FILES |
fcfd4f73228c
using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3243
diff
changeset
|
131 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}.gz |
3266
25df9eae8891
fixing Visual Studio 2015 64bit with ICU
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
3252
diff
changeset
|
132 ${PRECOMPILED_WIN64} |
3237 | 133 DESTINATION ${CMAKE_SOURCE_DIR}/../../../ThirdPartyDownloads |
134 ) | |
135 | |
136 add_definitions( | |
137 #-DU_COMBINED_IMPLEMENTATION | |
138 -DUCONFIG_NO_SERVICE=1 | |
139 -DU_COMMON_IMPLEMENTATION | |
140 -DU_ENABLE_DYLOAD=0 | |
141 -DU_HAVE_STD_STRING=1 | |
142 -DU_I18N_IMPLEMENTATION | |
143 -DU_IO_IMPLEMENTATION | |
144 -DU_STATIC_IMPLEMENTATION=1 | |
145 -DU_TOOLUTIL_IMPLEMENTATION | |
146 ) |