annotate OrthancFramework/Resources/CMake/LibIcuConfiguration.cmake @ 5853:4d932683049d get-scu tip

very first implementation of C-Get SCU
author Alain Mazy <am@orthanc.team>
date Tue, 29 Oct 2024 17:25:49 +0100
parents f7adfb22e20e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
5640
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
4 # Copyright (C) 2017-2023 Osimis S.A., Belgium
f7adfb22e20e updated copyright, as Orthanc Team now replaces Osimis
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5485
diff changeset
5 # Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
5485
48b8dae6dc77 upgrade to year 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 5185
diff changeset
6 # Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
4120
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
7 #
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
8 # 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
9 # 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
10 # 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
11 # the License, or (at your option) any later version.
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
12 #
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
13 # 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
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
15 # 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
16 # Lesser General Public License for more details.
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
17 #
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
18 # 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
19 # License along with this program. If not, see
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
20 # <http://www.gnu.org/licenses/>.
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
21
304842a0d152 adding missing license headers
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 4044
diff changeset
22
3242
5d78df37c62f automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3241
diff changeset
23
5d78df37c62f automating compilation if icu is used
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3241
diff changeset
24 # Check out: ../ThirdParty/icu/README.txt
3231
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
25
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
26 # http://userguide.icu-project.org/packaging
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
27 # http://userguide.icu-project.org/howtouseicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3230
diff changeset
28
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29 message("Using libicu")
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 if (STATIC_BUILD OR NOT USE_SYSTEM_LIBICU)
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
32 include(${CMAKE_CURRENT_LIST_DIR}/../ThirdParty/icu/Version.cmake)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
33 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
34
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
35 # Use the gzip-compressed data
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
36 DownloadFile(${LIBICU_DATA_COMPRESSED_MD5} ${LIBICU_DATA_URL})
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
37 set(LIBICU_RESOURCES
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
38 LIBICU_DATA ${CMAKE_SOURCE_DIR}/ThirdPartyDownloads/${LIBICU_DATA}
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
39 )
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
40
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
41 set_source_files_properties(
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
42 ${CMAKE_BINARY_DIR}/${LIBICU_DATA}
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
43 PROPERTIES COMPILE_DEFINITIONS "char16_t=uint16_t"
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
44 )
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
45
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
46 include_directories(BEFORE
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
47 ${LIBICU_SOURCES_DIR}/source/common
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
48 ${LIBICU_SOURCES_DIR}/source/i18n
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
49 )
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
50
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
51 aux_source_directory(${LIBICU_SOURCES_DIR}/source/common LIBICU_SOURCES)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
52 aux_source_directory(${LIBICU_SOURCES_DIR}/source/i18n LIBICU_SOURCES)
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
53
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
54 add_definitions(
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
55 #-DU_COMBINED_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
56 #-DU_DEF_ICUDATA_ENTRY_POINT=icudt63l_dat
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
57 #-DU_LIB_SUFFIX_C_NAME=l
3241
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
58
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
59 #-DUCONFIG_NO_SERVICE=1
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
60 -DU_COMMON_IMPLEMENTATION
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
61 -DU_STATIC_IMPLEMENTATION
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
62 -DU_ENABLE_DYLOAD=0
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
63 -DU_HAVE_STD_STRING=1
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
64 -DU_I18N_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
65 -DU_IO_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
66 -DU_STATIC_IMPLEMENTATION=1
3241
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
67 #-DU_CHARSET_IS_UTF8
32596919d729 first compilation combining ICU and LSB
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3237
diff changeset
68 -DUNISTR_FROM_STRING_EXPLICIT=
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
69
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
70 -DORTHANC_STATIC_ICU=1
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
71 -DORTHANC_ICU_DATA_MD5="${LIBICU_DATA_UNCOMPRESSED_MD5}"
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3231
diff changeset
72 )
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73
3251
fcfd4f73228c using masm if compiling icu with Visual Studio
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3245
diff changeset
74 if (CMAKE_SYSTEM_NAME STREQUAL "Windows")
3244
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
75 set_source_files_properties(
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
76 ${LIBICU_SOURCES_DIR}/source/common/locmap.c
3245
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3244
diff changeset
77 PROPERTIES COMPILE_DEFINITIONS "LOCALE_SNAME=0x0000005c"
3244
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
78 )
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
79 endif()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
80
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
81 source_group(ThirdParty\\libicu REGULAR_EXPRESSION ${LIBICU_SOURCES_DIR}/.*)
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3242
diff changeset
82
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 else()
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84 CHECK_INCLUDE_FILE_CXX(unicode/uvernum.h HAVE_ICU_H)
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 if (NOT HAVE_ICU_H)
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 message(FATAL_ERROR "Please install the libicu-dev package")
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 endif()
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88
3230
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
89 find_library(LIBICU_PATH_1 NAMES icuuc)
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
90 find_library(LIBICU_PATH_2 NAMES icui18n)
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
91
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
92 if (NOT LIBICU_PATH_1 OR
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
93 NOT LIBICU_PATH_2)
4b042ec734c1 dynamic linking against libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3228
diff changeset
94 message(FATAL_ERROR "Please install the libicu-dev package")
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 else()
3488
48231cfd2693 try and fix dynamic linking against libicu on openSUSE
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3333
diff changeset
96 link_libraries(${LIBICU_PATH_1} ${LIBICU_PATH_2})
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 endif()
3333
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
98
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
99 add_definitions(
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
100 -DORTHANC_STATIC_ICU=0
2a38e00a0638 Size of the Orthanc static binaries are reduced by compressing ICU data
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 3270
diff changeset
101 )
3228
4b9cfd92d1ae preparing for libicu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 endif()