CMakeLists.txt 7.85 KB
Newer Older
1
2
include_directories(${CMAKE_CURRENT_SOURCE_DIR})

Laurent Montel's avatar
Laurent Montel committed
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
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5PimCommonAkonadi")

configure_package_config_file(
    "${CMAKE_CURRENT_SOURCE_DIR}/KF5PimCommonAkonadiConfig.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonAkonadiConfig.cmake"
    INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
    )


ecm_setup_version(PROJECT VARIABLE_PREFIX PIMCOMMON
    VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/pimcommonakonadi_version.h"
    PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonAkonadiConfigVersion.cmake"
    SOVERSION 5
    )

install(FILES
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonAkonadiConfig.cmake"
    "${CMAKE_CURRENT_BINARY_DIR}/KF5PimCommonAkonadiConfigVersion.cmake"
    DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
    COMPONENT Devel
    )

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

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/pimcommonakonadi_version.h
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
    )


33
34
35
36
37
38
39
set(libpimcommonakonadi_folderdialog_SRCS
    folderdialog/selectmulticollectionwidget.cpp
    folderdialog/selectmulticollectiondialog.cpp
    folderdialog/checkedcollectionwidget.cpp
    )


Laurent Montel's avatar
Laurent Montel committed
40
41
42
43
44
set(libpimcommonakonadi_generericplugin_SRCS
    genericplugins/genericplugininterface.cpp
    genericplugins/plugininterface.cpp
    )

45
46
47
48
49
50
51
52
53
54
55
set(libpimcommonakonadi_acl_SRCS
    acl/aclentrydialog.cpp
    acl/aclmanager.cpp
    acl/aclutils.cpp
    acl/collectionaclpage.cpp
    acl/imapaclattribute.cpp
    acl/collectionaclwidget.cpp
    acl/acllistview.cpp
    acl/aclmodifyjob.cpp
    )

Laurent Montel's avatar
Laurent Montel committed
56
57
58
59
60
61
62
63
64
set(libpimcommonakonadi_manageserversidesubscription_SRCS
    manageserversidesubscription/manageserversidesubscriptionjob.cpp
    )

set(libpimcommonakonadi_widgets_SRCS
    widgets/annotationdialog.cpp
    )

set(libpimcommon_job_SRCS
Laurent Montel's avatar
Laurent Montel committed
65
66
    job/fetchrecursivecollectionsjob.cpp
    )
Laurent Montel's avatar
Laurent Montel committed
67
68
69
70
71
72
73

set(libpimcommonakonadi_util_SRCS
    util/createresource.cpp
    util/imapresourcecapabilitiesmanager.cpp
    util/mailutil.cpp
    )

74
75
76
77
78
79
80
81
set(libpimcommonakonadi_collection_SRCS
  collectionpage/collectiontypeutil.cpp
  collectionpage/attributeregistrar.cpp
  collectionpage/attributes/collectionannotationsattribute.cpp
  collectionpage/incidencesforwidget.cpp
  collectionpage/contenttypewidget.cpp
)

Laurent Montel's avatar
Laurent Montel committed
82

83
set(libpimcommonakonadi_SRCS
84
    ${libpimcommonakonadi_collection_SRCS}
85
86
    ${libpimcommonakonadi_acl_SRCS}
    ${libpimcommonakonadi_folderdialog_SRCS}
Laurent Montel's avatar
Laurent Montel committed
87
    ${libpimcommonakonadi_generericplugin_SRCS}
Laurent Montel's avatar
Laurent Montel committed
88
89
90
91
92
    ${libpimcommonakonadi_configure_plugins_SRCS}
    ${libpimcommonakonadi_manageserversidesubscription_SRCS}
    ${libpimcommonakonadi_widgets_SRCS}
    ${libpimcommonakonadi_util_SRCS}
    ${libpimcommon_job_SRCS}
93
94
    )

Laurent Montel's avatar
Laurent Montel committed
95

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
ecm_qt_declare_logging_category(libpimcommonakonadi_SRCS HEADER pimcommonakonadi_debug.h IDENTIFIER PIMCOMMONAKONADI_LOG CATEGORY_NAME org.kde.pim.pimcommonakonadi)


