CMakeLists.txt 3.14 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
set(mailtransport_lib_srcs
    transport.cpp
    transportmanager.cpp
    transporttype.cpp
    transportjob.cpp
    smtpjob.cpp
    precommandjob.cpp
    socket.cpp
    servertest.cpp
    )

set(mailtransport_widgets_srcs
    widgets/transportconfigwidget.cpp
    widgets/addtransportdialog.cpp
    widgets/transportcombobox.cpp
    widgets/transportlistview.cpp
    widgets/transportmanagementwidget.cpp
    widgets/transportconfigdialog.cpp
    widgets/smtpconfigwidget.cpp
    )

ecm_qt_declare_logging_category(mailtransport_lib_srcs HEADER mailtransport_debug.h IDENTIFIER MAILTRANSPORT_LOG CATEGORY_NAME org.kde.pim.mailtransport)

ki18n_wrap_ui(mailtransport_lib_srcs
    ui/addtransportdialog.ui
    ui/transportmanagementwidget.ui
    ui/smtpsettings.ui
    )

kconfig_add_kcfg_files(mailtransport_lib_srcs transportbase.kcfgc)

add_library(KF5MailTransport ${mailtransport_lib_srcs}
    ${mailtransport_widgets_srcs}
    ${mailtransport_kmailtransportakonadi_srcs}
    )

generate_export_header(KF5MailTransport BASE_NAME mailtransport)

add_library(KF5::MailTransport ALIAS KF5MailTransport)


target_include_directories(KF5MailTransport INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/MailTransport;${KDE_INSTALL_INCLUDEDIR_KF5}/mailtransport>")
target_include_directories(KF5MailTransport PUBLIC "$<BUILD_INTERFACE:${MailTransport_SOURCE_DIR}/src;${MailTransport_BINARY_DIR}/src>")


target_link_libraries(KF5MailTransport
    PUBLIC
    KF5::Wallet
    PRIVATE
    KF5::I18n
    KF5::KIOCore
    KF5::ConfigGui
    KF5::WidgetsAddons
    KF5::CoreAddons
    KF5::Wallet
    KF5::ConfigWidgets
    Qt5::DBus
    Qt5::Network
    KF5::Completion
    )

set_target_properties(KF5MailTransport PROPERTIES
    VERSION ${MAILTRANSPORT_VERSION_STRING}
    SOVERSION ${MAILTRANSPORT_SOVERSION}
    EXPORT_NAME MailTransport
    )


install(TARGETS KF5MailTransport EXPORT KF5MailTransportTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS})

install(FILES mailtransport.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})


ecm_generate_headers(MailTransport_CamelCase_HEADERS
    HEADER_NAMES
    PrecommandJob
    ServerTest
    SmtpJob
    Transport
    TransportJob
    TransportManager
    TransportType
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_HEADERS
    )

ecm_generate_headers(MailTransport_widgets_CamelCase_HEADERS
    HEADER_NAMES
    TransportComboBox
    TransportManagementWidget
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_widgets_HEADERS
    RELATIVE widgets
    )

install(FILES
    ${MailTransport_CamelCase_HEADERS}
    ${MailTransport_widgets_CamelCase_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MailTransport/ COMPONENT Devel )

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/mailtransport_export.h
    ${MailTransport_HEADERS}
    ${MailTransport_widgets_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/transportbase.h

    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/mailtransport COMPONENT Devel
    )

ecm_generate_pri_file(BASE_NAME KMailTransport LIB_NAME KF5MailTransport DEPS "Wallet" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/MailTransport/)
install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR})