CMakeLists.txt 13.3 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 20 21 22 23 24 25
    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}
    )




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

########### 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/collectionmaintenancepage.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
62
    configuredialog/configurepluginpage.cpp
63 64 65
    configuredialog/colorlistbox.cpp
    )

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

70 71 72 73 74 75 76
set(kmailprivate_searchdialog_LIB_SRCS
    searchdialog/kmsearchmessagemodel.cpp
    searchdialog/kmsearchfilterproxymodel.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 101
    )
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/widgets/snippetwidget.cpp
    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
102 103
    editor/kmcomposerupdatetemplatejob.cpp
    editor/kmcomposercreatenewcomposerjob.cpp
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
    )

set(kmailprivate_warningwidgets_LIB_SRCS
    warningwidgets/externaleditorwarning.cpp
    warningwidgets/attachmentmissingwarning.cpp
    )
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
    )
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
133
    job/handleclickedurljob.cpp
134
    job/composenewmessagejob.cpp
Laurent Montel's avatar
Laurent Montel committed
135
    job/opencomposerjob.cpp
Laurent Montel's avatar
Laurent Montel committed
136
    job/newmessagejob.cpp
Laurent Montel's avatar
Laurent Montel committed
137
    job/opencomposerhiddenjob.cpp
138
    job/fillcomposerjob.cpp
Laurent Montel's avatar
Laurent Montel committed
139
    job/createreplymessagejob.cpp
140
    job/createforwardmessagejob.cpp
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
    )

set(kmailprivate_widgets_LIB_SRCS
    widgets/collectionpane.cpp
    widgets/vacationscriptindicatorwidget.cpp
    widgets/displaymessageformatactionmenu.cpp
    widgets/statusbarlabeltoggledstate.cpp
    widgets/kactionmenutransport.cpp
    widgets/kactionmenuaccount.cpp
    )
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
163
    editor/plugininterface/kmailplugineditorcheckbeforesendmanagerinterface.cpp
164 165
    )

166 167 168 169
set(kmailprivate_checkindexing_LIB_SRCS
    search/checkindexingmanager.cpp
    search/checkindexingjob.cpp
    )
170 171 172 173
    
set(kmailprivate_sieveimapinstanceinterface_LIB_SRCS
    sieveimapinterface/kmailsieveimapinstanceinterface.cpp
    )
174

175
set(kmail_common_SRCS)
Laurent Montel's avatar
Laurent Montel committed
176
ecm_qt_declare_logging_category(kmail_common_SRCS HEADER kmail_debug.h IDENTIFIER KMAIL_LOG CATEGORY_NAME org.kde.pim.kmail)
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197
set(kmailprivate_LIB_SRCS
    ${kmail_common_SRCS}
    kmmainwin.cpp
    settings/kmailsettings.cpp
    kmreaderwin.cpp
    kmsystemtray.cpp
    undostack.cpp
    kmkernel.cpp
    kmcommands.cpp
    kmreadermainwin.cpp
    kmstartup.cpp
    kmmainwidget.cpp
    aboutdata.cpp
    mailserviceimpl.cpp
    secondarywindow.cpp
    util.cpp
    messageactions.cpp
    foldershortcutactionmanager.cpp
    kmlaunchexternalcomponent.cpp
    manageshowcollectionproperties.cpp
    kmmigrateapplication.cpp
198
    ${kmailprivate_configureplugins_LIB_SRCS}
199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
    ${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}
214
    ${kmailprivate_checkindexing_LIB_SRCS}
215
    ${kmailprivate_sieveimapinstanceinterface_LIB_SRCS}
216 217 218 219
    )

qt5_generate_dbus_interface(editor/kmcomposerwin.h org.kde.kmail.mailcomposer.xml OPTIONS -a)
qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
220
    ${kmail_BINARY_DIR}/src/org.kde.kmail.mailcomposer.xml editor/kmcomposerwin.h KMComposerWin
221 222 223
    )

qt5_add_dbus_adaptor(kmailprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
224
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml kmkernel.h KMKernel
225 226 227 228 229 230 231
    )
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
232
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml
233 234
    )
qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
235
    ../agents/archivemailagent/org.freedesktop.Akonadi.ArchiveMailAgent.xml
236 237
    )
qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
238
    ../agents/sendlateragent/org.freedesktop.Akonadi.SendLaterAgent.xml
239 240 241
    )

qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
242
    dbusinterface/org.freedesktop.Akonadi.NewMailNotifier.xml
243 244 245
    )

qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
246
    ../agents/followupreminderagent/org.freedesktop.Akonadi.FollowUpReminder.xml
247 248
    )

249 250 251
qt5_add_dbus_interfaces(kmailprivate_LIB_SRCS
    ../agents/mailfilteragent/org.freedesktop.Akonadi.MailFilterAgent.xml
    )
252 253 254 255 256 257 258 259 260 261 262

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
263
    ui/incompleteindexdialog.ui
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
    )

# 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::Bookmarks
    KF5::KIOFileWidgets
    KF5::NotifyConfig
Laurent Montel's avatar
Laurent Montel committed
307
    KF5::MailTransportAkonadi
308 309 310
    KF5::KCMUtils
    KF5::Libkleo
    KF5::KSieveUi
Laurent Montel's avatar
Laurent Montel committed
311
    KF5::LibkdepimAkonadi
312 313 314 315 316 317 318 319 320 321 322
    KF5::KIOCore
    KF5::Contacts
    KF5::PimTextEdit
    KF5::MessageViewer
    KF5::SendLater
    KF5::FollowupReminder
    KF5::IconThemes
    KF5::XmlGui
    KF5::Completion
    KF5::Ldap
    KF5::AkonadiSearchDebug
323
    KF5::AkonadiSearchPIM
Laurent Montel's avatar
Laurent Montel committed
324
    KF5::WebEngineViewer
Laurent Montel's avatar
Laurent Montel committed
325
    KF5::SyntaxHighlighting
326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344
    )
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
345
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml kmail_part.h KMailPart
346
    )
347
qt5_add_dbus_interfaces(kmailpart_PART_SRCS ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml)
348 349 350 351 352
add_library(kmailpart MODULE ${kmailpart_PART_SRCS})

target_link_libraries(kmailpart
    kmailprivate
    KF5::PimCommon
Laurent Montel's avatar
Laurent Montel committed
353
    KF5::LibkdepimAkonadi
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371
    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
372
    KF5::Libkdepim
Laurent Montel's avatar
Laurent Montel committed
373
    KF5::Crash
374 375 376 377 378 379 380
    )

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
381
    add_subdirectory(sieveimapinterface/tests/)
382 383 384 385 386 387 388
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
389
install(PROGRAMS data/org.kde.kmail2.desktop data/kmail_view.desktop DESTINATION ${KDE_INSTALL_APPDIR})
390 391 392 393
install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/kmail.kcfg
    DESTINATION ${KDE_INSTALL_KCFGDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
394
install(FILES data/org.kde.kmail2.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
395 396 397 398 399 400 401
install(FILES
    data/kmail_config_misc.desktop
    data/kmail_config_appearance.desktop
    data/kmail_config_identity.desktop
    data/kmail_config_accounts.desktop
    data/kmail_config_composer.desktop
    data/kmail_config_security.desktop
402
    data/kmail_config_plugins.desktop
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419
    DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
    )
install(FILES
    kmcomposerui.rc
    kmmainwin.rc
    kmreadermainwin.rc
    kmail_part.rc
    DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kmail2
    )
install( FILES data/kmail2.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
install(FILES data/dbusmail.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
install(TARGETS
    kmailpart
    kcm_kmail
    DESTINATION ${KDE_INSTALL_PLUGINDIR}
    )
install(FILES
420 421
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmailpart.xml
    ${kmail_BINARY_DIR}/src/org.kde.kmail.kmail.xml
422 423 424 425 426
    DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
    )

install( FILES data/kmail_addattachmentservicemenu.desktop DESTINATION
    ${KDE_INSTALL_KSERVICES5DIR}/ServiceMenus)