3 include(CheckIncludeFiles)
5 add_definitions(-DTRANSLATION_DOMAIN=\"kmail\")
6 add_definitions( -DQT_NO_CAST_FROM_ASCII )
7 add_definitions( -DQT_NO_CAST_TO_ASCII )
9 qt5_generate_dbus_interface(kmkernel.h org.kde.kmail.kmail.xml OPTIONS -a)
10 qt5_generate_dbus_interface(editor/kmcomposerwin.h org.kde.kmail.mailcomposer.xml OPTIONS -a)
12 add_custom_target(kmail_xml ALL
13 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kmail.kmail.xml
14 DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.kmail.mailcomposer.xml
15 COMMENT "Helper target for XML stuff. The Kontact plugin, KOrganizer and others depend on it."
19 ${CMAKE_CURRENT_BINARY_DIR}
22 ${AKONADI_INCLUDE_DIR}
28 add_subdirectory(about)
29 add_subdirectory(pics)
30 add_subdirectory(icons)
31 add_subdirectory(kcm_kpimidentities)
32 add_subdirectory(kontactplugin)
33 add_subdirectory(kconf_update)
35 ########### kmailprivate ###############
38 set(kmailprivate_attributes_LIB_SRCS
39 attributes/taskattribute.cpp
42 set(kmailprivate_folderarchive_LIB_SRCS
43 folderarchive/folderarchiveaccountinfo.cpp
44 folderarchive/folderarchiveutil.cpp
45 folderarchive/folderarchivecache.cpp
46 folderarchive/folderarchiveagentcheckcollection.cpp
47 folderarchive/folderarchivemanager.cpp
48 folderarchive/folderarchiveagentjob.cpp
50 set(kmailprivate_collectionpage_LIB_SRCS
51 collectionpage/collectiontemplatespage.cpp
52 collectionpage/collectionmaintenancepage.cpp
53 collectionpage/collectionviewpage.cpp
54 collectionpage/collectionquotapage.cpp
55 collectionpage/collectionquotawidget.cpp
56 collectionpage/collectionmailinglistpage.cpp
57 collectionpage/collectionshortcutpage.cpp
59 set(kmailprivate_configuredialog_LIB_SRCS
60 configuredialog/configagentdelegate.cpp
61 configuredialog/configuredialoglistview.cpp
62 configuredialog/configuredialog.cpp
63 configuredialog/configuredialog_p.cpp
64 configuredialog/configuremiscpage.cpp
65 configuredialog/configuresecuritypage.cpp
66 configuredialog/configurecomposerpage.cpp
67 configuredialog/configureappearancepage.cpp
68 configuredialog/configureaccountpage.cpp
69 configuredialog/colorlistbox.cpp
70 configuredialog/configureagentswidget.cpp
71 configuredialog/configurestorageservicewidget.cpp
72 configuredialog/configureagents/configureagentlistmodel.cpp
73 configuredialog/configureagents/configureagentlistdelegate.cpp
74 configuredialog/configureagents/configureagentlistview.cpp
75 configuredialog/configureagents/configureagentitem.cpp
78 set(kmailprivate_searchdialog_LIB_SRCS
79 searchdialog/kmsearchmessagemodel.cpp
80 searchdialog/kmsearchfilterproxymodel.cpp
81 searchdialog/searchpatternwarning.cpp
82 searchdialog/kmailsearchpatternedit.cpp
83 searchdialog/searchwindow.cpp
84 searchdialog/searchdescriptionattribute.cpp
86 set(kmailprivate_storageservice_LIB_SRCS
87 storageservice/storageservicesettingsjob.cpp
89 set(kmailprivate_identity_LIB_SRCS
90 identity/identitylistview.cpp
91 identity/identitydialog.cpp
92 identity/xfaceconfigurator.cpp
93 identity/identitypage.cpp
94 identity/newidentitydialog.cpp
95 identity/identityeditvcarddialog.cpp
96 identity/identityaddvcarddialog.cpp
98 set(kmailprivate_editor_LIB_SRCS
99 editor/widgets/snippetwidget.cpp
100 editor/kmcomposereditorng.cpp
102 editor/codec/codecaction.cpp
103 editor/codec/codecmanager.cpp
104 editor/kmcomposerwin.cpp
105 editor/attachment/attachmentcontroller.cpp
106 editor/attachment/attachmentview.cpp
107 editor/widgets/cryptostateindicatorwidget.cpp
108 editor/storageservice/kmstorageservice.cpp
109 editor/validatesendmailshortcut.cpp
110 editor/kmcomposerglobalaction.cpp
113 set(kmailprivate_warningwidgets_LIB_SRCS
114 warningwidgets/externaleditorwarning.cpp
115 warningwidgets/attachmentmissingwarning.cpp
117 set(kmailprivate_editor_potentialphishingemail_SRCS
118 editor/potentialphishingemail/potentialphishingemailwarning.cpp
119 editor/potentialphishingemail/potentialphishingemailjob.cpp
120 editor/potentialphishingemail/potentialphishingdetaildialog.cpp
121 editor/potentialphishingemail/potentialphishingdetailwidget.cpp
123 set(kmailprivate_dialogs_LIB_SRCS
124 dialog/archivefolderdialog.cpp
125 dialog/addemailtoexistingcontactdialog.cpp
128 set(kmailprivate_mailmerge_LIB_SRCS
129 mailmerge/widgets/mailmergewidget.cpp
130 mailmerge/widgets/attachmentlistwidget.cpp
131 mailmerge/widgets/addressbookwidget.cpp
132 mailmerge/mailmergedialog.cpp
133 mailmerge/widgets/csvwidget.cpp
134 mailmerge/widgets/selectattachmentdialog.cpp
135 mailmerge/job/mailmergejob.cpp
138 set(kmailprivate_job_LIB_SRCS
139 job/addressvalidationjob.cpp
140 job/createnewcontactjob.cpp
141 job/addemailtoexistingcontactjob.cpp
142 job/createtaskjob.cpp
144 job/removeduplicatemailjob.cpp
145 job/createfollowupreminderonexistingmessagejob.cpp
146 job/removecollectionjob.cpp
147 job/saveasfilejob.cpp
148 job/markallmessagesasreadinfolderandsubfolderjob.cpp
149 job/removeduplicatemessageinfolderandsubfolderjob.cpp
152 set(kmailprivate_widgets_LIB_SRCS
153 widgets/collectionpane.cpp
154 widgets/vacationscriptindicatorwidget.cpp
155 widgets/displaymessageformatactionmenu.cpp
156 widgets/statusbarlabeltoggledstate.cpp
157 widgets/kactionmenutransport.cpp
158 widgets/kactionmenuaccount.cpp
160 set(kmailprivate_tag_LIB_SRCS
161 tag/tagactionmanager.cpp
162 tag/tagselectdialog.cpp
166 set(kmailprivate_plugininterface_LIB_SRCS
167 plugininterface/kmailplugininterface.cpp
170 set(kmailprivate_editor_plugininterface_LIB_SRCS
171 editor/plugininterface/kmailplugineditormanagerinterface.cpp
174 set(kmail_common_SRCS)
175 ecm_qt_declare_logging_category(kmail_common_SRCS HEADER kmail_debug.h IDENTIFIER KMAIL_LOG CATEGORY_NAME log_kmail)
176 set(kmailprivate_LIB_SRCS
179 settings/kmailsettings.cpp
193 foldershortcutactionmanager.cpp
194 kmlaunchexternalcomponent.cpp
195 manageshowcollectionproperties.cpp
196 kmmigrateapplication.cpp
197 ${kmailprivate_attributes_LIB_SRCS}
198 ${kmailprivate_tag_LIB_SRCS}
199 ${kmailprivate_job_LIB_SRCS}
200 ${kmailprivate_widgets_LIB_SRCS}
201 ${kmailprivate_mailmerge_LIB_SRCS}
202 ${kmailprivate_dialogs_LIB_SRCS}
203 ${kmailprivate_warningwidgets_LIB_SRCS}
204 ${kmailprivate_folderarchive_LIB_SRCS}
205 ${kmailprivate_collectionpage_LIB_SRCS}
206 ${kmailprivate_configuredialog_LIB_SRCS}
207 ${kmailprivate_searchdialog_LIB_SRCS}
208 ${kmailprivate_storageservice_LIB_SRCS}
209 ${kmailprivate_identity_LIB_SRCS}
210 ${kmailprivate_editor_LIB_SRCS}
211 ${kmailprivate_editor_potentialphishingemail_SRCS}
212 ${kmailprivate_plugininterface_LIB_SRCS}
213 ${kmailprivate_editor_plugininterface_LIB_SRCS}
216 qt5_generate_dbus_interface(editor/kmcomposerwin.h org.kde.kmail.mailcomposer.xml OPTIONS -a)
217 qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
218 ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.mailcomposer.xml editor/kmcomposerwin.h KMComposerWin
221 qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
222 ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml kmkernel.h KMKernel
224 qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
225 ${MAILTRANSPORT_DBUS_SERVICE} mailserviceimpl.h
226 KMail::MailServiceImpl
229 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
230 ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml
232 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
233 ${CMAKE_SOURCE_DIR}/agents/archivemailagent/org.freedesktop.Akonadi.ArchiveMailAgent.xml
235 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
236 ${CMAKE_SOURCE_DIR}/agents/sendlateragent/org.freedesktop.Akonadi.SendLaterAgent.xml
239 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
240 ${CMAKE_SOURCE_DIR}/kmail/dbusinterface/org.freedesktop.Akonadi.NewMailNotifier.xml
243 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
244 ${CMAKE_SOURCE_DIR}/agents/followupreminderagent/org.freedesktop.Akonadi.FollowUpReminder.xml
248 ki18n_wrap_ui(kmailprivate_LIB_SRCS
249 ui/composercryptoconfiguration.ui
250 ui/warningconfiguration.ui
251 ui/smimeconfiguration.ui
252 ui/miscpagemaintab.ui
253 ui/securitypagegeneraltab.ui
254 ui/securitypagemdntab.ui
256 ui/accountspagereceivingtab.ui
260 # KCFG files. The main kmail.kcfg is configured by CMake and put
261 # in the build directory.
263 if(KDEPIM_ENTERPRISE_BUILD)
264 set(WARN_TOOMANY_RECIPIENTS_DEFAULT true)
266 set(WARN_TOOMANY_RECIPIENTS_DEFAULT false)
269 configure_file(settings/kmail.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg)
271 kconfig_add_kcfg_files(kmailprivate_LIB_SRCS
272 settings/globalsettings_kmail.kcfgc
273 editor/custommimeheader/custommimeheader.kcfgc
277 add_library(kmailprivate ${kmailprivate_LIB_SRCS})
278 generate_export_header(kmailprivate BASE_NAME kmail)
280 target_link_libraries(kmailprivate
292 KF5::IdentityManagement
310 KF5::FollowupReminder
316 KF5::AkonadiSearchDebug
318 target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageList,INTERFACE_INCLUDE_DIRECTORIES>)
319 target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MessageViewer,INTERFACE_INCLUDE_DIRECTORIES>)
320 target_include_directories(kmailprivate PUBLIC $<TARGET_PROPERTY:KF5::MailCommon,INTERFACE_INCLUDE_DIRECTORIES>)
322 set_target_properties(kmailprivate
323 PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION}
326 ########### kcm_kmail ###############
327 set(kcm_kmail_PART_SRCS kcm_kmail.cpp )
328 add_library(kcm_kmail MODULE ${kcm_kmail_PART_SRCS})
329 target_link_libraries(kcm_kmail kmailprivate KF5::KCMUtils KF5::Completion)
331 ########### kmailpart ###############
333 set(kmailpart_PART_SRCS kmail_part.cpp ${kmail_common_SRCS})
334 qt5_generate_dbus_interface(kmail_part.h org.kde.kmail.kmailpart.xml OPTIONS -a)
335 qt5_add_dbus_adaptor(kmailpart_PART_SRCS
336 ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmailpart.xml kmail_part.h KMailPart
338 qt5_add_dbus_interfaces(kmailpart_PART_SRCS ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmailpart.xml)
339 add_library(kmailpart MODULE ${kmailpart_PART_SRCS})
341 target_link_libraries(kmailpart
351 ########### KMail executable ###############
353 set(kmail_SRCS main.cpp ${kmail_common_SRCS})
354 file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*-apps-kmail.png")
355 ecm_add_app_icon(kmail_SRCS ICONS ${ICONS_SRCS})
356 add_executable(kmail ${kmail_SRCS})
357 target_link_libraries(kmail
358 KF5::KontactInterface
366 add_subdirectory(autotests)
367 add_subdirectory(tests)
368 add_subdirectory(mailmerge/tests/)
369 add_subdirectory(mailmerge/autotests/)
370 add_subdirectory(folderarchive/autotests/)
371 add_subdirectory(editor/potentialphishingemail/autotests)
373 ########### install files ###############
375 install(TARGETS kmailprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
377 install(TARGETS kmail ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
379 install(PROGRAMS data/org.kde.kmail.desktop data/kmail_view.desktop DESTINATION ${KDE_INSTALL_APPDIR})
381 ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg
382 DESTINATION ${KDE_INSTALL_KCFGDIR}
384 install(FILES data/org.kde.kmail.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
386 data/kmail_config_misc.desktop
387 data/kmail_config_appearance.desktop
388 data/kmail_config_identity.desktop
389 data/kmail_config_accounts.desktop
390 data/kmail_config_composer.desktop
391 data/kmail_config_security.desktop
392 DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
399 DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kmail2
401 install( FILES data/kmail2.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
402 install(FILES data/dbusmail.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
406 DESTINATION ${KDE_INSTALL_PLUGINDIR}
409 ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmailpart.xml
410 ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml
411 DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
414 install( FILES data/kmail_addattachmentservicemenu.desktop DESTINATION
415 ${KDE_INSTALL_KSERVICES5DIR}/ServiceMenus)