add_library(KF5PimCommonAkonadi ${libpimcommonakonadi_SRCS})
generate_export_header(KF5PimCommonAkonadi BASE_NAME pimcommonakonadi)
add_library(KF5::PimCommonAkonadi ALIAS KF5PimCommonAkonadi)

target_link_libraries(KF5PimCommonAkonadi
    PUBLIC
    KF5::PimCommon
    KF5::AkonadiCore
    KF5::AkonadiWidgets
    KF5::Contacts
    KF5::AkonadiContact
    KF5::KIOCore
    KF5::ConfigWidgets
Laurent Montel's avatar
Laurent Montel committed
112
    KF5::IMAP
113
114
    PRIVATE
    KF5::I18n
Laurent Montel's avatar
Laurent Montel committed
115
    KF5::LibkdepimAkonadi
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
    KF5::Codecs
    KF5::PimTextEdit
    KF5::XmlGui
    KF5::PimTextEdit
    KF5::KIOWidgets
    )

target_include_directories(KF5PimCommonAkonadi INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommonAkonadi/;${KDE_INSTALL_INCLUDEDIR_KF5}/pimcommonakonadi>")

target_include_directories(KF5PimCommonAkonadi PUBLIC "$<BUILD_INTERFACE:${pimcommon_SOURCE_DIR}/src;${pimcommon_BINARY_DIR}/src>")

set_target_properties(KF5PimCommonAkonadi PROPERTIES
    VERSION ${PIMCOMMON_VERSION_STRING}
    SOVERSION ${PIMCOMMON_SOVERSION}
    EXPORT_NAME PimCommonAkonadi
    )

Laurent Montel's avatar
Laurent Montel committed
133

134
135
install(TARGETS
    KF5PimCommonAkonadi
Laurent Montel's avatar
Laurent Montel committed
136
    EXPORT KF5PimCommonAkonadiTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}  ${LIBRARY_NAMELINK}
137
138
139
140
141
    )

if (BUILD_TESTING)
    add_subdirectory(acl/autotests)
    add_subdirectory(folderdialog/tests/)
142
    add_subdirectory(collectionpage/autotests/)
143
144
endif()

145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
ecm_generate_headers(PimCommonAkonadi_Camelcasecollectionpage_HEADERS
  HEADER_NAMES
  IncidencesForWidget
  CollectionTypeUtil
  ContentTypeWidget
  REQUIRED_HEADERS PimCommonAkonadi_collectionpage_HEADERS
  PREFIX PimCommonAkonadi
  RELATIVE collectionpage
)

ecm_generate_headers(PimCommonAkonadi_Camelcasecollectionpageattributes_HEADERS
  HEADER_NAMES
  CollectionAnnotationsAttribute
  REQUIRED_HEADERS PimCommonAkonadi_collectionpageattributes_HEADERS
  PREFIX PimCommonAkonadi
  RELATIVE collectionpage/attributes
)


Laurent Montel's avatar
Laurent Montel committed
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
ecm_generate_headers(PimCommonAkonadiUtil_CamelCase_HEADERS
    HEADER_NAMES
    CreateResource
    ImapResourceCapabilitiesManager
    MailUtil
    REQUIRED_HEADERS PimCommonAkonadiUtil_HEADERS
    PREFIX PimCommonAkonadi
    RELATIVE util
    )

ecm_generate_headers(PimCommon_CamelCasejob_HEADERS
    HEADER_NAMES
    FetchRecursiveCollectionsJob
    REQUIRED_HEADERS PimCommon_job_HEADERS
    PREFIX PimCommonAkonadi
    RELATIVE job
    )


ecm_generate_headers(PimCommonAkonadi_Camelcasewidgets_HEADERS
    HEADER_NAMES
    AnnotationDialog
    REQUIRED_HEADERS PimCommonAkonadi_widgets_HEADERS
    PREFIX PimCommonAkonadi
    RELATIVE widgets
    )

