CMakeLists.txt 5.4 KB
Newer Older
1
2
3
add_definitions(-DTRANSLATION_DOMAIN=\"libmessagecore\")

########### next target ###############
4
set(messagecore_autocrypt_LIB_SRCS
5
    autocrypt/autocryptutils.cpp
6
    autocrypt/autocryptrecipient.cpp
7
    autocrypt/autocryptstorage.cpp
8
)
9
10

set(messagecore_attachment_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
11
12
13
14
15
16
17
18
19
20
21
    attachment/attachmentcompressjob.cpp
    attachment/attachmentfromfolderjob.cpp
    attachment/attachmentfrommimecontentjob.cpp
    attachment/attachmentfromurlbasejob.cpp
    attachment/attachmentfromurljob.cpp
    attachment/attachmentloadjob.cpp
    attachment/attachmentpart.cpp
    attachment/attachmentpropertiesdialog.cpp
    attachment/attachmentupdatejob.cpp
    attachment/attachmentfromurlutils.cpp
    )
22
23

set(messagecore_misc_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
24
25
26
    misc/imagecollector.cpp
    misc/mailinglist.cpp
    )
27
28
29


set(messagecore_helper_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
30
31
    helpers/nodehelper.cpp
    )
32

33
34
set(messagecore_utils_LIB_SRCS
    utils/stringutil.cpp
35
    utils/util.cpp
36
37
38
    utils/colorutil.cpp
    )

39
set(messagecore_LIB_SRCS
40
    ${messagecore_autocrypt_LIB_SRCS}
Laurent Montel's avatar
Laurent Montel committed
41
42
43
    ${messagecore_attachment_LIB_SRCS}
    ${messagecore_misc_LIB_SRCS}
    ${messagecore_helper_LIB_SRCS}
44
    ${messagecore_utils_LIB_SRCS}
Laurent Montel's avatar
Laurent Montel committed
45
46
    settings/messagecoresettings.cpp
    )
47
48

kconfig_add_kcfg_files(messagecore_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
49
50
    settings/globalsettings_messagecore.kcfgc
    )
51
52

ki18n_wrap_ui(messagecore_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
53
54
55
    attachment/ui/attachmentpropertiesdialog.ui
    attachment/ui/attachmentpropertiesdialog_readonly.ui
    )
56

57
ecm_qt_declare_logging_category(messagecore_LIB_SRCS HEADER messagecore_debug.h IDENTIFIER MESSAGECORE_LOG CATEGORY_NAME org.kde.pim.messagecore
Laurent Montel's avatar
Laurent Montel committed
58
59
60
61
62
        DESCRIPTION "messagelib (messagecore)"
        OLD_CATEGORY_NAMES log_messagecore
        EXPORT MESSAGELIB
    )

63
64
65
66
ecm_qt_declare_logging_category(messagecore_LIB_SRCS HEADER autocrypt_debug.h IDENTIFIER AUTOCRYPT_LOG CATEGORY_NAME org.kde.pim.messagecore.autocrypt
        DESCRIPTION "messagelib (messagecore.autocrypt)"
        EXPORT MESSAGELIB
    )
67
68

add_library(KF5MessageCore ${messagecore_LIB_SRCS})
Laurent Montel's avatar
Laurent Montel committed
69
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
70
71
72
    set_target_properties(KF5MessageCore PROPERTIES UNITY_BUILD ON)
endif()

73
74
75
76
generate_export_header(KF5MessageCore BASE_NAME messagecore)
add_library(KF5::MessageCore ALIAS KF5MessageCore)

target_link_libraries(KF5MessageCore
Laurent Montel's avatar
Laurent Montel committed
77
78
79
    PUBLIC
    KF5::Mime
    PRIVATE
80
    QGpgme
Laurent Montel's avatar
Laurent Montel committed
81
82
83
84
85
86
87
88
    KF5::KIOCore
    KF5::Codecs
    KF5::PimTextEdit
    KF5::Archive
    KF5::ConfigWidgets
    Qt5::Network
    KF5::I18n
    KF5::IdentityManagement
89
    KF5::MimeTreeParser
Laurent Montel's avatar
Laurent Montel committed
90
    KF5::PimCommon
Laurent Montel's avatar
Laurent Montel committed
91
    )
92
93
94
95
96
97
98

target_include_directories(KF5MessageCore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/MessageCore/;${KDE_INSTALL_INCLUDEDIR_KF5}/messagecore>")

set_target_properties(KF5MessageCore PROPERTIES
    VERSION ${MESSAGECORE_VERSION_STRING}
    SOVERSION ${MESSAGECORE_SOVERSION}
    EXPORT_NAME MessageCore
Laurent Montel's avatar
Laurent Montel committed
99
    )
100
101
102

install(TARGETS
    KF5MessageCore
103
    EXPORT KF5MessageCoreTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
Laurent Montel's avatar
Laurent Montel committed
104
    )
105
106

ecm_generate_headers(MessageCore_Camelcasemisc_HEADERS
Laurent Montel's avatar
Laurent Montel committed
107
108
109
    HEADER_NAMES
    ImageCollector
    MailingList
110

Laurent Montel's avatar
Laurent Montel committed
111
112
113
114
    REQUIRED_HEADERS MessageCore_misc_HEADERS
    PREFIX MessageCore
    RELATIVE misc
    )
115
116

ecm_generate_headers(MessageCore_Camelcaseutils_HEADERS
Laurent Montel's avatar
Laurent Montel committed
117
    HEADER_NAMES
118
    ColorUtil
Laurent Montel's avatar
Laurent Montel committed
119
    StringUtil
120
    Util
Laurent Montel's avatar
Laurent Montel committed
121
122
123
124
    REQUIRED_HEADERS MessageCore_utils_HEADERS
    PREFIX MessageCore
    RELATIVE utils
    )
125
126

ecm_generate_headers(MessageCore_Camelcasesettings_HEADERS
Laurent Montel's avatar
Laurent Montel committed
127
128
129
130
131
132
    HEADER_NAMES
    MessageCoreSettings
    REQUIRED_HEADERS MessageCore_settings_HEADERS
    PREFIX MessageCore
    RELATIVE settings
    )
133
134
135


ecm_generate_headers(MessageCore_Camelcaseattachment_HEADERS
Laurent Montel's avatar
Laurent Montel committed
136
137
138
139
140
141
    HEADER_NAMES
    AttachmentFromUrlBaseJob
    AttachmentPart
    AttachmentPropertiesDialog
    AttachmentCompressJob
    AttachmentUpdateJob
Sandro Knauß's avatar
Sandro Knauß committed
142
    AttachmentFromUrlUtils
143
    AttachmentLoadJob
Laurent Montel's avatar
Laurent Montel committed
144
145
146
147
148

    REQUIRED_HEADERS MessageCore_attachment_HEADERS
    PREFIX MessageCore
    RELATIVE attachment
    )
149
150

ecm_generate_headers(MessageCore_Camelcasehelpers_HEADERS
Laurent Montel's avatar
Laurent Montel committed
151
152
153
154
155
156
    HEADER_NAMES
    NodeHelper
    REQUIRED_HEADERS MessageCore_helpers_HEADERS
    PREFIX MessageCore
    RELATIVE helpers
    )
157

158
159
160
161
162
163
164
165
166
167
ecm_generate_headers(MessageCore_Camelcaseautocrypt_HEADERS
    HEADER_NAMES
    AutocryptRecipient
    AutocryptStorage
    AutocryptUtils
    REQUIRED_HEADERS MessageCore_autocrypt_HEADERS
    PREFIX MessageCore
    RELATIVE autocrypt
    )

168
169
ecm_generate_pri_file(BASE_NAME MessageCore
    LIB_NAME KF5MessageCore
Laurent Montel's avatar
Laurent Montel committed
170
    DEPS "KMime" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/MessageCore
Laurent Montel's avatar
Laurent Montel committed
171
    )
172
173


Laurent Montel's avatar
Laurent Montel committed
174

175
install(FILES
176
    ${MessageCore_Camelcaseautocrypt_HEADERS}
177
178
179
180
181
182
183
184
    ${MessageCore_Camelcasehelpers_HEADERS}
    ${MessageCore_Camelcasesettings_HEADERS}
    ${MessageCore_Camelcaseutils_HEADERS}
    ${MessageCore_Camelcaseattachment_HEADERS}
    ${MessageCore_Camelcasemisc_HEADERS}
    ${MessageCore_Camelcasemain_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/MessageCore
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
185
    )
186
187
188

install(FILES
    ${MessageCore_HEADERS}
189
    ${MessageCore_autocrypt_HEADERS}
190
191
192
193
194
195
196
197
198
199
    ${MessageCore_helpers_HEADERS}
    ${MessageCore_settings_HEADERS}
    ${MessageCore_utils_HEADERS}
    ${MessageCore_main_HEADERS}
    ${CMAKE_CURRENT_BINARY_DIR}/messagecore_export.h
    ${CMAKE_CURRENT_BINARY_DIR}/globalsettings_messagecore.h
    ${MessageCore_attachment_HEADERS}
    ${MessageCore_misc_HEADERS}
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/messagecore
    COMPONENT Devel
Laurent Montel's avatar
Laurent Montel committed
200
    )
201
202
203
204
install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})

Laurent Montel's avatar
Laurent Montel committed
205