CMakeLists.txt 13.7 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
add_definitions(-DTRANSLATION_DOMAIN=\"kmail\")

3
4
5
6
qt5_generate_dbus_interface(kmkernel.h org.kde.kmail.kmail.xml OPTIONS -a)
qt5_generate_dbus_interface(editor/kmcomposerwin.h org.kde.kmail.mailcomposer.xml OPTIONS -a)

add_custom_target(kmail_xml ALL
Laurent Montel's avatar
Laurent Montel committed
7
8
    DEPENDS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml
    DEPENDS ${kmail_BINARY_DIR}/src/org.kde.kmail.mailcomposer.xml
9
10
11
12
13
14
15
16
17
18
19
    COMMENT "Helper target for XML stuff. The Kontact plugin, KOrganizer and others depend on it."
    )

include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}
    ${GPGME_INCLUDES}
    ${AKONADI_INCLUDE_DIR}
    )



20
21
22
23
if (TARGET KUserFeedbackWidgets)
    add_definitions(-DWITH_KUSERFEEDBACK)
    # TODO add KUserFeedbackWidgets to lib
endif()
24
25
26
27

add_subdirectory(pics)
add_subdirectory(icons)
add_subdirectory(kconf_update)
Laurent Montel's avatar
Laurent Montel committed
28
add_subdirectory(kontactplugin)
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

########### kmailprivate ###############


set(kmailprivate_attributes_LIB_SRCS
    attributes/taskattribute.cpp
    )

set(kmailprivate_folderarchive_LIB_SRCS
    folderarchive/folderarchiveaccountinfo.cpp
    folderarchive/folderarchiveutil.cpp
    folderarchive/folderarchivecache.cpp
    folderarchive/folderarchiveagentcheckcollection.cpp
    folderarchive/folderarchivemanager.cpp
    folderarchive/folderarchiveagentjob.cpp
    )
set(kmailprivate_collectionpage_LIB_SRCS
    collectionpage/collectiontemplatespage.cpp
    collectionpage/collectionviewpage.cpp
    collectionpage/collectionquotapage.cpp
    collectionpage/collectionquotawidget.cpp
    collectionpage/collectionmailinglistpage.cpp
    collectionpage/collectionshortcutpage.cpp
    )
set(kmailprivate_configuredialog_LIB_SRCS
    configuredialog/configagentdelegate.cpp
    configuredialog/configuredialoglistview.cpp
    configuredialog/configuredialog.cpp
    configuredialog/configuredialog_p.cpp
    configuredialog/configuremiscpage.cpp
    configuredialog/configuresecuritypage.cpp
    configuredialog/configurecomposerpage.cpp
    configuredialog/configureappearancepage.cpp
    configuredialog/configureaccountpage.cpp
63
    configuredialog/configurepluginpage.cpp
64
65
66
    configuredialog/colorlistbox.cpp
    )

67
68
69
70
set(kmailprivate_configureplugins_LIB_SRCS
    configuredialog/configureplugins/configurepluginslistwidget.cpp
    )

71
72
73
74
75
76
set(kmailprivate_searchdialog_LIB_SRCS
    searchdialog/kmsearchmessagemodel.cpp
    searchdialog/searchpatternwarning.cpp
    searchdialog/kmailsearchpatternedit.cpp
    searchdialog/searchwindow.cpp
    searchdialog/searchdescriptionattribute.cpp
Laurent Montel's avatar
Laurent Montel committed
77
    searchdialog/incompleteindexdialog.cpp
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
    )
set(kmailprivate_identity_LIB_SRCS
    identity/identitylistview.cpp
    identity/identitydialog.cpp
    identity/xfaceconfigurator.cpp
    identity/identitypage.cpp
    identity/newidentitydialog.cpp
    identity/identityeditvcarddialog.cpp
    identity/identityaddvcarddialog.cpp
    identity/identityinvalidfolder.cpp
    identity/identityfolderrequester.cpp
    )
