-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
269 lines (229 loc) · 6.86 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
# CMake file
cmake_minimum_required(VERSION "3.13.4")
set (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
# Define project data
set (APPLICATION_VENDOR_NAME "seekone")
set (APPLICATION_VENDOR_DOMAIN "www.seek-one.fr")
set (APPLICATION_NAME "soapero")
set (APPLICATION_VERSION_MAJOR 1)
set (APPLICATION_VERSION_MINOR 0)
set (APPLICATION_VERSION_PATCH 0)
if(NOT DEFINED APPLICATION_VERSION_BUILD)
set(APPLICATION_VERSION_BUILD "")
endif()
if(CMAKE_BUILD_TYPE MATCHES Debug)
set(APPLICATION_VERSION_BUILD ${APPLICATION_VERSION_BUILD}dbg)
endif()
set (APPLICATION_VERSION ${APPLICATION_VERSION_MAJOR}.${APPLICATION_VERSION_MINOR}.${APPLICATION_VERSION_PATCH}${APPLICATION_VERSION_BUILD})
set (APPLICATION_CONTACTMAIL "[email protected]")
set (APPLICATION_CONTACT "Contact Seek-One <${APPLICATION_CONTACTMAIL}>")
set (APPLICATION_PACKAGE_VENDOR "seekone")
set (APPLICATION_PACKAGE_NAME "soapero")
set (APPLICATION_EXE_NAME soapero)
project (soapero CXX C)
set (CMAKE_VERBOSE_MAKEFILE OFF)
##############################
# Project configuration
##############################
# Define common project config
include (CMakeModules/ProjectCommonConfig.cmake)
##################
# Define options
##################
include (CMakeModules/ProjectCompilerChecks.cmake)
####################
# Library checking
####################
# Compiler
set(WITH_COMPILER_LIBRARIES ON CACHE BOOL "Enable build with compiler libraries")
# GUI
set(WITH_QT ON CACHE BOOL "Enable build with qt library")
set(QT4_COMPONENTS QtCore QtNetwork QtXml)
set(QT5_COMPONENTS Core Network Xml)
set(QT6_COMPONENTS Core Network Xml)
# Define output variable
set (PACKAGE_DEPS)
if(WITH_AUTONOMOUS_PACKAGE_BUILD)
set(AUTONOMOUS_PACKAGE_BUILD ON CACHE BOOL "Enable build of autonomous package without dependencies")
endif()
list(APPEND PACKAGE_DEPS "consolekit")
include (CMakeModules/ProjectIncludeLibraries.cmake)
####################
# Config file
####################
# Configure a header file to pass some of the CMake settings
# to the source code
configure_file (
"${PROJECT_SOURCE_DIR}/config.h.in"
"${PROJECT_BINARY_DIR}/config.h"
)
add_definitions(-DHAVE_CONFIG_H)
configure_file (
"${PROJECT_SOURCE_DIR}/version.h.in"
"${PROJECT_BINARY_DIR}/version.h"
)
add_definitions(-DHAVE_VERSION_H)
include_directories (${PROJECT_BINARY_DIR})
####################
# Add sources
####################
include_directories (${PROJECT_SOURCE_DIR}/src)
# src directory
set(APPLICATION_SOURCES
resources/Base/xs/types/AnySimpleType.cpp
resources/Base/xs/types/AnySimpleType.h
resources/Base/xs/types/AnyType.cpp
resources/Base/xs/types/AnyType.h
resources/Base/xs/types/AnyURI.cpp
resources/Base/xs/types/AnyURI.h
resources/Base/xs/types/Base64Binary.cpp
resources/Base/xs/types/Base64Binary.h
resources/Base/xs/types/Boolean.cpp
resources/Base/xs/types/Boolean.h
resources/Base/xs/types/DateTime.cpp
resources/Base/xs/types/DateTime.h
resources/Base/xs/types/Double.cpp
resources/Base/xs/types/Double.h
resources/Base/xs/types/Duration.cpp
resources/Base/xs/types/Duration.h
resources/Base/xs/types/Float.cpp
resources/Base/xs/types/Float.h
resources/Base/xs/types/HexBinary.cpp
resources/Base/xs/types/HexBinary.h
resources/Base/xs/types/Integer.cpp
resources/Base/xs/types/Integer.h
resources/Base/xs/types/NCName.cpp
resources/Base/xs/types/NCName.h
resources/Base/xs/types/NonNegativeInteger.cpp
resources/Base/xs/types/NonNegativeInteger.h
resources/Base/xs/types/QName.cpp
resources/Base/xs/types/QName.h
resources/Base/xs/types/String.cpp
resources/Base/xs/types/String.h
resources/Base/xs/types/Token.cpp
resources/Base/xs/types/Token.h
resources/Base/xs/types/UnsignedInteger.cpp
resources/Base/xs/types/UnsignedInteger.h
resources/Base/xs/types/UnsignedLong.cpp
resources/Base/xs/types/UnsignedLong.h
resources/Service/Service.h
resources/Service/Service.cpp
src/Builder/FileBuilder.cpp
src/Builder/FileBuilder.h
src/Builder/FileHelper.cpp
src/Builder/FileHelper.h
src/Builder/TypeListBuilder.cpp
src/Builder/TypeListBuilder.h
src/Model/Classname.h
src/Model/Classname.cpp
src/Model/ComplexType.h
src/Model/ComplexType.cpp
src/Model/Message.h
src/Model/Message.cpp
src/Model/Operation.h
src/Model/Operation.cpp
src/Model/RequestResponseElement.h
src/Model/RequestResponseElement.cpp
src/Model/Service.h
src/Model/Service.cpp
src/Model/SimpleType.h
src/Model/SimpleType.cpp
src/Model/Type.h
src/Model/Type.cpp
src/Model/TypeRef.h
src/Model/TypeRef.cpp
src/Parser/QWSDLData.h
src/Parser/QWSDLData.cpp
src/Parser/QWSDLParser.h
src/Parser/QWSDLParser.cpp
src/Parser/WSDLAttributes.h
src/Parser/WSDLSections.h
src/Utils/ModelUtils.h
src/Utils/ModelUtils.cpp
src/Utils/StringUtils.h
src/Utils/UniqueStringList.cpp
src/Utils/UniqueStringList.h
)
# Creating MOC file for sources file using "slots" or Q_OBJECT macro
set(APPLICATION_MOC_HEADERS
)
qtx_wrap_cpp(
APPLICATION_MOC_OUTFILES
${APPLICATION_MOC_HEADERS}
)
####################
# i18n
####################
set (I18N_FILES
src/main.cpp
)
set (TS_FILES
ts/fr.ts
)
option (UPDATE_TRANSLATIONS "Update source translation ts/*.ts files (WARNING: make clean will delete the source .ts files! Danger!)" ON)
if (UPDATE_TRANSLATIONS)
qtx_create_translation(qm_FILES ${TS_FILES} ${I18N_FILES})
else (UPDATE_TRANSLATIONS)
qtx_add_translation(qm_FILES ${TS_FILES})
endif (UPDATE_TRANSLATIONS)
add_custom_target(update_ts ALL DEPENDS ${qm_FILES})
####################
# Resource files
####################
# Configure translation file
configure_file (
"${PROJECT_SOURCE_DIR}/ts.qrc.in"
"${PROJECT_BINARY_DIR}/ts.qrc"
)
# Resources
set (QRC_TS_FILES
${PROJECT_BINARY_DIR}/ts.qrc
)
qtx_add_resources(RCS_OUTFILES ${QRC_FILES})
qtx_add_resources(RCS_TS_OUTFILES ${QRC_TS_FILES})
####################
# Create Executable
####################
set (SOAPERO_MAIN_SRC
src/main.cpp
)
# Build executable
add_executable (${APPLICATION_EXE_NAME}
${GUI_TYPE}
${RC_FILES}
${SOAPERO_MAIN_SRC}
${APPLICATION_SOURCES}
${APPLICATION_MOC_OUTFILES}
${RCS_OUTFILES}
${RCS_TS_OUTFILES}
${qm_FILES}
)
target_link_libraries (${APPLICATION_EXE_NAME}
${QT_LIBRARIES}
${QT_QTMAIN_LIBRARY}
)
install(TARGETS ${APPLICATION_EXE_NAME} DESTINATION ${INSTALL_PATH_BIN})
############################
# Common files installation
############################
# Documentation file
set(DOCFILES_EXT "")
if(WIN32)
set(DOCFILES_EXT ".txt")
endif(WIN32)
# README file
configure_file (
"${PROJECT_SOURCE_DIR}/README.md"
"${PROJECT_BINARY_DIR}/README${DOCFILES_EXT}"
NEWLINE_STYLE ${AUTO_NEWLINE_STYLE}
)
install(FILES "${PROJECT_BINARY_DIR}/README${DOCFILES_EXT}" DESTINATION ${INSTALL_PATH_DOC})
# COPYING file
configure_file (
"${PROJECT_SOURCE_DIR}/COPYING"
"${PROJECT_BINARY_DIR}/COPYING${DOCFILES_EXT}"
NEWLINE_STYLE ${AUTO_NEWLINE_STYLE}
)
# ChangeLog file
set(CHANGELOG "ChangeLog")
install(FILES "${PROJECT_SOURCE_DIR}/${CHANGELOG}" DESTINATION ${INSTALL_PATH_DOC} RENAME ChangeLog${DOCFILES_EXT})