ecm_generate_headers(PimCommon_Camelcasemanagerserversidesubscription_HEADERS
    HEADER_NAMES
    ManageServerSideSubscriptionJob
    REQUIRED_HEADERS PimCommon_managerserversidesubscription_HEADERS
    PREFIX PimCommonAkonadi
    RELATIVE manageserversidesubscription
    )
198
199
200
201
202
203

ecm_generate_headers(PimCommon_Camelcaseacl_HEADERS
    HEADER_NAMES
    CollectionAclPage
    ImapAclAttribute
    REQUIRED_HEADERS PimCommon_acl_HEADERS
Laurent Montel's avatar
Laurent Montel committed
204
    PREFIX PimCommonAkonadi
205
206
207
208
209
210
211
212
    RELATIVE acl
    )

ecm_generate_headers(PimCommon_Camelcasefolderdialog_HEADERS
    HEADER_NAMES
    CheckedCollectionWidget
    SelectMultiCollectionDialog
    REQUIRED_HEADERS PimCommon_folderdialog_HEADERS
Laurent Montel's avatar
Laurent Montel committed
213
    PREFIX PimCommonAkonadi
214
215
216
    RELATIVE folderdialog
    )

Laurent Montel's avatar
Laurent Montel committed
217
ecm_generate_headers(PimCommonAkonadi_CamelCasegenericplugins_HEADERS
Laurent Montel's avatar
Laurent Montel committed
218
219
    HEADER_NAMES
    PluginInterface
Laurent Montel's avatar
Laurent Montel committed
220
    GenericPluginInterface
221
    REQUIRED_HEADERS PimCommonAkonadi_genericplugins_HEADERS
Laurent Montel's avatar
Laurent Montel committed
222
    PREFIX PimCommonAkonadi
Laurent Montel's avatar
Laurent Montel committed
223
224
225
    RELATIVE genericplugins
    )

226
227
228
229
230
231
232
ecm_generate_pri_file(BASE_NAME PimCommonAkonadi
    LIB_NAME KF5PimCommonAkonadi
    DEPS "AkonadiCore AkonadiWidgets Contacts AkonadiContact Network KIOCore ConfigWidgets" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommonAkonadi
    )


install(FILES
233
234
    ${PimCommonAkonadi_Camelcasecollectionpage_HEADERS}
    ${PimCommonAkonadi_Camelcasecollectionpageattributes_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
235
    ${PimCommon_CamelCasejob_HEADERS}
236
237
    ${PimCommon_Camelcaseacl_HEADERS}
    ${PimCommon_Camelcasefolderdialog_HEADERS}
238
    ${PimCommonAkonadi_CamelCasegenericplugins_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
239
240
241
    ${PimCommon_Camelcasemanagerserversidesubscription_HEADERS}
    ${PimCommonAkonadi_Camelcasewidgets_HEADERS}
    ${PimCommonAkonadiUtil_CamelCase_HEADERS}
242
243
244
245
246
247
248
    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/PimCommonAkonadi
    COMPONENT Devel
    )

install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/pimcommonakonadi_export.h
    ${PimCommon_acl_HEADERS}
249
250
    ${PimCommonAkonadi_collectionpage_HEADERS}
    ${PimCommonAkonadi_collectionpageattributes_HEADERS}
251
    ${PimCommon_folderdialog_HEADERS}
252
    ${PimCommonAkonadi_genericplugins_HEADERS}
Laurent Montel's avatar
Laurent Montel committed
253
254
255
256
257
258
259
260
    ${PimCommon_serversidesubscription_HEADERS}
    ${PimCommonAkonadi_casewidgets_HEADERS}
    ${PimCommonAkonadi_widgets_HEADERS}
    ${PimCommon_managerserversidesubscription_HEADERS}
    ${PimCommon_job_HEADERS}
    ${PimCommonAkonadiUtil_HEADERS}

    DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/pimcommonakonadi
261
262
263
264
265
266
    COMPONENT Devel
    )

install(FILES
    ${PRI_FILENAME}
    DESTINATION ${ECM_MKSPECS_INSTALL_DIR})