-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
334 lines (311 loc) · 7.44 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
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
project( vym )
cmake_minimum_required( VERSION 2.6 )
if( NOT CMAKE_BUILD_TYPE )
set( CMAKE_BUILD_TYPE Debug )
endif( NOT CMAKE_BUILD_TYPE )
if( CMAKE_COMPILER_IS_GNUCXX )
add_definitions ( -Wall )
endif( CMAKE_COMPILER_IS_GNUCXX )
if( UNIX AND NOT APPLE )
set( NO_DBUS_DEFAULT OFF )
else( UNIX AND NOT APPLE )
set( NO_DBUS_DEFAULT ON )
endif( UNIX AND NOT APPLE )
option( NO_DBUS "Build vym without dbus support" ${NO_DBUS_DEFAULT} )
find_package ( Qt5 REQUIRED )
include ( ${QT_USE_FILE} )
add_definitions( ${QT_DEFINITIONS} )
if( WIN32 )
add_definitions( -DUNICODE -D_USE_MATH_DEFINES )
if( MSVC )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-" )
endif( MSVC )
endif( WIN32 )
find_package( cppcheck )
if(CPPCHECK_FOUND)
set(_cppcheck_args)
list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${CMAKE_SOURCE_DIR})
# list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTCORE_INCLUDE_DIR})
# list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTDBUS_INCLUDE_DIR})
# list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTGUI_INCLUDE_DIR})
# list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTNETWORK_INCLUDE_DIR})
# list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTXML_INCLUDE_DIR})
# list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTSVG_INCLUDE_DIR})
list(APPEND _cppcheck_args "enable" "all")
add_custom_target(
cppcheck
COMMAND
"${CPPCHECK_EXECUTABLE}"
${CPPCHECK_TEMPLATE_ARG}
${CPPCHECK_QUIET_ARG}
"--force"
# "--std=c++11"
${_cppcheck_args}
${CMAKE_SOURCE_DIR}
)
message(STATUS "cppcheck target added.")
endif(CPPCHECK_FOUND)
include_directories (
${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTNETWORK_INCLUDE_DIR} ${QT_QTXML_INCLUDE_DIR} ${QT_QTSVG_INCLUDE_DIR}
)
if(NOT NO_DBUS )
include_directories( ${QT_QTDBUS_INCLUDE_DIR} )
endif(NOT NO_DBUS )
set ( vym_HDRS
aboutdialog.h
taskfiltermodel.h
animpoint.h
attribute.h
attributeitem.h
# attributedelegate.h
# attributedialog.h
# attributewidget.h
branchitem.h
branchobj.h
branchpropeditor.h
bugagent.h
command.h
dockeditor.h
downloadagent.h
editxlinkdialog.h
exportoofiledialog.h
exporthtmldialog.h
exports.h
extrainfodialog.h
file.h
findwidget.h
findresultwidget.h
findresultitem.h
findresultmodel.h
flag.h
flagobj.h
flagrowobj.h
flagrow.h
floatimageobj.h
floatobj.h
frameobj.h
geometry.h
headingeditor.h
headingobj.h
highlighter.h
historywindow.h
imageitem.h
imageobj.h
imports.h
lineeditdialog.h
linkablemapobj.h
macros.h
mainwindow.h
mapeditor.h
mapitem.h
mapobj.h
misc.h
mysortfilterproxymodel.h
noteeditor.h
noteobj.h
options.h
ornamentedobj.h
parser.h
process.h
scripteditor.h
settings.h
shortcuts.h
showtextdialog.h
slidecontrolwidget.h
slideeditor.h
slideitem.h
slidemodel.h
task.h
taskeditor.h
taskmodel.h
treedelegate.h
treeeditor.h
treeitem.h
treemodel.h
texteditor.h
version.h
vymmodel.h
vymview.h
winter.h
warningdialog.h
xlink.h
xlinkitem.h
xlinkobj.h
xml-base.h
xml-vym.h
xml-freemind.h
xmlobj.h
xsltproc.h
)
set ( vym_SRCS
aboutdialog.cpp
taskfiltermodel.cpp
animpoint.cpp
attribute.cpp
attributeitem.cpp
# attributedelegate.cpp
# attributedialog.cpp
# attributewidget.cpp
branchitem.cpp
branchobj.cpp
branchpropeditor.cpp
bugagent.cpp
command.cpp
dockeditor.cpp
downloadagent.cpp
editxlinkdialog.cpp
exportoofiledialog.cpp
exports.cpp
exporthtmldialog.cpp
extrainfodialog.cpp
file.cpp
findwidget.cpp
findresultwidget.cpp
findresultitem.cpp
findresultmodel.cpp
flag.cpp
flagobj.cpp
flagrow.cpp
flagrowobj.cpp
floatimageobj.cpp
floatobj.cpp
frameobj.cpp
geometry.cpp
headingeditor.cpp
headingobj.cpp
highlighter.cpp
historywindow.cpp
imageitem.cpp
imageobj.cpp
imports.cpp
lineeditdialog.cpp
linkablemapobj.cpp
macros.cpp
main.cpp
mainwindow.cpp
mapeditor.cpp
mapitem.cpp
mapobj.cpp
misc.cpp
mysortfilterproxymodel.cpp
noteeditor.cpp
noteobj.cpp
options.cpp
ornamentedobj.cpp
parser.cpp
process.cpp
scripteditor.cpp
settings.cpp
shortcuts.cpp
showtextdialog.cpp
slidecontrolwidget.cpp
slideeditor.cpp
slideitem.cpp
slidemodel.cpp
task.cpp
taskeditor.cpp
taskmodel.cpp
texteditor.cpp
treedelegate.cpp
treeeditor.cpp
treeitem.cpp
treemodel.cpp
version.cpp
vymmodel.cpp
vymview.cpp
winter.cpp
warningdialog.cpp
xlink.cpp
xlinkitem.cpp
xlinkobj.cpp
xml-base.cpp
xml-vym.cpp
xml-freemind.cpp
xmlobj.cpp
xsltproc.cpp
)
set ( vym_UIS
attributewidget.ui
branchpropeditor.ui
exporthtmldialog.ui
extrainfodialog.ui
editxlinkdialog.ui
historywindow.ui
lineeditdialog.ui
scripteditor.ui
showtextdialog.ui
warningdialog.ui
)
QT4_WRAP_UI(UIS ${vym_UIS})
set ( vym_TRS
lang/vym_de_DE.ts
lang/vym_en.ts
lang/vym_es.ts
lang/vym_fr.ts
lang/vym_it.ts
lang/vym_pt_BR.ts
lang/vym_ru.ts
lang/vym_sv.ts
lang/vym_zh_CN.ts
lang/vym_zh_TW.ts
lang/vym_cs_CZ.ts
)
QT4_ADD_TRANSLATION(TRS ${vym_TRS})
set ( vym_MOCS
aboutdialog.h
branchpropeditor.h
bugagent.h
dockeditor.h
downloadagent.h
editxlinkdialog.h
exportoofiledialog.h
exporthtmldialog.h
extrainfodialog.h
findwidget.h
findresultwidget.h
findresultmodel.h
headingeditor.h
highlighter.h
historywindow.h
lineeditdialog.h
mainwindow.h
mapeditor.h
mysortfilterproxymodel.h
noteeditor.h
process.h
scripteditor.h
showtextdialog.h
slidecontrolwidget.h
slideeditor.h
slidemodel.h
taskeditor.h
taskmodel.h
treedelegate.h
treeeditor.h
treemodel.h
texteditor.h
vymmodel.h
vymview.h
winter.h
warningdialog.h
)
if( NOT NO_DBUS )
add_definitions(-DVYM_DBUS)
list(APPEND vym_HDRS adaptormodel.h adaptorvym.h)
list(APPEND vym_SRCS adaptormodel.cpp adaptorvym.cpp)
list(APPEND vym_MOCS adaptormodel.h adaptorvym.h)
endif( NOT NO_DBUS )
QT4_WRAP_CPP(MOCS ${vym_MOCS})
if( WIN32 )
set( vym_SRCS ${vym_SRCS} mkdtemp.cpp vym.rc )
endif( WIN32 )
add_executable ( vym WIN32 ${vym_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS} )
target_link_libraries ( vym ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY} )
if( NOT NO_DBUS )
target_link_libraries( vym ${QT_QTDBUS_LIBRARY} )
endif( NOT NO_DBUS )
install( TARGETS vym RUNTIME DESTINATION bin )
set( _installfolders demos exports flags icons macros scripts styles )
install( DIRECTORY ${_installfolders} DESTINATION share/vym )
install( FILES ${TRS} DESTINATION share/vym/lang )