]> git.sven.stormbind.net Git - sven/vym.git/blob - CMakeLists.txt
81102ba70591b9b74aee77ebcc2741458750318b
[sven/vym.git] / CMakeLists.txt
1 project( vym )
2 cmake_minimum_required( VERSION 2.6 )
3
4 if( NOT CMAKE_BUILD_TYPE )
5         set( CMAKE_BUILD_TYPE Debug )
6 endif( NOT CMAKE_BUILD_TYPE )
7
8 if( CMAKE_COMPILER_IS_GNUCXX )
9         add_definitions ( -Wall )
10 endif( CMAKE_COMPILER_IS_GNUCXX )
11
12 if( UNIX AND NOT APPLE )
13     set( NO_DBUS_DEFAULT OFF )
14 else( UNIX AND NOT APPLE )
15     set( NO_DBUS_DEFAULT ON )
16 endif( UNIX AND NOT APPLE )
17
18 option( NO_DBUS "Build vym without dbus support" ${NO_DBUS_DEFAULT} )
19
20 find_package ( Qt4 REQUIRED )
21 include ( ${QT_USE_FILE} )
22 add_definitions( ${QT_DEFINITIONS} )
23
24 if( WIN32 )
25         add_definitions( -DUNICODE -D_USE_MATH_DEFINES )
26         if( MSVC )
27                 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:wchar_t-" )
28         endif( MSVC )
29 endif( WIN32 )
30
31 find_package( cppcheck )
32 if(CPPCHECK_FOUND)
33         set(_cppcheck_args)
34         list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${CMAKE_SOURCE_DIR})
35 #       list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTCORE_INCLUDE_DIR})
36 #       list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTDBUS_INCLUDE_DIR})
37 #       list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTGUI_INCLUDE_DIR})
38 #       list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTNETWORK_INCLUDE_DIR})
39 #       list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTXML_INCLUDE_DIR})
40 #       list(APPEND _cppcheck_args ${CPPCHECK_INCLUDEPATH_ARG} ${QT_QTSVG_INCLUDE_DIR})
41
42         list(APPEND _cppcheck_args "enable" "all")
43         
44         add_custom_target(
45                 cppcheck
46                 COMMAND 
47                 "${CPPCHECK_EXECUTABLE}"
48                 ${CPPCHECK_TEMPLATE_ARG}
49                 ${CPPCHECK_QUIET_ARG}
50                 "--force"
51 #               "--std=c++11"
52                 ${_cppcheck_args}
53                 ${CMAKE_SOURCE_DIR}
54         )
55
56         message(STATUS "cppcheck target added.")
57 endif(CPPCHECK_FOUND)
58
59 include_directories (
60         ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
61         ${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTNETWORK_INCLUDE_DIR} ${QT_QTXML_INCLUDE_DIR} ${QT_QTSVG_INCLUDE_DIR}
62         )
63
64 if(NOT NO_DBUS )
65     include_directories( ${QT_QTDBUS_INCLUDE_DIR} )
66 endif(NOT NO_DBUS )
67
68 set ( vym_HDRS
69       aboutdialog.h
70       taskfiltermodel.h
71       animpoint.h
72       attribute.h
73       attributeitem.h
74       #   attributedelegate.h
75       #   attributedialog.h
76       #   attributewidget.h
77       branchitem.h
78       branchobj.h
79       branchpropeditor.h
80       bugagent.h
81       command.h
82       dockeditor.h
83       downloadagent.h
84       editxlinkdialog.h
85       exportoofiledialog.h
86       exporthtmldialog.h
87       exports.h
88       extrainfodialog.h
89       file.h
90       findwidget.h
91       findresultwidget.h
92       findresultitem.h
93       findresultmodel.h
94       flag.h
95       flagobj.h
96       flagrowobj.h
97       flagrow.h
98       floatimageobj.h
99       floatobj.h
100       frameobj.h
101       geometry.h
102       headingeditor.h
103       headingobj.h
104       highlighter.h
105       historywindow.h
106       imageitem.h
107       imageobj.h
108       imports.h
109       lineeditdialog.h
110       linkablemapobj.h
111       macros.h
112       mainwindow.h
113       mapeditor.h
114       mapitem.h
115       mapobj.h
116       misc.h
117       mysortfilterproxymodel.h
118       noteeditor.h
119       noteobj.h
120       options.h
121       ornamentedobj.h
122       parser.h
123       process.h
124       scripteditor.h
125       settings.h
126       shortcuts.h
127       showtextdialog.h
128       slidecontrolwidget.h
129       slideeditor.h
130       slideitem.h
131       slidemodel.h
132       task.h
133       taskeditor.h
134       taskmodel.h
135       treedelegate.h
136       treeeditor.h
137       treeitem.h
138       treemodel.h
139       texteditor.h
140       version.h
141       vymmodel.h
142       vymview.h
143       winter.h
144       warningdialog.h
145       xlink.h
146       xlinkitem.h
147       xlinkobj.h
148       xml-base.h
149       xml-vym.h
150       xml-freemind.h
151       xmlobj.h
152       xsltproc.h
153         )
154
155 set ( vym_SRCS
156       aboutdialog.cpp
157       taskfiltermodel.cpp
158       animpoint.cpp
159       attribute.cpp
160       attributeitem.cpp
161       #   attributedelegate.cpp
162       #   attributedialog.cpp
163       #   attributewidget.cpp
164       branchitem.cpp
165       branchobj.cpp
166       branchpropeditor.cpp
167       bugagent.cpp
168       command.cpp
169       dockeditor.cpp
170       downloadagent.cpp
171       editxlinkdialog.cpp
172       exportoofiledialog.cpp
173       exports.cpp
174       exporthtmldialog.cpp
175       extrainfodialog.cpp
176       file.cpp
177       findwidget.cpp
178       findresultwidget.cpp
179       findresultitem.cpp
180       findresultmodel.cpp
181       flag.cpp
182       flagobj.cpp
183       flagrow.cpp
184       flagrowobj.cpp
185       floatimageobj.cpp
186       floatobj.cpp
187       frameobj.cpp
188       geometry.cpp
189       headingeditor.cpp
190       headingobj.cpp
191       highlighter.cpp
192       historywindow.cpp
193       imageitem.cpp
194       imageobj.cpp
195       imports.cpp
196       lineeditdialog.cpp
197       linkablemapobj.cpp
198       macros.cpp
199       main.cpp
200       mainwindow.cpp
201       mapeditor.cpp
202       mapitem.cpp
203       mapobj.cpp
204       misc.cpp
205       mysortfilterproxymodel.cpp
206       noteeditor.cpp
207       noteobj.cpp
208       options.cpp
209       ornamentedobj.cpp
210       parser.cpp
211       process.cpp
212       scripteditor.cpp
213       settings.cpp
214       shortcuts.cpp
215       showtextdialog.cpp
216       slidecontrolwidget.cpp
217       slideeditor.cpp
218       slideitem.cpp
219       slidemodel.cpp
220       task.cpp
221       taskeditor.cpp
222       taskmodel.cpp
223       texteditor.cpp
224       treedelegate.cpp
225       treeeditor.cpp
226       treeitem.cpp
227       treemodel.cpp
228       version.cpp
229       vymmodel.cpp
230       vymview.cpp
231       winter.cpp
232       warningdialog.cpp
233       xlink.cpp
234       xlinkitem.cpp
235       xlinkobj.cpp
236       xml-base.cpp
237       xml-vym.cpp
238       xml-freemind.cpp
239       xmlobj.cpp
240       xsltproc.cpp
241         )
242
243 set ( vym_UIS
244       attributewidget.ui
245       branchpropeditor.ui
246       exporthtmldialog.ui
247       extrainfodialog.ui
248       editxlinkdialog.ui
249       historywindow.ui
250       lineeditdialog.ui
251       scripteditor.ui
252       showtextdialog.ui
253       warningdialog.ui
254         )
255 QT4_WRAP_UI(UIS ${vym_UIS})
256
257 set ( vym_TRS
258         lang/vym_de_DE.ts
259         lang/vym_en.ts
260         lang/vym_es.ts
261         lang/vym_fr.ts
262         lang/vym_it.ts
263         lang/vym_pt_BR.ts
264         lang/vym_ru.ts
265         lang/vym_sv.ts
266         lang/vym_zh_CN.ts
267         lang/vym_zh_TW.ts
268         lang/vym_cs_CZ.ts
269         )
270 QT4_ADD_TRANSLATION(TRS ${vym_TRS})
271
272 set ( vym_MOCS
273       aboutdialog.h
274       branchpropeditor.h
275       bugagent.h
276       dockeditor.h
277       downloadagent.h
278       editxlinkdialog.h
279       exportoofiledialog.h
280       exporthtmldialog.h
281       extrainfodialog.h
282       findwidget.h
283       findresultwidget.h
284       findresultmodel.h
285       headingeditor.h
286       highlighter.h
287       historywindow.h
288       lineeditdialog.h
289       mainwindow.h
290       mapeditor.h
291       mysortfilterproxymodel.h
292       noteeditor.h
293       process.h
294       scripteditor.h
295       showtextdialog.h
296       slidecontrolwidget.h
297       slideeditor.h
298       slidemodel.h
299       taskeditor.h
300       taskmodel.h
301       treedelegate.h
302       treeeditor.h
303       treemodel.h
304       texteditor.h
305       vymmodel.h
306       vymview.h
307       winter.h
308       warningdialog.h
309         )
310 if( NOT NO_DBUS )
311     add_definitions(-DVYM_DBUS)
312     list(APPEND vym_HDRS adaptormodel.h adaptorvym.h)
313     list(APPEND vym_SRCS adaptormodel.cpp adaptorvym.cpp)
314     list(APPEND vym_MOCS adaptormodel.h adaptorvym.h)
315 endif( NOT NO_DBUS )
316 QT4_WRAP_CPP(MOCS ${vym_MOCS})
317
318
319
320 if( WIN32 )
321         set( vym_SRCS ${vym_SRCS} mkdtemp.cpp vym.rc )
322 endif( WIN32 )
323
324 add_executable ( vym WIN32 ${vym_SRCS} ${UIS} ${RSCS} ${TRS} ${MOCS} )
325 target_link_libraries ( vym  ${QT_QTMAIN_LIBRARY} ${QT_QTCORE_LIBRARY} ${QT_QTGUI_LIBRARY} ${QT_QTNETWORK_LIBRARY} ${QT_QTXML_LIBRARY} ${QT_QTSVG_LIBRARY} )
326 if( NOT NO_DBUS )
327     target_link_libraries( vym ${QT_QTDBUS_LIBRARY} )
328 endif( NOT NO_DBUS )
329
330 install( TARGETS vym RUNTIME DESTINATION bin )
331
332 set( _installfolders demos exports flags icons macros scripts styles )
333 install( DIRECTORY ${_installfolders} DESTINATION share/vym )
334 install( FILES ${TRS} DESTINATION share/vym/lang )