Fix Bug 362152 - Font selection is not honored
[kdepim.git] / kmail / CMakeLists.txt
blob1afd2893ac3ca41ea14af83c4950d498a84c64d2
1 project(kmail)
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."
16     )
18 include_directories(
19     ${CMAKE_CURRENT_BINARY_DIR}
20     ${GPGME_INCLUDES}
21     ${Boost_INCLUDE_DIR}
22     ${AKONADI_INCLUDE_DIR}
23     )
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
40     )
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
49     )
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
58     )
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
76     )
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
85     )
86 set(kmailprivate_storageservice_LIB_SRCS
87     storageservice/storageservicesettingsjob.cpp
88     )
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
97     )
98 set(kmailprivate_editor_LIB_SRCS
99     editor/widgets/snippetwidget.cpp
100     editor/kmcomposereditorng.cpp
101     editor/composer.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
111     )
113 set(kmailprivate_warningwidgets_LIB_SRCS
114     warningwidgets/externaleditorwarning.cpp
115     warningwidgets/attachmentmissingwarning.cpp
116     )
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
122     )
123 set(kmailprivate_dialogs_LIB_SRCS
124     dialog/archivefolderdialog.cpp
125     dialog/addemailtoexistingcontactdialog.cpp
126     dialog/kmknotify.cpp
127     )
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
136     )
138 set(kmailprivate_job_LIB_SRCS
139     job/addressvalidationjob.cpp
140     job/createnewcontactjob.cpp
141     job/addemailtoexistingcontactjob.cpp
142     job/createtaskjob.cpp
143     job/savedraftjob.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
150     )
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
159     )
160 set(kmailprivate_tag_LIB_SRCS
161     tag/tagactionmanager.cpp
162     tag/tagselectdialog.cpp
163     )
166 set(kmailprivate_plugininterface_LIB_SRCS
167     plugininterface/kmailplugininterface.cpp
168     )
170 set(kmailprivate_editor_plugininterface_LIB_SRCS
171     editor/plugininterface/kmailplugineditormanagerinterface.cpp
172     )
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
177     ${kmail_common_SRCS}
178     kmmainwin.cpp
179     settings/kmailsettings.cpp
180     kmreaderwin.cpp
181     kmsystemtray.cpp
182     undostack.cpp
183     kmkernel.cpp
184     kmcommands.cpp
185     kmreadermainwin.cpp
186     kmstartup.cpp
187     kmmainwidget.cpp
188     aboutdata.cpp
189     mailserviceimpl.cpp
190     secondarywindow.cpp
191     util.cpp
192     messageactions.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}
214     )
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
219     )
221 qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
222     ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml kmkernel.h KMKernel
223     )
224 qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
225     ${MAILTRANSPORT_DBUS_SERVICE} mailserviceimpl.h
226     KMail::MailServiceImpl
227     )
229 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
230     ${CMAKE_BINARY_DIR}/kmail/org.kde.kmail.kmail.xml
231     )
232 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
233     ${CMAKE_SOURCE_DIR}/agents/archivemailagent/org.freedesktop.Akonadi.ArchiveMailAgent.xml
234     )
235 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
236     ${CMAKE_SOURCE_DIR}/agents/sendlateragent/org.freedesktop.Akonadi.SendLaterAgent.xml
237     )
239 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
240     ${CMAKE_SOURCE_DIR}/kmail/dbusinterface/org.freedesktop.Akonadi.NewMailNotifier.xml
241     )
243 qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
244     ${CMAKE_SOURCE_DIR}/agents/followupreminderagent/org.freedesktop.Akonadi.FollowUpReminder.xml
245     )
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
255     ui/identitypage.ui
256     ui/accountspagereceivingtab.ui
257     ui/searchwindow.ui
258     )
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)
265 else()
266     set(WARN_TOOMANY_RECIPIENTS_DEFAULT false)
267 endif()
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
274     )
277 add_library(kmailprivate ${kmailprivate_LIB_SRCS})
278 generate_export_header(kmailprivate BASE_NAME kmail)
280 target_link_libraries(kmailprivate
281     PRIVATE
282     KF5::Gravatar
283     KF5::Mime
284     KF5::AkonadiCore
285     KF5::AkonadiMime
286     KF5::MessageCore
287     KF5::MessageList
288     KF5::MessageComposer
289     KF5::PimCommon
290     KF5::MailCommon
291     KF5::TemplateParser
292     KF5::IdentityManagement
293     KF5::WindowSystem
294     KF5::Notifications
295     KF5::GuiAddons
296     KF5::Crash
297     KF5::Bookmarks
298     KF5::KIOFileWidgets
299     KF5::NotifyConfig
300     KF5::MailTransport
301     KF5::KCMUtils
302     KF5::Libkleo
303     KF5::KSieveUi
304     KF5::Libkdepim
305     KF5::KIOCore
306     KF5::Contacts
307     KF5::PimTextEdit
308     KF5::MessageViewer
309     KF5::SendLater
310     KF5::FollowupReminder
311     KF5::GrantleeTheme
312     KF5::IconThemes
313     KF5::XmlGui
314     KF5::Completion
315     KF5::Ldap
316     KF5::AkonadiSearchDebug
317     )
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}
324     )
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
337     )
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
342     kmailprivate
343     KF5::PimCommon
344     KF5::Libkdepim
345     KF5::KCMUtils
346     KF5::Parts
347     KF5::IconThemes
348     KF5::TemplateParser
349     )
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
359     kmailprivate
360     KF5::PimCommon
361     KF5::Libkdepim
362     KF5::TemplateParser
363     )
365 if(BUILD_TESTING)
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)
372 endif()
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})
380 install(FILES
381     ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg
382     DESTINATION ${KDE_INSTALL_KCFGDIR}
383     )
384 install(FILES data/org.kde.kmail.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
385 install(FILES
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}
393     )
394 install(FILES
395     kmcomposerui.rc
396     kmmainwin.rc
397     kmreadermainwin.rc
398     kmail_part.rc
399     DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kmail2
400     )
401 install( FILES data/kmail2.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
402 install(FILES data/dbusmail.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
403 install(TARGETS
404     kmailpart
405     kcm_kmail
406     DESTINATION ${KDE_INSTALL_PLUGINDIR}
407     )
408 install(FILES
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}
412     )
414 install( FILES data/kmail_addattachmentservicemenu.desktop DESTINATION
415     ${KDE_INSTALL_KSERVICES5DIR}/ServiceMenus)