CMakeLists.txt 9.92 KB
Newer Older
Daniel Vrátil's avatar
Daniel Vrátil committed
1
2
3
4
5
6
7
8
9
10
11
12

set(akonadicore_base_SRCS
    agentinstance.cpp
    agentmanager.cpp
    agenttype.cpp
    asyncselectionhandler.cpp
    attribute.cpp
    attributefactory.cpp
    cachepolicy.cpp
    changemediator_p.cpp
    changenotificationdependenciesfactory.cpp
    changerecorder.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
13
    changerecorder_p.cpp
14
    connectionthread.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
15
    collection.cpp
Sandro Knauß's avatar
Sandro Knauß committed
16
    collectioncolorattribute.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
17
18
19
20
21
22
23
24
    collectionfetchscope.cpp
    collectionpathresolver.cpp
    collectionquotaattribute.cpp
    collectionquotaattribute.cpp
    collectionrightsattribute.cpp
    collectionstatistics.cpp
    collectionsync.cpp
    conflicthandler.cpp
Laurent Montel's avatar
Laurent Montel committed
25
    collectionidentificationattribute.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
26
27
28
29
30
    control.cpp
    entityannotationsattribute.cpp
    entitycache.cpp
    entitydeletedattribute.cpp
    entitydeletedattribute.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
31
    entitydisplayattribute.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
32
33
34
35
36
37
    entityhiddenattribute.cpp
    exception.cpp
    firstrun.cpp
    gidextractor.cpp
    indexpolicyattribute.cpp
    item.cpp
38
    itemchangelog.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
39
40
41
42
43
44
45
46
47
    itemfetchscope.cpp
    itemmonitor.cpp
    itemserializer.cpp
    itemserializerplugin.cpp
    itemsync.cpp
    kdsignalblocker.cpp
    mimetypechecker.cpp
    monitor.cpp
    monitor_p.cpp
48
    newmailnotifierattribute.cpp
49
50
    notificationbus_p.cpp
    notificationsource_p.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
51
52
53
54
    partfetcher.cpp
    pastehelper.cpp
    persistentsearchattribute.cpp
    pluginloader.cpp
Laurent Montel's avatar
Laurent Montel committed
55
    pop3resourceattribute.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
56
    protocolhelper.cpp
57
58
    relation.cpp
    relationsync.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
59
60
61
62
    searchquery.cpp
    servermanager.cpp
    session.cpp
    specialcollectionattribute.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
63
    specialcollections.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
64
65
66
    tag.cpp
    tagattribute.cpp
    tagfetchscope.cpp
67
    tagsync.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
68
69
70
71
    trashsettings.cpp
    typepluginloader.cpp
)

72
73
ecm_generate_headers(AkonadiCore_base_HEADERS
    HEADER_NAMES
Laurent Montel's avatar
Laurent Montel committed
74
    AbstractDifferencesReporter
75
76
77
78
79
80
81
82
    AgentInstance
    AgentManager
    AgentType
    Attribute
    AttributeFactory
    CachePolicy
    ChangeRecorder
    Collection
Sandro Knauß's avatar
Sandro Knauß committed
83
    CollectionColorAttribute
84
85
86
    CollectionFetchScope
    CollectionQuotaAttribute
    CollectionStatistics
87
    CollectionUtils
Laurent Montel's avatar
Laurent Montel committed
88
    CollectionIdentificationAttribute
89
    Control
Laurent Montel's avatar
Laurent Montel committed
90
    DifferencesAlgorithmInterface
91
92
    EntityAnnotationsAttribute
    EntityDeletedAttribute
Sergio Martins's avatar
Sergio Martins committed
93
    EntityDisplayAttribute
94
95
    EntityHiddenAttribute
    Exception
Laurent Montel's avatar
Laurent Montel committed
96
    GidExtractorInterface
97
98
99
100
101
102
103
104
    IndexPolicyAttribute
    Item
    ItemFetchScope
    ItemMonitor
    ItemSerializerPlugin
    ItemSync
    KDSignalBlocker
    MimeTypeChecker
105
    NewMailNotifierAttribute
106
107
108
    Monitor
    PartFetcher
    PersistentSearchAttribute
Laurent Montel's avatar
Laurent Montel committed
109
    Pop3ResourceAttribute
Daniel Vrátil's avatar
Daniel Vrátil committed
110
    Relation
111
112
113
114
    SearchQuery
    ServerManager
    Session
    SpecialCollections
115
    SpecialCollectionAttribute
116
    Supertrait
117
118
119
120
    Tag
    TagAttribute
    TagFetchScope
    TrashSettings
121
    CollectionPathResolver
122
    VectorHelper
123
124
125
    REQUIRED_HEADERS AkonadiCore_base_HEADERS
)

