CMakeLists.txt 4.95 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
ecm_setup_version(PROJECT VARIABLE_PREFIX MAILTRANSPORT
Laurent Montel's avatar
Laurent Montel committed
2
3
4
5
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/mailtransport_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5MailTransportConfigVersion.cmake"
    SOVERSION 5
    )
Laurent Montel's avatar
Laurent Montel committed
6

Laurent Montel's avatar
Laurent Montel committed
7
8
set(mailtransport_lib_smtp_srcs
    smtp/smtpjob.cpp
9
    smtp/smtpconfigwidget.cpp
Laurent Montel's avatar
Laurent Montel committed
10
11
    )

Laurent Montel's avatar
Laurent Montel committed
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
set(mailtransport_lib_srcs
    transport.cpp
    transportmanager.cpp
    transporttype.cpp
    transportjob.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
    )

31
32
set(mailtransport_plugins_srcs
    plugins/transportabstractplugin.cpp
33
    plugins/transportpluginmanager.cpp
34
35
    ) 

Laurent Montel's avatar
Laurent Montel committed
36
37
38
39
40
41
42
43
44
45
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)

Laurent Montel's avatar
Laurent Montel committed
46
47
add_library(KF5MailTransport
    ${mailtransport_lib_srcs}
Laurent Montel's avatar
Laurent Montel committed
48
    ${mailtransport_widgets_srcs}
Laurent Montel's avatar
Laurent Montel committed
49
    ${mailtransport_lib_smtp_srcs}
50
    ${mailtransport_plugins_srcs}
Laurent Montel's avatar
Laurent Montel committed
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
    )

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
    Transport
    TransportJob
    TransportManager
    TransportType
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_HEADERS
    )

Laurent Montel's avatar
Laurent Montel committed
100
101
102
103
104
105
106
107
108
ecm_generate_headers(MailTransport_smtp_CamelCase_HEADERS
    HEADER_NAMES
    SmtpJob
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_smtp_HEADERS
    RELATIVE smtp
    )


Laurent Montel's avatar
Laurent Montel committed
109
110
111
112
113
114
115
116
117
ecm_generate_headers(MailTransport_widgets_CamelCase_HEADERS
    HEADER_NAMES
    TransportComboBox
    TransportManagementWidget
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_widgets_HEADERS
    RELATIVE widgets
    )

Laurent Montel's avatar
Laurent Montel committed
118
119
120
121
122
123
124
125
ecm_generate_headers(MailTransport_plugins_CamelCase_HEADERS
    HEADER_NAMES
    TransportAbstractPlugin
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_plugins_HEADERS
    RELATIVE plugins
    )

Laurent Montel's avatar
Laurent Montel committed
126
127
128
install(FILES
    ${MailTransport_CamelCase_HEADERS}
    ${MailTransport_widgets_CamelCase_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
129
    ${MailTransport_smtp_CamelCase_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
130
    ${MailTransport_plugins_CamelCase_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
131
132
133
134
135
136
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MailTransport/ COMPONENT Devel )

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/mailtransport_export.h
    ${MailTransport_HEADERS}
    ${MailTransport_widgets_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
137
    ${MailTransport_smtp_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
138
    ${MailTransport_plugins_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
139
140
141
142
143
144
145
146
    ${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})

Laurent Montel's avatar
Laurent Montel committed
147
148
149
150

set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5MailTransport")

configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
151
152
153
154
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5MailTransportConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5MailTransportConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )
Laurent Montel's avatar
Laurent Montel committed
155
156

install(FILES
Laurent Montel's avatar
Laurent Montel committed
157
158
159
160
161
    "${CMAKE_CURRENT_BINARY_DIR}/KF5MailTransportConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5MailTransportConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
162
163
164
165

install(EXPORT KF5MailTransportTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5MailTransportTargets.cmake NAMESPACE KF5::)

install(FILES
Laurent Montel's avatar
Laurent Montel committed
166
167
168
    ${CMAKE_CURRENT_BINARY_DIR}/mailtransport_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
169
170
171
172
173


if(BUILD_TESTING)
    add_subdirectory(tests)
endif()
Laurent Montel's avatar
Laurent Montel committed
174
175

add_subdirectory(plugins/smtp)