CMakeLists.txt 4.86 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
9
10
11
12
13
14
15
16
17
18
19
20
21
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/transportcombobox.cpp
    widgets/transportlistview.cpp
    widgets/transportmanagementwidget.cpp
22
    widgets/addtransportdialogng.cpp
Laurent Montel's avatar
Laurent Montel committed
23
24
    )

25
26
set(mailtransport_plugins_srcs
    plugins/transportabstractplugin.cpp
27
    plugins/transportpluginmanager.cpp
28
29
    ) 

Laurent Montel's avatar
Laurent Montel committed
30

31
ecm_qt_declare_logging_category(mailtransport_lib_srcs HEADER mailtransport_debug.h IDENTIFIER MAILTRANSPORT_LOG CATEGORY_NAME org.kde.pim.mailtransport
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35
        DESCRIPTION "kmailtransport (kmailtransport)"
        OLD_CATEGORY_NAMES log_mailtransport
        EXPORT MAILTRANSPORT
    )
Laurent Montel's avatar
Laurent Montel committed
36
37
38
39
40
41
42
43

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

kconfig_add_kcfg_files(mailtransport_lib_srcs transportbase.kcfgc)

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

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
    )

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
    )

ecm_generate_headers(MailTransport_widgets_CamelCase_HEADERS
    HEADER_NAMES
    TransportComboBox
    TransportManagementWidget
Laurent Montel's avatar
Laurent Montel committed
100
    TransportConfigWidget
Laurent Montel's avatar
Laurent Montel committed
101
102
103
104
105
    PREFIX MailTransport
    REQUIRED_HEADERS MailTransport_widgets_HEADERS
    RELATIVE widgets
    )

Laurent Montel's avatar
Laurent Montel committed
106
107
108
109
110
111
112
113
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
114
115
116
117
install(FILES
    ${MailTransport_SOURCE_DIR}/src/kmailtransport/widgets/transportconfigwidget_p.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/mailtransport/private COMPONENT Devel )

Laurent Montel's avatar
Laurent Montel committed
118
119
120
install(FILES
    ${MailTransport_CamelCase_HEADERS}
    ${MailTransport_widgets_CamelCase_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
121
    ${MailTransport_plugins_CamelCase_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
122
123
124
125
126
127
    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
128
    ${MailTransport_plugins_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
129
130
131
132
133
134
135
136
    ${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
137
138
139
140

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

configure_package_config_file(
Laurent Montel's avatar
Laurent Montel committed
141
142
143
144
    "${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
145
146

install(FILES
Laurent Montel's avatar
Laurent Montel committed
147
148
149
150
151
    "${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
152
153
154
155

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

install(FILES
Laurent Montel's avatar
Laurent Montel committed
156
157
158
    ${CMAKE_CURRENT_BINARY_DIR}/mailtransport_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )
Laurent Montel's avatar
Laurent Montel committed
159
160
161
162


if(BUILD_TESTING)
    add_subdirectory(tests)
Laurent Montel's avatar
Laurent Montel committed
163
    add_subdirectory(plugins/tests)
Laurent Montel's avatar
Laurent Montel committed
164
endif()
Laurent Montel's avatar
Laurent Montel committed
165
166

add_subdirectory(plugins/smtp)