Daniel Vrátil's avatar
Daniel Vrátil committed
126
127
128
129
130
131
132
133
134
135
136
137
138
139
set(akonadicore_models_SRCS
    models/agentfilterproxymodel.cpp
    models/agentinstancemodel.cpp
    models/agenttypemodel.cpp
    models/collectionfilterproxymodel.cpp
    models/collectionmodel.cpp
    models/collectionmodel_p.cpp
    models/entitymimetypefiltermodel.cpp
    models/entityorderproxymodel.cpp
    models/entityrightsfiltermodel.cpp
    models/entitytreemodel.cpp
    models/entitytreemodel_p.cpp
    models/favoritecollectionsmodel.cpp
    models/itemmodel.cpp
140
    models/quotacolorproxymodel.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
141
142
143
144
145
146
147
148
149
    models/recursivecollectionfilterproxymodel.cpp
    models/selectionproxymodel.cpp
    models/statisticsproxymodel.cpp
    models/subscriptionmodel.cpp
    models/tagmodel.cpp
    models/tagmodel_p.cpp
    models/trashfilterproxymodel.cpp
)

150
151
152
153
154
155
ecm_generate_headers(AkonadiCore_models_HEADERS
    HEADER_NAMES
    AgentFilterProxyModel
    AgentInstanceModel
    AgentTypeModel
    CollectionFilterProxyModel
Laurent Montel's avatar
Laurent Montel committed
156
    EntityMimeTypeFilterModel
157
158
159
160
161
    EntityOrderProxyModel
    EntityRightsFilterModel
    EntityTreeModel
    FavoriteCollectionsModel
    ItemModel
162
    QuotaColorProxyModel
163
164
165
166
167
168
169
170
171
    RecursiveCollectionFilterProxyModel
    SelectionProxyModel
    StatisticsProxyModel
    TagModel
    TrashFilterProxyModel
    REQUIRED_HEADERS AkonadiCore_models_HEADERS
    RELATIVE models
)

Daniel Vrátil's avatar
Daniel Vrátil committed
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
set(akonadicore_jobs_SRCS
    jobs/agentinstancecreatejob.cpp
    jobs/collectionattributessynchronizationjob.cpp
    jobs/collectioncopyjob.cpp
    jobs/collectioncreatejob.cpp
    jobs/collectiondeletejob.cpp
    jobs/collectionfetchjob.cpp
    jobs/collectionmodifyjob.cpp
    jobs/collectionmovejob.cpp
    jobs/collectionstatisticsjob.cpp
    jobs/invalidatecachejob.cpp
    jobs/itemcopyjob.cpp
    jobs/itemcreatejob.cpp
    jobs/itemdeletejob.cpp
    jobs/itemfetchjob.cpp
    jobs/itemmodifyjob.cpp
    jobs/itemmovejob.cpp
    jobs/itemsearchjob.cpp
    jobs/job.cpp
    jobs/kjobprivatebase.cpp
    jobs/linkjob.cpp
    jobs/recursiveitemfetchjob.cpp
    jobs/resourceselectjob.cpp
    jobs/resourcesynchronizationjob.cpp
196
197
198
    jobs/relationfetchjob.cpp
    jobs/relationcreatejob.cpp
    jobs/relationdeletejob.cpp
Daniel Vrátil's avatar
Daniel Vrátil committed
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
    jobs/searchcreatejob.cpp
    jobs/searchresultjob.cpp
    jobs/specialcollectionsdiscoveryjob.cpp
    jobs/specialcollectionshelperjobs.cpp
    jobs/specialcollectionsrequestjob.cpp
    jobs/subscriptionjob.cpp
    jobs/tagcreatejob.cpp
    jobs/tagdeletejob.cpp
    jobs/tagfetchjob.cpp
    jobs/tagmodifyjob.cpp
    jobs/transactionjobs.cpp
    jobs/transactionsequence.cpp
    jobs/trashjob.cpp
    jobs/trashrestorejob.cpp
    jobs/unlinkjob.cpp
214
)
Daniel Vrátil's avatar
Daniel Vrátil committed
215