set(kmailprivate_editor_LIB_SRCS
    editor/kmcomposereditorng.cpp
    editor/composer.cpp
    editor/codec/codecaction.cpp
    editor/codec/codecmanager.cpp
    editor/kmcomposerwin.cpp
    editor/attachment/attachmentcontroller.cpp
    editor/attachment/attachmentview.cpp
    editor/widgets/cryptostateindicatorwidget.cpp
    editor/validatesendmailshortcut.cpp
    editor/kmcomposerglobalaction.cpp
Laurent Montel's avatar
Laurent Montel committed
101
102
    editor/kmcomposerupdatetemplatejob.cpp
    editor/kmcomposercreatenewcomposerjob.cpp
103
104
105
    )

set(kmailprivate_warningwidgets_LIB_SRCS
106
107
108
    editor/warningwidgets/externaleditorwarning.cpp
    editor/warningwidgets/attachmentmissingwarning.cpp
    editor/warningwidgets/incorrectidentityfolderwarning.cpp
109
    )
110

111
112
113
114
115
116
117
118
119
120
set(kmailprivate_editor_potentialphishingemail_SRCS
    editor/potentialphishingemail/potentialphishingemailwarning.cpp
    editor/potentialphishingemail/potentialphishingemailjob.cpp
    editor/potentialphishingemail/potentialphishingdetaildialog.cpp
    editor/potentialphishingemail/potentialphishingdetailwidget.cpp
    )
set(kmailprivate_dialogs_LIB_SRCS
    dialog/archivefolderdialog.cpp
    dialog/addemailtoexistingcontactdialog.cpp
    dialog/kmknotify.cpp
121
    dialog/spellcheckerconfigdialog.cpp
122
123
124
125
126
127
128
129
130
131
132
133
134
    )
set(kmailprivate_job_LIB_SRCS
    job/addressvalidationjob.cpp
    job/createnewcontactjob.cpp
    job/addemailtoexistingcontactjob.cpp
    job/createtaskjob.cpp
    job/savedraftjob.cpp
    job/removeduplicatemailjob.cpp
    job/createfollowupreminderonexistingmessagejob.cpp
    job/removecollectionjob.cpp
    job/saveasfilejob.cpp
    job/markallmessagesasreadinfolderandsubfolderjob.cpp
    job/removeduplicatemessageinfolderandsubfolderjob.cpp
135
    job/handleclickedurljob.cpp
136
    job/composenewmessagejob.cpp
Laurent Montel's avatar
Laurent Montel committed
137
    job/opencomposerjob.cpp
Laurent Montel's avatar
Laurent Montel committed
138
    job/newmessagejob.cpp
Laurent Montel's avatar
Laurent Montel committed
139
    job/opencomposerhiddenjob.cpp
140
    job/fillcomposerjob.cpp
Laurent Montel's avatar
Laurent Montel committed
141
    job/createreplymessagejob.cpp
142
    job/createforwardmessagejob.cpp
Laurent Montel's avatar
Laurent Montel committed
143
    job/dndfromarkjob.cpp
144
145
146
147
148
149
150
151
    )

set(kmailprivate_widgets_LIB_SRCS
    widgets/collectionpane.cpp
    widgets/vacationscriptindicatorwidget.cpp
    widgets/displaymessageformatactionmenu.cpp
    widgets/kactionmenutransport.cpp
    widgets/kactionmenuaccount.cpp
Laurent Montel's avatar
Laurent Montel committed
152
    widgets/zoomlabelwidget.cpp
153
154
155
156
157
158
159
160
161
162
163
164
165
    )
set(kmailprivate_tag_LIB_SRCS
    tag/tagactionmanager.cpp
    tag/tagselectdialog.cpp
    )


set(kmailprivate_plugininterface_LIB_SRCS
    plugininterface/kmailplugininterface.cpp
    )

set(kmailprivate_editor_plugininterface_LIB_SRCS
    editor/plugininterface/kmailplugineditormanagerinterface.cpp
Laurent Montel's avatar
Laurent Montel committed
166
    editor/plugininterface/kmailplugineditorcheckbeforesendmanagerinterface.cpp
Laurent Montel's avatar
Laurent Montel committed
167
    editor/plugininterface/kmailplugineditorinitmanagerinterface.cpp
Laurent Montel's avatar
Laurent Montel committed
168
    editor/plugininterface/kmailplugineditorconverttextmanagerinterface.cpp
169
    editor/plugininterface/kmailplugingrammareditormanagerinterface.cpp
170
171
    )

172
173
174
175
set(kmailprivate_checkindexing_LIB_SRCS
    search/checkindexingmanager.cpp
    search/checkindexingjob.cpp
    )
176
177
178
    
set(kmailprivate_sieveimapinstanceinterface_LIB_SRCS
    sieveimapinterface/kmailsieveimapinstanceinterface.cpp
179
    sieveimapinterface/kmsieveimappasswordprovider.cpp
180
    )
181

182
183
set(kmailprivate_undosend_LIB_SRCS
    undosend/undosendcombobox.cpp
Laurent Montel's avatar
Laurent Montel committed
184
    undosend/undosendmanager.cpp
185
    undosend/undosendcreatejob.cpp
186
187
    )

188
set(kmail_common_SRCS)
Laurent Montel's avatar
Laurent Montel committed
189
ecm_qt_declare_logging_category(kmail_common_SRCS HEADER kmail_debug.h IDENTIFIER KMAIL_LOG CATEGORY_NAME org.kde.pim.kmail)
190
191
192
193
194
195
set(kmailprivate_LIB_SRCS
    ${kmail_common_SRCS}
    kmmainwin.cpp
    settings/kmailsettings.cpp
    kmreaderwin.cpp
    kmsystemtray.cpp
Laurent Montel's avatar
Laurent Montel committed
196
    unityservicemanager.cpp
197
198
199
200
201
202
203
204
205
206
207
208
209
210
    undostack.cpp
    kmkernel.cpp
    kmcommands.cpp
    kmreadermainwin.cpp
    kmmainwidget.cpp
    aboutdata.cpp
    mailserviceimpl.cpp
    secondarywindow.cpp
    util.cpp
    messageactions.cpp
    foldershortcutactionmanager.cpp
    kmlaunchexternalcomponent.cpp
    manageshowcollectionproperties.cpp
    kmmigrateapplication.cpp
211
    ${kmailprivate_configureplugins_LIB_SRCS}
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
    ${kmailprivate_attributes_LIB_SRCS}
    ${kmailprivate_tag_LIB_SRCS}
    ${kmailprivate_job_LIB_SRCS}
    ${kmailprivate_widgets_LIB_SRCS}
    ${kmailprivate_dialogs_LIB_SRCS}
    ${kmailprivate_warningwidgets_LIB_SRCS}
    ${kmailprivate_folderarchive_LIB_SRCS}
    ${kmailprivate_collectionpage_LIB_SRCS}
    ${kmailprivate_configuredialog_LIB_SRCS}
    ${kmailprivate_searchdialog_LIB_SRCS}
    ${kmailprivate_identity_LIB_SRCS}
    ${kmailprivate_editor_LIB_SRCS}
    ${kmailprivate_editor_potentialphishingemail_SRCS}
    ${kmailprivate_plugininterface_LIB_SRCS}
    ${kmailprivate_editor_plugininterface_LIB_SRCS}
227
    ${kmailprivate_checkindexing_LIB_SRCS}
228
    ${kmailprivate_sieveimapinstanceinterface_LIB_SRCS}
229
    ${kmailprivate_undosend_LIB_SRCS}
230
231
232
    )

qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
233
    ${kmail_BINARY_DIR}/src/org.kde.kmail.mailcomposer.xml editor/kmcomposerwin.h KMComposerWin
