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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3237
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 cmake_minimum_required(VERSION 2.8)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 project(IcuCodeGeneration)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 include(${CMAKE_SOURCE_DIR}/../../CMake/Compiler.cmake)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 include(${CMAKE_SOURCE_DIR}/../../CMake/DownloadPackage.cmake)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 include(Version.cmake)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
17 set(ALLOW_DOWNLOADS ON)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 DownloadPackage(${LIBICU_MD5} ${LIBICU_URL} "${LIBICU_SOURCES_DIR}")
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 include_directories(
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21 ${LIBICU_SOURCES_DIR}/source/common
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 ${LIBICU_SOURCES_DIR}/source/i18n
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 ${LIBICU_SOURCES_DIR}/source/tools/toolutil/
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24 )
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 aux_source_directory(${LIBICU_SOURCES_DIR}/source/common LIBICU_SOURCES)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27 aux_source_directory(${LIBICU_SOURCES_DIR}/source/i18n LIBICU_SOURCES)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
28 aux_source_directory(${LIBICU_SOURCES_DIR}/source/tools/toolutil LIBICU_SOURCES)
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 add_executable(IcuCodeGeneration
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 ${LIBICU_SOURCES_DIR}/source/tools/genccode/genccode.c
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 ${LIBICU_SOURCES}
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 )
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 DEPENDS IcuCodeGeneration
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 )
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 DEPENDS ${LIBICU_DATA}
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 )
ed6dc4ecabcb continuing with icu
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: 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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
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
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 DESTINATION ${CMAKE_SOURCE_DIR}/../../../ThirdPartyDownloads
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 )
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 add_definitions(
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93 #-DU_COMBINED_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94 -DUCONFIG_NO_SERVICE=1
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 -DU_COMMON_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96 -DU_ENABLE_DYLOAD=0
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
97 -DU_HAVE_STD_STRING=1
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
98 -DU_I18N_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
99 -DU_IO_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
100 -DU_STATIC_IMPLEMENTATION=1
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
101 -DU_TOOLUTIL_IMPLEMENTATION
ed6dc4ecabcb continuing with icu
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 )