216
217
218
219
220
221
ecm_generate_headers(AkonadiCore_jobs_HEADERS
    HEADER_NAMES
    AgentInstanceCreateJob
    CollectionAttributesSynchronizationJob
    CollectionCopyJob
    CollectionCreateJob
Laurent Montel's avatar
Laurent Montel committed
222
    CollectionDeleteJob
223
224
225
226
227
228
229
230
231
    CollectionFetchJob
    CollectionModifyJob
    CollectionMoveJob
    CollectionStatisticsJob
    ItemCopyJob
    ItemCreateJob
    ItemDeleteJob
    ItemFetchJob
    ItemModifyJob
Sergio Martins's avatar
Sergio Martins committed
232
    ItemMoveJob
233
234
235
236
237
    ItemSearchJob
    Job
    LinkJob
    RecursiveItemFetchJob
    ResourceSynchronizationJob
Daniel Vrátil's avatar
Daniel Vrátil committed
238
239
240
    RelationFetchJob
    RelationCreateJob
    RelationDeleteJob
241
242
243
244
245
246
247
248
249
250
251
252
253
254
    SearchCreateJob
    SpecialCollectionsDiscoveryJob
    SpecialCollectionsRequestJob
    TagCreateJob
    TagDeleteJob
    TagFetchJob
    TagModifyJob
    TransactionJobs
    TransactionSequence
    TrashJob
    TrashRestoreJob
    UnlinkJob
    REQUIRED_HEADERS AkonadiCore_jobs_HEADERS
    RELATIVE jobs
Daniel Vrátil's avatar
Daniel Vrátil committed
255
256
)

257
258
259
260
261
262
263
264
265
266
267
# This is a workaround for conflict between our "Exception" fancy header and
# C++ stdlib's "exception" header which occurs in case-insensitive systems.
# For that reason we generate std_exception.h file, which contains an absolute
# path to the stdlib's exception header file, which resolves the ambiguity
# when including <exception> from within Akonadi.
include(FindStdlibInclude)
findStdlibInclude("exception" std_exception_file)
if (NOT "${std_exception_file}" STREQUAL "")
    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/std_exception.h.in
                   ${CMAKE_CURRENT_BINARY_DIR}/std_exception.h
    )
268
269
else()
    message(FATAL_ERROR "stdlib <exception> include absolute path not found")
270
271
endif()

Daniel Vrátil's avatar
Daniel Vrátil committed
272
set(akonadicore_dbus_xml ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.NotificationManager.xml)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
273
qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationmanagerinterface)
Daniel Vrátil's avatar
Daniel Vrátil committed
274

275
set(akonadicore_dbus_xml ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.NotificationSource.xml)
276
set_source_files_properties(${akonadicore_dbus_xml} PROPERTIES INCLUDE "${Akonadi_SOURCE_DIR}/src/private/protocol_p.h" )
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
277
qt5_add_dbus_interface(akonadicore_dbus_SRCS ${akonadicore_dbus_xml} notificationsourceinterface)
Daniel Vrátil's avatar
Daniel Vrátil committed
278

Daniel Vrátil's avatar
Daniel Vrátil committed
279
280
281
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.AgentManager.xml)
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.Tracer.xml)
qt5_add_dbus_interfaces(akonadicore_dbus_SRCS ${Akonadi_SOURCE_DIR}/src/interfaces/org.freedesktop.Akonadi.Agent.Control.xml)
Daniel Vrátil's avatar
Daniel Vrátil committed
282

Daniel Vrátil's avatar
Daniel Vrátil committed
283
284
285
286
set(akonadicore_SRCS
    ${akonadicore_base_SRCS}
    ${akonadicore_jobs_SRCS}
    ${akonadicore_models_SRCS}
Daniel Vrátil's avatar
Daniel Vrátil committed
287
    ${akonadicore_dbus_SRCS}
Daniel Vrátil's avatar
Daniel Vrátil committed
288
289
)

290
ecm_qt_declare_logging_category(akonadicore_SRCS HEADER akonadicore_debug.h IDENTIFIER AKONADICORE_LOG CATEGORY_NAME log_akonadicore)
291

Daniel Vrátil's avatar
Daniel Vrátil committed
292
293
294
295
296
add_library(KF5AkonadiCore ${akonadicore_SRCS})

generate_export_header(KF5AkonadiCore BASE_NAME akonadicore)

add_library(KF5::AkonadiCore ALIAS KF5AkonadiCore)
297
298
target_include_directories(KF5AkonadiCore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiCore;${Boost_INCLUDE_DIR}>")
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${Akonadi_SOURCE_DIR}/src/core;${Akonadi_BINARY_DIR}/src/core;${Akonadi_BINARY_DIR}/src/private>")
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
299
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${Akonadi_BINARY_DIR};${Akonadi_SOURCE_DIR}/src/core/jobs;${Akonadi_SOURCE_DIR}/src/core/models>")
300
target_include_directories(KF5AkonadiCore PUBLIC "$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>")
Daniel Vrátil's avatar
Daniel Vrátil committed
301

302
303
kde_target_enable_exceptions(KF5AkonadiCore PUBLIC)

Daniel Vrátil's avatar
Daniel Vrátil committed
304
target_link_libraries(KF5AkonadiCore
305
PUBLIC
306
    KF5::CoreAddons # for KJob
Daniel Vrátil's avatar
Daniel Vrátil committed
307
    KF5::ItemModels
308
309
    Qt5::Gui # for QColor
PRIVATE
310
311
    Qt5::Widgets
    Qt5::Network
312
    KF5::AkonadiPrivate
313
    KF5::DBusAddons
314
315
    KF5::I18n
    KF5::IconThemes
Volker Krause's avatar
Volker Krause committed
316
    KF5::ConfigCore
317
    KF5AkonadiPrivate
Daniel Vrátil's avatar
Daniel Vrátil committed
318
319
320
)

set_target_properties(KF5AkonadiCore PROPERTIES
321
322
    VERSION ${AKONADI_VERSION_STRING}
    SOVERSION ${AKONADI_SOVERSION}
Daniel Vrátil's avatar
Daniel Vrátil committed
323
324
325
    EXPORT_NAME AkonadiCore
)

326
327
ecm_generate_pri_file(BASE_NAME AkonadiCore
    LIB_NAME KF5AkonadiCore
Volker Krause's avatar
Volker Krause committed
328
    DEPS "ItemModels CoreAddons" FILENAME_VAR PRI_FILENAME
329
)
Daniel Vrátil's avatar
Daniel Vrátil committed
330

331
332
install(TARGETS
    KF5AkonadiCore
333
    EXPORT KF5AkonadiTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
334
)
Daniel Vrátil's avatar
Daniel Vrátil committed
335
336

install(FILES
337
    ${CMAKE_CURRENT_BINARY_DIR}/akonadicore_export.h
338
    ${CMAKE_CURRENT_BINARY_DIR}/std_exception.h
339
340
341
    ${AkonadiCore_base_HEADERS}
    ${AkonadiCore_models_HEADERS}
    ${AkonadiCore_jobs_HEADERS}
Daniel Vrátil's avatar
Daniel Vrátil committed
342
    ${AkonadiCore_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
343
    qtest_akonadi.h
344
    itempayloadinternals_p.h
345
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/AkonadiCore COMPONENT Devel
346
)
Daniel Vrátil's avatar
Daniel Vrátil committed
347

348
349
350
351
install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR}
)
Laurent Montel's avatar
Laurent Montel committed
352
353
354

install( FILES
    kcfg2dbus.xsl
355
    DESTINATION ${KDE_INSTALL_DATADIR_KF5}/akonadi
Laurent Montel's avatar
Laurent Montel committed
356
)