234
235
236
    )

qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
237
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml kmkernel.h KMKernel
238
239
240
241
242
243
244
    )
qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
    ${MAILTRANSPORT_DBUS_SERVICE} mailserviceimpl.h
    KMail::MailServiceImpl
    )

qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
245
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml
246
247
    )
qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
248
    ../agents/archivemailagent/org.freedesktop.Akonadi.ArchiveMailAgent.xml
249
250
    )
qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
251
    ../agents/sendlateragent/org.freedesktop.Akonadi.SendLaterAgent.xml
252
253
254
    )

qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
255
    dbusinterface/org.freedesktop.Akonadi.NewMailNotifier.xml
256
257
258
    )

qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
259
    ../agents/followupreminderagent/org.freedesktop.Akonadi.FollowUpReminder.xml
260
261
    )

262
263
264
qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
    ../agents/mailfilteragent/org.freedesktop.Akonadi.MailFilterAgent.xml
    )
265
266
267
268
269
270
271
272
273
274
275

ki18n_wrap_ui(kmailprivate_LIB_SRCS
    ui/composercryptoconfiguration.ui
    ui/warningconfiguration.ui
    ui/smimeconfiguration.ui
    ui/miscpagemaintab.ui
    ui/securitypagegeneraltab.ui
    ui/securitypagemdntab.ui
    ui/identitypage.ui
    ui/accountspagereceivingtab.ui
    ui/searchwindow.ui
Laurent Montel's avatar
Laurent Montel committed
276
    ui/incompleteindexdialog.ui
277
278
    )

Laurent Montel's avatar
Laurent Montel committed
279
280
qt5_add_resources(kmailprivate_LIB_SRCS kmail.qrc)

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
# KCFG files. The main kmail.kcfg is configured by CMake and put
# in the build directory.

if(KDEPIM_ENTERPRISE_BUILD)
    set(WARN_TOOMANY_RECIPIENTS_DEFAULT true)
else()
    set(WARN_TOOMANY_RECIPIENTS_DEFAULT false)
endif()

configure_file(settings/kmail.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg)

kconfig_add_kcfg_files(kmailprivate_LIB_SRCS
    settings/globalsettings_kmail.kcfgc
    editor/custommimeheader/custommimeheader.kcfgc
    )


add_library(kmailprivate ${kmailprivate_LIB_SRCS})
generate_export_header(kmailprivate BASE_NAME kmail)
target_link_libraries(kmailprivate
    PRIVATE
    KF5::TextWidgets
    KF5::I18n
    KF5::Gravatar
    KF5::Mime
    KF5::AkonadiCore
    KF5::AkonadiMime
    KF5::MessageCore
    KF5::MessageList
    KF5::MessageComposer
    KF5::PimCommon
    KF5::MailCommon
    KF5::TemplateParser
    KF5::IdentityManagement
    KF5::WindowSystem
    KF5::Notifications
    KF5::GuiAddons
    KF5::Crash
    KF5::KIOFileWidgets
    KF5::NotifyConfig
Laurent Montel's avatar
Laurent Montel committed
321
    KF5::MailTransportAkonadi
322
323
324
    KF5::KCMUtils
    KF5::Libkleo
    KF5::KSieveUi
Laurent Montel's avatar
Laurent Montel committed
325
    KF5::LibkdepimAkonadi
326
327
328
329
330
331
332
333
334
335
336
    KF5::KIOCore
    KF5::Contacts
    KF5::PimTextEdit
    KF5::MessageViewer
    KF5::SendLater
    KF5::FollowupReminder
    KF5::IconThemes
    KF5::XmlGui
    KF5::Completion
    KF5::Ldap
    KF5::AkonadiSearchDebug
337
    KF5::AkonadiSearchPIM
Laurent Montel's avatar
Laurent Montel committed
338
    KF5::WebEngineViewer
Laurent Montel's avatar
Laurent Montel committed
339
    KF5::SyntaxHighlighting
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
    )
