CMakeLists.txt 11.8 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
add_definitions(-DTRANSLATION_DOMAIN=\"korganizer\")

3
include_directories(${CMAKE_CURRENT_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

if(BUILD_TESTING)
    add_subdirectory(tests)
    add_subdirectory(autotests)
endif()
add_subdirectory(interfaces)
add_subdirectory(pixmaps)
add_subdirectory(sounds)
add_subdirectory(kcmconfigs)
add_subdirectory(kontactplugin)
add_subdirectory(views/collectionview)
add_subdirectory(kconf_update)

########### next target ###############

Laurent Montel's avatar
Laurent Montel committed
19
set(korganizer_userfeedback_LIB)
20
if(TARGET KUserFeedbackWidgets)
Laurent Montel's avatar
Laurent Montel committed
21
22
23
    set(korganizer_userfeedback_LIB KUserFeedbackWidgets)
endif()

Laurent Montel's avatar
Laurent Montel committed
24
set(korganizer_common_SRCS)
25
ecm_qt_declare_logging_category(korganizer_common_SRCS HEADER korganizer_debug.h IDENTIFIER KORGANIZER_LOG CATEGORY_NAME org.kde.pim.korganizer
Laurent Montel's avatar
Laurent Montel committed
26
27
28
29
30
        DESCRIPTION "korganizer (korganizer)"
        OLD_CATEGORY_NAMES log_korganizer
        EXPORT KORGANIZER
    )

Laurent Montel's avatar
Laurent Montel committed
31
32
33
34
35
36
37
38
set(korganizer_SRCS
    main.cpp
    korganizer.cpp
    koapp.cpp
    plugininterface/korganizerplugininterface.cpp
    ${korganizer_common_SRCS}
    )

Daniel Vrátil's avatar
Daniel Vrátil committed
39
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pixmaps/*-apps-korganizer.png")
Laurent Montel's avatar
Laurent Montel committed
40
41
42
ecm_add_app_icon(korganizer_SRCS ICONS ${ICONS_SRCS})

add_executable(korganizer ${korganizer_SRCS})
43
44
45
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
    set_target_properties(korganizer PROPERTIES UNITY_BUILD ON)
endif()
Laurent Montel's avatar
Laurent Montel committed
46
47
48
49
50
51
target_link_libraries(korganizer
    KF5::KontactInterface
    KF5::CalendarCore
    korganizerprivate
    korganizer_interfaces
    korganizer_core
Laurent Montel's avatar
Laurent Montel committed
52
    KF5::PimCommonAkonadi
Laurent Montel's avatar
Laurent Montel committed
53
    KF5::Crash
54
    KF5::WindowSystem
Laurent Montel's avatar
Laurent Montel committed
55
    ${korganizer_userfeedback_LIB}
Laurent Montel's avatar
Laurent Montel committed
56
57
58
59
60
61
62
    )

install(TARGETS
    korganizer ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
    )

########### next target ###############
63
add_library(korganizer_kcm_static STATIC widgets/kitemiconcheckcombo.cpp prefs/kprefsdialog.cpp ${korganizer_common_SRCS})
Laurent Montel's avatar
Laurent Montel committed
64

65
target_link_libraries(korganizer_kcm_static
Laurent Montel's avatar
Laurent Montel committed
66
67
68
69
70
71
    KF5::AkonadiCalendar
    KF5::CalendarSupport
    KF5::EventViews
    KF5::IncidenceEditor
    korganizer_core
    korganizerprivate
72
    Qt::UiTools
Laurent Montel's avatar
Laurent Montel committed
73
74
75
76
    KF5::CalendarCore
    KF5::Holidays
    KF5::MailTransport
    KF5::PimCommon
Laurent Montel's avatar
Laurent Montel committed
77
    KF5::AkonadiWidgets
78
    KF5::WindowSystem
Laurent Montel's avatar
Laurent Montel committed
79
80
    )

81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
add_library(korganizer_configcolorsandfonts MODULE prefs/koprefsdialogcolorsandfonts.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configcolorsandfonts.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configcolorsandfonts korganizer_kcm_static)
install(TARGETS korganizer_configcolorsandfonts DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configdesignerfields MODULE prefs/koprefsdesignerfields.cpp kcmdesignerfields.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configdesignerfields.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configdesignerfields korganizer_kcm_static)
install(TARGETS korganizer_configdesignerfields DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configfreebusy MODULE prefs/koprefsdialoggroupwarescheduling.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configfreebusy.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configfreebusy korganizer_kcm_static)
install(TARGETS korganizer_configfreebusy DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configgroupscheduling MODULE prefs/koprefsdialogmain.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configgroupscheduling.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configgroupscheduling korganizer_kcm_static)
install(TARGETS korganizer_configgroupscheduling DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configmain MODULE prefs/koprefsdialoggroupscheduling.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configmain.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configmain korganizer_kcm_static)
install(TARGETS korganizer_configmain DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configplugins MODULE prefs/koprefsdialogplugins.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configplugins.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configplugins korganizer_kcm_static)
install(TARGETS korganizer_configplugins DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configtime MODULE prefs/koprefsdialogtime.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configtime.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configtime korganizer_kcm_static)
install(TARGETS korganizer_configtime DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_configviews MODULE prefs/koprefsdialogviews.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_configviews.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_configviews korganizer_kcm_static)
install(TARGETS korganizer_configviews DESTINATION ${KDE_INSTALL_PLUGINDIR})

add_library(korganizer_userfeedback MODULE prefs/koprefsuserfeedback.cpp)
kcoreaddons_desktop_to_json(korganizer_kcm_static "kcmconfigs/korganizer_userfeedback.desktop" SERVICE_TYPES kcmodule.desktop)
target_link_libraries(korganizer_userfeedback korganizer_kcm_static ${korganizer_userfeedback_LIB})
install(TARGETS korganizer_userfeedback DESTINATION ${KDE_INSTALL_PLUGINDIR})
Laurent Montel's avatar
Laurent Montel committed
125
126
127
128
129
130

########### next target ###############

set(korganizerpart_PART_SRCS korganizer_part.cpp korganizer_debug.cpp)

add_library(korganizerpart MODULE ${korganizerpart_PART_SRCS})
131
132
133
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
    set_target_properties(korganizerpart PROPERTIES UNITY_BUILD ON)
endif()
Laurent Montel's avatar
Laurent Montel committed
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161

target_link_libraries(korganizerpart
    KF5::CalendarSupport
    korganizer_core
    korganizer_interfaces
    korganizerprivate
    KF5::AkonadiCore
    KF5::CalendarCore
    KF5::CalendarUtils
    )

install(TARGETS
    korganizerpart
    DESTINATION ${KDE_INSTALL_PLUGINDIR}
    )

########### next target ###############

set(korganizer_core_LIB_SRCS
    prefs/koprefs.cpp
    kocore.cpp
    ${korganizer_common_SRCS}
    )

kconfig_add_kcfg_files(korganizer_core_LIB_SRCS settings/koprefs_base.kcfgc)

add_library(korganizer_core ${korganizer_core_LIB_SRCS})
generate_export_header(korganizer_core BASE_NAME korganizer_core)
162
163
164
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
    set_target_properties(korganizer_core PROPERTIES UNITY_BUILD ON)
endif()
Laurent Montel's avatar
Laurent Montel committed
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
target_link_libraries(korganizer_core
    PUBLIC
    korganizer_interfaces
    PRIVATE
    KF5::CalendarSupport
    KF5::EventViews
    KF5::IdentityManagement
    )

target_include_directories(korganizer_core PUBLIC
    "$<BUILD_INTERFACE:${korganizer_SOURCE_DIR};${korganizer_BINARY_DIR}>"
    )

set_target_properties(korganizer_core PROPERTIES
    VERSION ${KDEPIM_LIB_VERSION}
    SOVERSION ${KDEPIM_LIB_SOVERSION}
    )

install(TARGETS
    korganizer_core ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
    )

########### next target ###############
188
set(korganizerprivate_userfeedback_SRCS)
189
if(TARGET KUserFeedbackWidgets)
190
191
    set(korganizerprivate_userfeedback_SRCS ${korganizerprivate_userfeedback_SRCS}
        userfeedback/userfeedbackmanager.cpp
Laurent Montel's avatar
Laurent Montel committed
192
        userfeedback/korganizeruserfeedbackprovider.cpp
193
194
        )
endif()
Laurent Montel's avatar
Laurent Montel committed
195
196
197

set(korganizerprivate_LIB_SRCS
    ${korganizer_common_SRCS}
198
    ${korganizerprivate_userfeedback_SRCS}
199
    manageshowcollectionproperties.cpp
Laurent Montel's avatar
Laurent Montel committed
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
    korgmigrateapplication.cpp
    collectiongeneralpage.cpp
    aboutdata.cpp
    actionmanager.cpp
    akonadicollectionview.cpp
    views/collectionview/reparentingmodel.cpp
    views/collectionview/calendardelegate.cpp
    views/collectionview/quickview.cpp
    calendarview.cpp
    datechecker.cpp
    datenavigator.cpp
    datenavigatorcontainer.cpp
    dialog/filtereditdialog.cpp
    widgets/kdatenavigator.cpp
    kocorehelper.cpp
    kodaymatrix.cpp
    kodialogmanager.cpp
    koeventpopupmenu.cpp
    koeventview.cpp
    dialog/koeventviewerdialog.cpp
    koglobals.cpp
    kohelper.cpp
    impl/korganizerifaceimpl.cpp
    koviewmanager.cpp
    kowindowlist.cpp
    widgets/navigatorbar.cpp
    dialog/searchdialog.cpp
    helper/searchcollectionhelper.cpp
    views/agendaview/koagendaview.cpp
    views/journalview/kojournalview.cpp
    views/listview/kolistview.cpp
    views/monthview/monthview.cpp
    views/multiagendaview/multiagendaview.cpp
    views/timelineview/kotimelineview.cpp
    views/todoview/kotodoview.cpp
    views/whatsnextview/kowhatsnextview.cpp
Laurent Montel's avatar
Laurent Montel committed
236
    pimmessagebox.cpp
Laurent Montel's avatar
Laurent Montel committed
237
    korganizer.qrc
Laurent Montel's avatar
Laurent Montel committed
238
    agendaitem_pixmaps/agendaitemtheme.qrc
Laurent Montel's avatar
Laurent Montel committed
239
240
    )

Laurent Montel's avatar
Laurent Montel committed
241
242
243
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/qrc_korganizer.cpp PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/qrc_agendaitemtheme.cpp PROPERTY SKIP_AUTOMOC ON)

244

Laurent Montel's avatar
Laurent Montel committed
245
246
247
248
249
250
251
252
ki18n_wrap_ui(korganizerprivate_LIB_SRCS
    ui/filteredit_base.ui
    ui/kogroupwareprefspage.ui
    views/multiagendaview/multiagendaviewconfigwidget.ui
    ui/searchdialog_base.ui
    views/collectionview/quickview.ui
    )

253
qt_add_dbus_adaptor(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
254
255
256
257
    data/org.kde.korganizer.Korganizer.xml impl/korganizerifaceimpl.h
    KOrganizerIfaceImpl
    )

258
qt_add_dbus_adaptor(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
259
260
261
262
    data/org.kde.Korganizer.Calendar.xml actionmanager.h
    ActionManager calendaradaptor KOrgCalendarAdaptor
    )

263
qt_add_dbus_interfaces(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
264
265
266
    data/org.kde.korganizer.Korganizer.xml
    )

267
qt_add_dbus_interfaces(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
268
    ../korgac/org.kde.korganizer.KOrgac.xml
Laurent Montel's avatar
Laurent Montel committed
269
270
    )

271
qt_add_dbus_interfaces(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
272
    ${korganizer_SOURCE_DIR}/src/data/org.kde.korganizer.Korganizer.xml
Laurent Montel's avatar
Laurent Montel committed
273
274
275
    )

add_library(korganizerprivate ${korganizerprivate_LIB_SRCS})
276
277
278
279
280
281
282
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
    set_target_properties(korganizerprivate PROPERTIES UNITY_BUILD ON)
    set_source_files_properties(
        ${CMAKE_CURRENT_BINARY_DIR}/qrc_korganizer.cpp
        ${CMAKE_CURRENT_BINARY_DIR}/qrc_agendaitemtheme.cpp
        PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON)
endif()
283

Laurent Montel's avatar
Laurent Montel committed
284
285
286
287
generate_export_header(korganizerprivate BASE_NAME korganizerprivate)

target_link_libraries(korganizerprivate
    PUBLIC
Laurent Montel's avatar
Laurent Montel committed
288
    KF5::PimCommonAkonadi
Laurent Montel's avatar
Laurent Montel committed
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
    PRIVATE
    KF5::CalendarSupport
    KF5::EventViews
    KF5::IncidenceEditor
    korganizer_core
    korganizer_interfaces
    KF5::AkonadiCore
    KF5::AkonadiCalendar
    KF5::AkonadiNotes
    KF5::AkonadiSearchPIM
    KF5::Contacts
    KF5::CalendarCore
    KF5::CalendarUtils
    KF5::Holidays
    KF5::Mime
    KF5::IdentityManagement
    KF5::KCMUtils
    KF5::NewStuff
    KF5::Ldap
Laurent Montel's avatar
Laurent Montel committed
308
    KF5::AkonadiWidgets
309
310
311
312
    KF5::IconThemes
    KF5::WindowSystem
    KF5::Notifications
    KF5::ItemViews
313
    ${korganizer_userfeedback_LIB}
Laurent Montel's avatar
Laurent Montel committed
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
    )

target_include_directories(korganizerprivate PUBLIC
    "$<BUILD_INTERFACE:${korganizer_SOURCE_DIR};${korganizer_BINARY_DIR}>"
    )

set_target_properties(korganizerprivate PROPERTIES
    VERSION ${KDEPIM_LIB_VERSION}
    SOVERSION ${KDEPIM_LIB_SOVERSION}
    )

install(TARGETS
    korganizerprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
    LIBRARY NAMELINK_SKIP
    )

########### install files ###############

install(FILES
    settings/korganizer.kcfg
    DESTINATION ${KDE_INSTALL_KCFGDIR}
    )

install(FILES
Alexander Lohnau's avatar
Alexander Lohnau committed
338
    korganizer_part.desktop
Laurent Montel's avatar
Laurent Montel committed
339
340
341
342
343
344
345
346
347
348
    DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
    )

install(FILES
    data/org.kde.Korganizer.Calendar.xml data/org.kde.korganizer.Korganizer.xml
    DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
    )

install(FILES
    data/korganizer.knsrc
349
    DESTINATION ${KDE_INSTALL_KNSRCDIR}
Laurent Montel's avatar
Laurent Montel committed
350
351
352
    )

install(PROGRAMS
353
    org.kde.korganizer.desktop korganizer-import.desktop korganizer-view.desktop
Laurent Montel's avatar
Laurent Montel committed
354
355
356
357
358
359
360
    DESTINATION ${KDE_INSTALL_APPDIR}
    )

install(FILES
    org.kde.korganizer.appdata.xml
    DESTINATION ${KDE_INSTALL_METAINFODIR}
    )
361
362
363
364
365
366
367

configure_file(data/org.kde.korganizer.service.in org.kde.korganizer.service)
install(FILES
    ${CMAKE_CURRENT_BINARY_DIR}/org.kde.korganizer.service
    DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
    )