CMakeLists.txt 18.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12


add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )


add_definitions(-DTRANSLATION_DOMAIN=\"libmessageviewer\")

# KCFG files:
# The main messageviewer.kcfg is configured by CMake and put in the build directory.

if(KDEPIM_ENTERPRISE_BUILD)
Laurent Montel's avatar
Laurent Montel committed
13 14 15 16
    set(LEGACY_MANGLE_FROM_TO_HEADERS true)
    set(LEGACY_BODY_INVITES true)
    set(EXCHANGE_COMPATIBLE_INVITATIONS true)
    set(OUTLOOK_COMPATIBLE_INVITATION_REPLY_COMMENTS true)
17
else()
Laurent Montel's avatar
Laurent Montel committed
18 19 20 21
    set(LEGACY_MANGLE_FROM_TO_HEADERS false)
    set(LEGACY_BODY_INVITES false)
    set(EXCHANGE_COMPATIBLE_INVITATIONS false)
    set(OUTLOOK_COMPATIBLE_INVITATION_REPLY_COMMENTS false)
22 23 24 25 26 27 28 29 30 31 32 33
endif()

configure_file(settings/messageviewer.kcfg.cmake ${CMAKE_CURRENT_BINARY_DIR}/messageviewer.kcfg)
include(CheckIncludeFiles)
check_include_files(sys/inotify.h SYS_INOTIFY_H_FOUND)
macro_bool_to_01(SYS_INOTIFY_H_FOUND HAVE_SYS_INOTIFY_H)
configure_file(config-messageviewer.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-messageviewer.h)

# target_include_directories does not handle empty include paths
include_directories(${GPGME_INCLUDES})

if(BUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
34 35 36 37 38
    add_subdirectory(scamdetection/autotests)
    add_subdirectory(findbar/autotests)
    add_subdirectory(scamdetection/tests)
    add_subdirectory(adblock/tests/)
    add_subdirectory(viewerplugins/tests/)
39 40 41 42 43 44
endif()
add_subdirectory(pics)
add_subdirectory(kconf_update)
add_subdirectory(about)

if(DEBUG_SIGNATURE)
Laurent Montel's avatar
Laurent Montel committed
45
    add_definitions(-DDEBUG_SIGNATURE)
46 47
endif()

Laurent Montel's avatar
Laurent Montel committed
48
set(_mailwebview_cpp 
Laurent Montel's avatar
Laurent Montel committed
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
    adblock/adblockelementhiding.cpp
    adblock/adblockmanager.cpp
    adblock/adblockrulefallbackimpl.cpp
    adblock/adblockblockableitemsdialog.cpp
    adblock/adblockblockableitemswidget.cpp

    adblock/common/adblockrule.cpp
    adblock/common/adblockruletextmatchimpl.cpp
    adblock/common/adblockrulenullimpl.cpp
    adblock/common/adblocksettingwidget.cpp
    adblock/common/adblockutil.cpp
    adblock/common/adblockcreatefilterdialog.cpp
    adblock/common/adblockaddsubscriptiondialog.cpp
    adblock/common/adblocklistwidget.cpp
    adblock/common/adblocksyntaxhighlighter.cpp
    adblock/common/adblockshowlistdialog.cpp
    adblock/common/adblockhostmatcher.cpp
    )
67

68

Laurent Montel's avatar
Laurent Montel committed
69
# For the moment we can't replace mailwebengine
Laurent Montel's avatar
Laurent Montel committed
70
set(libmessageviewer_mailviewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
71 72 73 74
    viewer/webview/mailwebview.cpp
    viewer/webview/webpage.cpp
    viewer/webview/networkaccessmanager.cpp
    )
75 76 77
set(libmessageviewer_web_LIB KF5::WebKit Qt5::WebKitWidgets)

if (QTWEBENGINE_EXPERIMENTAL_OPTION)
Laurent Montel's avatar
Laurent Montel committed
78 79 80
    set(libmessageviewer_mailviewer_SRCS
        viewer/webengine/mailwebengineview.cpp
        viewer/webengine/mailwebenginepage.cpp
Laurent Montel's avatar
Laurent Montel committed
81
        viewer/webengine/mailwebengineaccesskey.cpp
82
        viewer/webengine/mailwebhittestresult.cpp
Laurent Montel's avatar
Laurent Montel committed
83
        viewer/webengine/networkmanager/mailnetworkaccessmanager.cpp
Laurent Montel's avatar
Laurent Montel committed
84 85 86 87
        viewer/webengine/urlinterceptor/mailnetworkurlinterceptor.cpp
        viewer/webengine/urlinterceptor/mailnetworkpluginurlinterceptorinterface.cpp
        viewer/webengine/urlinterceptor/mailnetworkurlinterceptorpluginmanager.cpp
        viewer/webengine/urlinterceptor/mailnetworkpluginurlinterceptor.cpp
Laurent Montel's avatar
Laurent Montel committed
88
        viewer/webengine/urlinterceptor/mailnetworkurlinterceptormanager.cpp
Laurent Montel's avatar
Laurent Montel committed
89 90 91 92
        ${libmessageviewer_mailviewer_SRCS}
        findbar/findbarwebengineview.cpp
        )
    set(libmessageviewer_web_LIB Qt5::WebEngine Qt5::WebEngineWidgets ${libmessageviewer_web_LIB})
Laurent Montel's avatar
Laurent Montel committed
93
endif()
Laurent Montel's avatar
Laurent Montel committed
94

95
set(libmessageviewer_otp_SRCS
Laurent Montel's avatar
Laurent Montel committed
96 97 98 99 100 101 102 103 104 105 106 107 108 109
    interfaces/bodypartformatter.cpp
    viewer/bodypartformatter.cpp
    viewer/bodypartformatterfactory.cpp
    viewer/cryptohelper.cpp
    viewer/nodehelper.cpp
    viewer/objecttreeparser.cpp
    viewer/messagepart.cpp
    viewer/partnodebodypart.cpp
    viewer/pluginloaderbase.cpp
    viewer/memento/cryptobodypartmemento.cpp
    viewer/memento/decryptverifybodypartmemento.cpp
    viewer/memento/verifydetachedbodypartmemento.cpp
    viewer/memento/verifyopaquebodypartmemento.cpp
    )
110 111

set(libmessageviewer_otp_extra_SRCS
Laurent Montel's avatar
Laurent Montel committed
112 113 114 115 116 117 118 119 120 121 122 123
    job/kleojobexecutor.cpp
    #for quotes
    viewer/csshelperbase.cpp
    viewer/attachmentstrategy.cpp
    utils/iconnamecache.cpp
    utils/mimetype.cpp
    viewer/converthtmltoplaintext.cpp
    viewer/urlhandlermanager_otp.cpp
    #HTML Writer
    htmlwriter/filehtmlwriter.cpp
    htmlwriter/queuehtmlwriter.cpp
    )
124

125
set(libmessageviewer_viewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
    viewer/attachmentstrategy.cpp
    viewer/bodypartformatter.cpp
    viewer/bodypartformatterfactory.cpp
    viewer/cryptohelper.cpp
    viewer/csshelper.cpp
    viewer/csshelperbase.cpp
    viewer/editorwatcher.cpp
    viewer/mimeparttree/mimetreemodel.cpp
    viewer/nodehelper.cpp
    viewer/objecttreeemptysource.cpp
    viewer/objecttreeparser.cpp
    viewer/objecttreeviewersource.cpp
    viewer/messagepart.cpp
    viewer/partnodebodypart.cpp
    viewer/pluginloaderbase.cpp
    viewer/viewer.cpp
    viewer/viewer_p.cpp
    viewer//webview/webviewaccesskey.cpp
    viewer/messagedisplayformatattribute.cpp
    viewer/urlhandlermanager.cpp
    viewer/mimeparttree/mimeparttreeview.cpp
    viewer/converthtmltoplaintext.cpp
    viewer/memento/cryptobodypartmemento.cpp
    viewer/memento/decryptverifybodypartmemento.cpp
    viewer/memento/verifydetachedbodypartmemento.cpp
    viewer/memento/verifyopaquebodypartmemento.cpp
    )
153 154

set(libmessageviewer_widgets_SRCS
Laurent Montel's avatar
Laurent Montel committed
155 156 157 158 159 160 161 162 163 164 165
    widgets/attachmentdialog.cpp
    widgets/configurewidget.cpp
    widgets/printingsettings.cpp
    widgets/htmlstatusbar.cpp
    widgets/vcardviewer.cpp
    widgets/invitationsettings.cpp
    widgets/openattachmentfolderwidget.cpp
    widgets/mailsourceviewer.cpp
    widgets/mailsourceviewtextbrowserwidget.cpp
    widgets/zoomactionmenu.cpp
    )
166 167

set(libmessageviewer_header_SRCS
Laurent Montel's avatar
Laurent Montel committed
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
    header/contactdisplaymessagememento.cpp
    header/headerstrategy.cpp
    header/richheaderstrategy.cpp
    header/headerstyle.cpp
    header/grantleeheaderstyle.cpp
    header/plainheaderstyle.cpp
    header/headerstyle_util.cpp
    header/grantleeheaderformatter.cpp
    header/grantleeheaderteststyle.cpp
    header/kxface.cpp
    header/headerstyleplugin.cpp
    header/headerstylepluginmanager.cpp
    header/headerstyleinterface.cpp
    header/headerstylemenumanager.cpp
    )
183 184

set(libmessageviewer_scamdetection_SRCS
Laurent Montel's avatar
Laurent Montel committed
185 186 187 188 189 190
    scamdetection/scamdetectionwarningwidget.cpp
    scamdetection/scamdetection.cpp
    scamdetection/scamdetectiondetailsdialog.cpp
    scamdetection/scamattribute.cpp
    scamdetection/scamcheckshorturl.cpp
    )
191 192

set(libmessageviewer_findbar_SRCS
Laurent Montel's avatar
Laurent Montel committed
193 194 195 196
    findbar/findbarbase.cpp
    findbar/findbarwebview.cpp
    findbar/findbarsourceview.cpp
    )
197 198

set(libmessageviewer_utils_SRCS
Laurent Montel's avatar
Laurent Montel committed
199 200 201 202 203
    utils/iconnamecache.cpp
    utils/markmessagereadhandler.cpp
    utils/messageviewerutil.cpp
    utils/mimetype.cpp
    )
204 205

set(libmessageviewer_htmlwriter_SRCS
Laurent Montel's avatar
Laurent Montel committed
206 207 208 209 210
    htmlwriter/filehtmlwriter.cpp
    htmlwriter/queuehtmlwriter.cpp
    htmlwriter/teehtmlwriter.cpp
    htmlwriter/webkitparthtmlwriter.cpp
    )
211 212

set(libmessageviewer_antispam_SRCS
Laurent Montel's avatar
Laurent Montel committed
213 214 215
    antispam/spamheaderanalyzer.cpp
    antispam/antispamconfig.cpp
    )
216 217

set(libmessageviewer_job_SRCS
Laurent Montel's avatar
Laurent Montel committed
218 219 220 221 222 223 224
    job/createtodojob.cpp
    job/createeventjob.cpp
    job/createnotejob.cpp
    job/attachmenteditjob.cpp
    job/modifymessagedisplayformatjob.cpp
    job/kleojobexecutor.cpp
    )
225 226

set(libmessageviewer_viewerplugins_SRCS
Laurent Montel's avatar
Laurent Montel committed
227 228 229 230 231
    viewerplugins/viewerpluginmanager.cpp
    viewerplugins/viewerplugin.cpp
    viewerplugins/viewerplugininterface.cpp
    viewerplugins/viewerplugintoolmanager.cpp
    )
232 233

set(libmessageviewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
    ${libmessageviewer_viewer_SRCS}
    ${libmessageviewer_widgets_SRCS}
    ${libmessageviewer_header_SRCS}
    ${libmessageviewer_scamdetection_SRCS}
    ${libmessageviewer_findbar_SRCS}
    ${libmessageviewer_utils_SRCS}
    ${libmessageviewer_htmlwriter_SRCS}
    ${libmessageviewer_antispam_SRCS}
    ${libmessageviewer_job_SRCS}
    ${libmessageviewer_viewerplugins_SRCS}
    settings/messageviewersettings.cpp
    interfaces/bodypartformatter.cpp
    ${_mailwebview_cpp}
    ${libmessageviewer_mailviewer_SRCS}
    )
249 250 251 252

ecm_qt_declare_logging_category(libmessageviewer_SRCS HEADER messageviewer_debug.h IDENTIFIER MESSAGEVIEWER_LOG CATEGORY_NAME log_messageviewer)

kconfig_add_kcfg_files(libmessageviewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
253 254
    settings/globalsettings_messageviewer.kcfgc
    )
255 256

ki18n_wrap_ui(libmessageviewer_SRCS
Laurent Montel's avatar
Laurent Montel committed
257 258 259 260 261 262
    ui/settings.ui
    ui/invitationsettings.ui
    ui/printingsettings.ui
    adblock/ui/settings_adblock.ui
    adblock/ui/adblockcreatefilterwidget.ui
    )
263 264 265 266 267 268 269 270 271 272


add_library(KF5MessageViewer ${libmessageviewer_SRCS})
generate_export_header(KF5MessageViewer BASE_NAME messageviewer)
add_library(KF5::MessageViewer ALIAS KF5MessageViewer)

target_include_directories(KF5MessageViewer INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/MessageViewer/;${KDE_INSTALL_INCLUDEDIR_KF5}/messageviewer>")
target_include_directories(KF5MessageViewer PUBLIC "$<BUILD_INTERFACE:${MessageViewer_SOURCE_DIR}/src;${MessageViewer_BINARY_DIR}/src;>")

target_link_libraries(KF5MessageViewer
Laurent Montel's avatar
Laurent Montel committed
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
    PUBLIC
    KF5::MessageCore
    KF5::PimCommon
    KF5::AkonadiCore
    KF5::AkonadiMime
    KF5::Contacts
    KF5::Libkleo
    PRIVATE
    KF5::ItemViews
    ${libmessageviewer_web_LIB}
    KF5::Libkdepim
    KF5::GrantleeTheme
    KF5::KaddressbookGrantlee
    Grantlee5::TextDocument
    Grantlee5::Templates
    KF5::MailTransport
    KF5::Mime
    KF5::Mbox
    KF5::AkonadiNotes
    KF5::PimTextEdit
    KF5::CalendarCore
    KF5::Gravatar
    KF5::IconThemes
    )
297
if (WIN32)
Laurent Montel's avatar
Laurent Montel committed
298
    target_link_libraries(KF5MessageViewer PUBLIC KF5::Gpgmepp)
299
else()
Laurent Montel's avatar
Laurent Montel committed
300
    target_link_libraries(KF5MessageViewer PUBLIC KF5::Gpgmepp-pthread)
301 302 303 304 305 306 307 308
endif()

target_include_directories(KF5MessageViewer PUBLIC $<TARGET_PROPERTY:KF5::WebKit,INTERFACE_INCLUDE_DIRECTORIES>)

set_target_properties(KF5MessageViewer PROPERTIES
    VERSION ${MESSAGEVIEWER_VERSION_STRING}
    SOVERSION ${MESSAGEVIEWER_SOVERSION}
    EXPORT_NAME MessageViewer
Laurent Montel's avatar
Laurent Montel committed
309
    )
310 311 312 313

install(TARGETS
    KF5MessageViewer
    EXPORT KF5MessageViewerTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
Laurent Montel's avatar
Laurent Montel committed
314
    )
315

Laurent Montel's avatar
Laurent Montel committed
316
ecm_generate_headers(MessageViewer_Camelcasewebviewer_HEADERS
Laurent Montel's avatar
Laurent Montel committed
317 318 319 320 321 322 323 324
    HEADER_NAMES
    MailWebView
    WebViewAccessKey
    WebPage
    REQUIRED_HEADERS MessageViewer_webviewer_HEADERS
    PREFIX MessageViewer
    RELATIVE viewer/webview
    )
Laurent Montel's avatar
Laurent Montel committed
325

Laurent Montel's avatar
Laurent Montel committed
326
if (QTWEBENGINE_EXPERIMENTAL_OPTION)
Laurent Montel's avatar
Laurent Montel committed
327 328 329 330 331 332
    ecm_generate_headers(MessageViewer_Camelcasewebengine_HEADERS
        HEADER_NAMES
        MailWebHitTestResult
        MailWebEnginePage
        MailWebEngineAccessKey
        MailWebEngineView
Laurent Montel's avatar
Laurent Montel committed
333 334 335 336 337 338
        REQUIRED_HEADERS MessageViewer_webengine_HEADERS
        PREFIX MessageViewer
        RELATIVE viewer/webengine
        )
    ecm_generate_headers(MessageViewer_Camelcasewebengine_urlinterceptor_HEADERS
        HEADER_NAMES
Laurent Montel's avatar
Laurent Montel committed
339 340 341 342
        MailNetworkUrlInterceptorPluginManager
        MailNetworkUrlInterceptor
        MailNetworkPluginUrlInterceptorInterface
        MailNetworkPluginUrlInterceptor
Laurent Montel's avatar
Laurent Montel committed
343

Laurent Montel's avatar
Laurent Montel committed
344
        REQUIRED_HEADERS MessageViewer_webengine_urlinterceptor_HEADERS
Laurent Montel's avatar
Laurent Montel committed
345
        PREFIX MessageViewer
Laurent Montel's avatar
Laurent Montel committed
346
        RELATIVE viewer/webengine/urlinterceptor
Laurent Montel's avatar
Laurent Montel committed
347
        )
Laurent Montel's avatar
Laurent Montel committed
348

Laurent Montel's avatar
Laurent Montel committed
349
endif()
Laurent Montel's avatar
Laurent Montel committed
350

351
ecm_generate_headers(MessageViewer_Camelcaseviewer_HEADERS
Laurent Montel's avatar
Laurent Montel committed
352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
    HEADER_NAMES
    Viewer
    CSSHelper
    PartMetaData
    ObjectTreeParser
    ObjectTreeEmptySource
    AttachmentStrategy
    NodeHelper
    EditorWatcher
    Stl_Util
    CSSHelperBase
    MessagePart
    Enums
    REQUIRED_HEADERS MessageViewer_viewer_HEADERS
    PREFIX MessageViewer
    RELATIVE viewer
    )
369 370

ecm_generate_headers(MessageViewer_Camelcasemain_HEADERS
Laurent Montel's avatar
Laurent Montel committed
371 372 373 374 375
    HEADER_NAMES
    ObjectTreeSourceIf
    REQUIRED_HEADERS MessageViewer_main_HEADERS
    PREFIX MessageViewer
    )
376 377 378


ecm_generate_headers(MessageViewer_Camelcasewidgets_HEADERS
Laurent Montel's avatar
Laurent Montel committed
379 380 381 382 383 384 385 386 387
    HEADER_NAMES
    InvitationSettings
    PrintingSettings
    ConfigureWidget
    ZoomActionMenu
    REQUIRED_HEADERS MessageViewer_widgets_HEADERS
    PREFIX MessageViewer
    RELATIVE widgets
    )
388 389

ecm_generate_headers(MessageViewer_Camelcaseutils_HEADERS
Laurent Montel's avatar
Laurent Montel committed
390 391 392 393 394 395 396 397 398
    HEADER_NAMES
    MessageViewerUtil
    MarkMessageReadHandler
    IconNameCache
    MimeType
    REQUIRED_HEADERS MessageViewer_utils_HEADERS
    PREFIX MessageViewer
    RELATIVE utils
    )
399

400
ecm_generate_headers(MessageViewer_Camelfindbar_HEADERS
Laurent Montel's avatar
Laurent Montel committed
401 402 403
    HEADER_NAMES
    FindBarWebView
    FindBarBase
Laurent Montel's avatar
Laurent Montel committed
404 405 406 407
    REQUIRED_HEADERS MessageViewer_findbar_HEADERS
    PREFIX MessageViewer
    RELATIVE findbar
    )
408

Laurent Montel's avatar
Laurent Montel committed
409 410 411 412 413 414 415 416 417
if (QTWEBENGINE_EXPERIMENTAL_OPTION)
    ecm_generate_headers(MessageViewer_CamelfindbarWebEngine_HEADERS
        HEADER_NAMES
        FindBarWebEngineView
        REQUIRED_HEADERS MessageViewer_findbarWebEngine_HEADERS
        PREFIX MessageViewer
        RELATIVE findbar
        )
endif()
418

419
ecm_generate_headers(MessageViewer_Camelcaseantispam_HEADERS
Laurent Montel's avatar
Laurent Montel committed
420 421 422 423 424 425
    HEADER_NAMES
    SpamHeaderAnalyzer
    REQUIRED_HEADERS MessageViewer_antispam_HEADERS
    PREFIX MessageViewer
    RELATIVE antispam
    )
426 427

ecm_generate_headers(MessageViewer_Camelcaseinterfaces_HEADERS
Laurent Montel's avatar
Laurent Montel committed
428 429 430 431 432 433 434 435 436 437
    HEADER_NAMES
    BodyPartFormatter
    BodyPart
    BodyPartURLHandler
    HtmlWriter
    URLHandler
    REQUIRED_HEADERS MessageViewer_interfaces_HEADERS
    PREFIX MessageViewer
    RELATIVE interfaces
    )
438 439

ecm_generate_headers(MessageViewer_Camelcasesettings_HEADERS
Laurent Montel's avatar
Laurent Montel committed
440 441 442 443 444 445
    HEADER_NAMES
    MessageViewerSettings
    REQUIRED_HEADERS MessageViewer_settings_HEADERS
    PREFIX MessageViewer
    RELATIVE settings
    )
446 447 448


ecm_generate_headers(MessageViewer_Camelcaseheader_HEADERS
Laurent Montel's avatar
Laurent Montel committed
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465
    HEADER_NAMES
    HeaderStrategy
    GrantleeHeaderTestStyle
    GrantleeHeaderStyle
    HeaderStyle
    KXFace
    HeaderStyle_Util
    HeaderStylePlugin
    HeaderStyleInterface
    PlainHeaderStyle
    RichHeaderStrategy
    HeaderStylePluginManager
    HeaderStyleMenuManager
    REQUIRED_HEADERS MessageViewer_header_HEADERS
    PREFIX MessageViewer
    RELATIVE header
    )
466 467

ecm_generate_headers(MessageViewer_Camelcasehtmlwriter_HEADERS
Laurent Montel's avatar
Laurent Montel committed
468 469 470 471 472 473 474
    HEADER_NAMES
    WebKitPartHtmlWriter
    FileHtmlWriter
    REQUIRED_HEADERS MessageViewer_htmlwriter_HEADERS
    PREFIX MessageViewer
    RELATIVE htmlwriter
    )
475

Laurent Montel's avatar
Laurent Montel committed
476
ecm_generate_headers(MessageViewer_Camelcaseadblockcommon_HEADERS
Laurent Montel's avatar
Laurent Montel committed
477 478 479 480 481 482 483
    HEADER_NAMES
    AdBlockListWidget
    AdBlockSettingWidget
    REQUIRED_HEADERS MessageViewer_adblockcommon_HEADERS
    PREFIX MessageViewer
    RELATIVE adblock/common
    )
Laurent Montel's avatar
Laurent Montel committed
484 485


486
ecm_generate_headers(MessageViewer_Camelcaseadblock_HEADERS
Laurent Montel's avatar
Laurent Montel committed
487 488 489 490 491 492 493
    HEADER_NAMES
    AdBlockBlockableItemsDialog
    AdBlockManager
    REQUIRED_HEADERS MessageViewer_adblock_HEADERS
    PREFIX MessageViewer
    RELATIVE adblock
    )
494 495

ecm_generate_headers(MessageViewer_Camelcaseviewerplugin_HEADERS
Laurent Montel's avatar
Laurent Montel committed
496 497 498 499 500 501 502 503 504
    HEADER_NAMES
    ViewerPluginManager
    ViewerPlugin
    ViewerPluginInterface
    ViewerPluginToolManager
    REQUIRED_HEADERS MessageViewer_viewerplugin_HEADERS
    PREFIX MessageViewer
    RELATIVE viewerplugins
    )
505 506

ecm_generate_headers(MessageViewer_Camelcaseviewerjob_HEADERS
Laurent Montel's avatar
Laurent Montel committed
507 508 509 510 511 512 513 514
    HEADER_NAMES
    CreateTodoJob
    CreateNoteJob
    CreateEventJob
    REQUIRED_HEADERS MessageViewer_viewerjob_HEADERS
    PREFIX MessageViewer
    RELATIVE job
    )
515 516 517 518

ecm_generate_pri_file(BASE_NAME MessageViewer
    LIB_NAME KF5MessageViewer
    DEPS "PimCommon MessageCore AkonadiCore AkonadiMime Contacts Libkleo" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/MessageViewer
Laurent Montel's avatar
Laurent Montel committed
519
    )
520

Laurent Montel's avatar
Laurent Montel committed
521

522
install(FILES
Laurent Montel's avatar
Laurent Montel committed
523
    ${MessageViewer_Camelcasewebengine_urlinterceptor_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
524
    ${MessageViewer_Camelcasewebengine_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
525
    ${MessageViewer_CamelfindbarWebEngine_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
526
    ${MessageViewer_Camelcasewebviewer_HEADERS}
527 528 529 530 531 532 533 534 535 536 537 538
    ${MessageViewer_Camelcaseheader_HEADERS}
    ${MessageViewer_Camelcaseviewerplugin_HEADERS}
    ${MessageViewer_Camelcasesettings_HEADERS}
    ${MessageViewer_Camelcaseadblock_HEADERS}
    ${MessageViewer_Camelcasehtmlwriter_HEADERS}
    ${MessageViewer_Camelcaseutils_HEADERS}
    ${MessageViewer_Camelcaseinterfaces_HEADERS}
    ${MessageViewer_Camelcaseviewer_HEADERS}
    ${MessageViewer_Camelcasewidgets_HEADERS}
    ${MessageViewer_Camelcasemain_HEADERS}
    ${MessageViewer_Camelcaseviewerjob_HEADERS}
    ${MessageViewer_Camelcaseantispam_HEADERS}
539
    ${MessageViewer_Camelfindbar_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
540
    ${MessageViewer_Camelcaseadblockcommon_HEADERS}
541 542
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MessageViewer
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
543
    )
544 545

install(FILES
Laurent Montel's avatar
Laurent Montel committed
546
    ${MessageViewer_webengine_urlinterceptor_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
547
    ${MessageViewer_webengine_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
548
    ${MessageViewer_findbarWebEngine_HEADERS}
Raymond Wooninck's avatar
Typo  
Raymond Wooninck committed
549
    ${MessageViewer_adblockcommon_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
550
    ${MessageViewer_webviewer_HEADERS}
551 552 553 554 555 556 557 558 559 560 561 562 563
    ${MessageViewer_viewerplugin_HEADERS}
    ${MessageViewer_settings_HEADERS}
    ${MessageViewer_adblock_HEADERS}
    ${MessageViewer_htmlwriter_HEADERS}
    ${MessageViewer_header_HEADERS}
    ${MessageViewer_utils_HEADERS}
    ${MessageViewer_interfaces_HEADERS}
    ${MessageViewer_HEADERS}
    ${MessageViewer_viewer_HEADERS}
    ${MessageViewer_main_HEADERS}
    ${MessageViewer_widgets_HEADERS}
    ${MessageViewer_viewerjob_HEADERS}
    ${MessageViewer_antispam_HEADERS}
564
    ${MessageViewer_findbar_HEADERS}
565 566 567 568 569 570 571
    ${CMAKE_CURRENT_BINARY_DIR}/messageviewer_export.h
    ${CMAKE_CURRENT_BINARY_DIR}/globalsettings_messageviewer.h
    ${CMAKE_CURRENT_BINARY_DIR}/messageviewer_debug.h
    ${CMAKE_CURRENT_BINARY_DIR}/ui_settings_adblock.h

    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/messageviewer
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
572
    )
573 574 575 576 577 578 579 580 581 582 583

install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})


install(FILES header/data/messageviewer_header_themes.knsrc DESTINATION ${KDE_INSTALL_CONFDIR} )

install(FILES notify/messageviewer.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
install(FILES scamdetection/data/longurlServices.json DESTINATION ${KDE_INSTALL_DATADIR}/messageviewer )

584 585 586
Project(Otp)

set(libotp_SRCS
Laurent Montel's avatar
Laurent Montel committed
587 588 589
    ${libmessageviewer_otp_SRCS}
    ${libmessageviewer_otp_extra_SRCS}
    )
590 591 592
ecm_qt_declare_logging_category(libotp_SRCS HEADER messageviewer_debug.h IDENTIFIER MESSAGEVIEWER_LOG CATEGORY_NAME log_messageviewer)

add_library(KF5Otp
Laurent Montel's avatar
Laurent Montel committed
593 594
    ${libotp_SRCS}
    )
595 596 597 598
generate_export_header(KF5Otp BASE_NAME otp)
add_library(KF5::Otp ALIAS KF5Otp)

target_link_libraries(KF5Otp
Laurent Montel's avatar
Laurent Montel committed
599 600 601 602 603 604 605 606 607 608
    PUBLIC
    KF5::MessageCore #NodeHelper, StringUtils, Settings
    KF5::PimCommon #AttachmentTemporaryFile handling
    KF5::Libkleo
    PRIVATE
    KF5::Mime
    KF5::IconThemes
    ${libmessageviewer_web_LIB}
    Grantlee5::TextDocument
    )
609 610 611 612

install(TARGETS
    KF5Otp
    EXPORT KF5OtpTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS} ${LIBRARY_NAMELINK}
Laurent Montel's avatar
Laurent Montel committed
613
    )
614 615 616 617 618

set_target_properties(KF5Otp PROPERTIES
    VERSION ${MESSAGEVIEWER_VERSION_STRING}
    SOVERSION ${MESSAGEVIEWER_SOVERSION}
    EXPORT_NAME Otp
Laurent Montel's avatar
Laurent Montel committed
619
    )