target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageList,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageViewer,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MailCommon,INTERFACE_INCLUDE_DIRECTORIES>)

set_target_properties(kmailprivate
    PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION}
    )

########### kcm_kmail ###############
set(kcm_kmail_PART_SRCS kcm_kmail.cpp )
add_library(kcm_kmail MODULE ${kcm_kmail_PART_SRCS})
target_link_libraries(kcm_kmail  kmailprivate KF5::KCMUtils KF5::Completion KF5::I18n KF5::TextWidgets)

########### kmailpart ###############

set(kmailpart_PART_SRCS kmail_part.cpp ${kmail_common_SRCS})
qt5_generate_dbus_interface(kmail_part.h org.kde.kmail.kmailpart.xml OPTIONS -a)
qt5_add_dbus_adaptor(kmailpart_PART_SRCS
359
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml kmail_part.h KMailPart
360
    )
361
qt5_add_dbus_interfaces(kmailpart_PART_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml)
362
363
364
365
366
add_library(kmailpart MODULE ${kmailpart_PART_SRCS})

target_link_libraries(kmailpart
    kmailprivate
    KF5::PimCommon
Laurent Montel's avatar
Laurent Montel committed
367
    KF5::LibkdepimAkonadi
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
    KF5::KCMUtils
    KF5::Parts
    KF5::IconThemes
    KF5::TemplateParser
    )

########### KMail executable ###############

set(kmail_SRCS main.cpp ${kmail_common_SRCS})
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kmail.png")
ecm_add_app_icon(kmail_SRCS ICONS ${ICONS_SRCS})
add_executable(kmail ${kmail_SRCS})
target_link_libraries(kmail
    KF5::KontactInterface
    kmailprivate
    KF5::PimCommon
    KF5::I18n
    KF5::TemplateParser
Albert Astals Cid's avatar
build++    
Albert Astals Cid committed
386
    KF5::Libkdepim
Laurent Montel's avatar
Laurent Montel committed
387
    KF5::Crash
388
389
390
391
392
393
394
    )

if(BUILD_TESTING)
    add_subdirectory(autotests)
    add_subdirectory(tests)
    add_subdirectory(folderarchive/autotests/)
    add_subdirectory(editor/potentialphishingemail/autotests)
Laurent Montel's avatar
Laurent Montel committed
395
    add_subdirectory(editor/warningwidgets/autotests)
Laurent Montel's avatar
Laurent Montel committed
396
    add_subdirectory(sieveimapinterface/tests/)
397
    add_subdirectory(undosend/autotests/)
398
399
400
401
402
403
404
endif()
########### install files ###############

install(TARGETS kmailprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)

install(TARGETS kmail ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})

Laurent Montel's avatar
Laurent Montel committed
405
install(PROGRAMS data/org.kde.kmail2.desktop data/kmail_view.desktop DESTINATION ${KDE_INSTALL_APPDIR})
406
407
408
409
install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg
    DESTINATION ${KDE_INSTALL_KCFGDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
410
install(FILES data/org.kde.kmail2.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
411
412
413
414
415
416
install(FILES
    data/kmail_config_misc.desktop
    data/kmail_config_appearance.desktop
    data/kmail_config_accounts.desktop
    data/kmail_config_composer.desktop
    data/kmail_config_security.desktop
417
    data/kmail_config_plugins.desktop
418
419
    DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
    )
Laurent Montel's avatar
Laurent Montel committed
420

421
422
423
424
425
426
427
install( FILES data/kmail2.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
install(TARGETS
    kmailpart
    kcm_kmail
    DESTINATION ${KDE_INSTALL_PLUGINDIR}
    )
install(FILES
428
429
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml
430
431
    DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
    )
432
433
434
435

configure_file(data/org.kde.kmail.service.in org.kde.kmail.service)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kmail.service DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR})