CMakeLists.txt 8.86 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
2
3
4
5
include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}
    ${CMAKE_CURRENT_SOURCE_DIR}/
)

6
add_subdirectory(kalarmcalendar)
Laurent Montel's avatar
Laurent Montel committed
7
8
9
10
11
add_subdirectory(appicons)
add_subdirectory(pixmaps)
add_subdirectory(autostart)

set(libkalarm_common_SRCS)
Laurent Montel's avatar
Laurent Montel committed
12

13
ecm_qt_declare_logging_category(libkalarm_common_SRCS
14
15
16
17
18
19
20
21
                                HEADER kalarm_debug.h
                                IDENTIFIER KALARM_LOG
                                CATEGORY_NAME org.kde.pim.kalarm
                                DEFAULT_SEVERITY Warning
                                DESCRIPTION "kalarm (kalarm)"
                                OLD_CATEGORY_NAMES log_kalarm
                                EXPORT KALARM
                                )
Laurent Montel's avatar
Laurent Montel committed
22
23
24
25
26
27
28

########### next target ###############
set(libkalarm_SRCS
    lib/buttongroup.cpp
    lib/checkbox.cpp
    lib/colourbutton.cpp
    lib/combobox.cpp
29
    lib/config.cpp
Laurent Montel's avatar
Laurent Montel committed
30
    lib/desktop.cpp
31
    lib/dragdrop.cpp
32
    lib/file.cpp
Laurent Montel's avatar
Laurent Montel committed
33
34
35
    lib/filedialog.cpp
    lib/groupbox.cpp
    lib/label.cpp
36
    lib/locale.cpp
Laurent Montel's avatar
Laurent Montel committed
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
    lib/messagebox.cpp
    lib/packedlayout.cpp
    lib/pushbutton.cpp
    lib/radiobutton.cpp
    lib/timeedit.cpp
    lib/timespinbox.cpp
    lib/timeperiod.cpp
    lib/timezonecombo.cpp
    lib/shellprocess.cpp
    lib/slider.cpp
    lib/spinbox.cpp
    lib/spinbox2.cpp
    lib/stackedwidgets.cpp
    lib/lineedit.cpp
    lib/synchtimer.cpp
Laurent Montel's avatar
Laurent Montel committed
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
    lib/buttongroup.h
    lib/checkbox.h
    lib/colourbutton.h
    lib/combobox.h
    lib/config.h
    lib/desktop.h
    lib/dragdrop.h
    lib/file.h
    lib/filedialog.h
    lib/groupbox.h
    lib/label.h
    lib/locale.h
    lib/messagebox.h
    lib/packedlayout.h
    lib/pushbutton.h
    lib/radiobutton.h
    lib/timeedit.h
    lib/timespinbox.h
    lib/timeperiod.h
    lib/timezonecombo.h
    lib/shellprocess.h
    lib/slider.h
    lib/spinbox.h
    lib/spinbox2.h
    lib/stackedwidgets.h
    lib/lineedit.h
    lib/synchtimer.h
79
   )
David Jarvie's avatar
David Jarvie committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
set(resources_SRCS
    resources/calendarfunctions.cpp
    resources/resourcetype.cpp
    resources/resource.cpp
    resources/resources.cpp
    resources/resourcedatamodelbase.cpp
    resources/resourcemodel.cpp
    resources/resourceselectdialog.cpp
    resources/resourcecreator.cpp
    resources/eventmodel.cpp
    resources/datamodel.cpp
    resources/calendarupdater.cpp
    resources/fileresource.cpp
    resources/fileresourceconfigmanager.cpp
    resources/fileresourcecreator.cpp
    resources/fileresourcedatamodel.cpp
    resources/fileresourcesettings.cpp
    resources/fileresourcecalendarupdater.cpp
    resources/singlefileresource.cpp
    resources/singlefileresourceconfigdialog.cpp
100
101
    resources/migration/collectionattribute.cpp
    resources/migration/compatibilityattribute.cpp
102
103
    resources/migration/dirresourceimportdialog.cpp
    resources/migration/fileresourcemigrator.cpp
Laurent Montel's avatar
Laurent Montel committed
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
    resources/calendarfunctions.h
    resources/resourcetype.h
    resources/resource.h
    resources/resources.h
    resources/resourcedatamodelbase.h
    resources/resourcemodel.h
    resources/resourceselectdialog.h
    resources/resourcecreator.h
    resources/eventmodel.h
    resources/datamodel.h
    resources/calendarupdater.h
    resources/fileresource.h
    resources/fileresourceconfigmanager.h
    resources/fileresourcecreator.h
    resources/fileresourcedatamodel.h
    resources/fileresourcesettings.h
    resources/fileresourcecalendarupdater.h
    resources/singlefileresource.h
    resources/singlefileresourceconfigdialog.h
123
124
    resources/migration/collectionattribute.h
    resources/migration/compatibilityattribute.h
125
126
    resources/migration/dirresourceimportdialog.h
    resources/migration/fileresourcemigrator.h
David Jarvie's avatar
David Jarvie committed
127
   )
Laurent Montel's avatar
Laurent Montel committed
128

David Jarvie's avatar
David Jarvie committed
129
set(kalarm_bin_SRCS ${libkalarm_SRCS} ${resources_SRCS}
Laurent Montel's avatar
Laurent Montel committed
130
    ${libkalarm_common_SRCS}
131
    main.cpp
Laurent Montel's avatar
Laurent Montel committed
132
133
134
135
136
137
    birthdaydlg.cpp
    birthdaymodel.cpp
    editdlg.cpp
    editdlgtypes.cpp
    soundpicker.cpp
    sounddlg.cpp
138
139
    displaycalendar.cpp
    resourcescalendar.cpp
Laurent Montel's avatar
Laurent Montel committed
140
141
142
143
    undo.cpp
    kalarmapp.cpp
    mainwindowbase.cpp
    mainwindow.cpp
144
145
    messagedisplay.cpp
    messagedisplayhelper.cpp
146
    messagenotification.cpp
147
    messagewindow.cpp
Laurent Montel's avatar
Laurent Montel committed
148
149
150
151
152
153
    preferences.cpp
    prefdlg.cpp
    traywindow.cpp
    dbushandler.cpp
    recurrenceedit.cpp
    deferdlg.cpp
154
    eventid.cpp
Laurent Montel's avatar
Laurent Montel committed
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
    functions.cpp
    fontcolour.cpp
    fontcolourbutton.cpp
    alarmtimewidget.cpp
    specialactions.cpp
    reminder.cpp
    startdaytimer.cpp
    eventlistview.cpp
    alarmlistdelegate.cpp
    alarmlistview.cpp
    templatelistview.cpp
    kamail.cpp
    timeselector.cpp
    latecancel.cpp
    repetitionbutton.cpp
    emailidcombo.cpp
    find.cpp
    pickfileradio.cpp
    newalarmaction.cpp
    commandoptions.cpp
    resourceselector.cpp
176
177
    datepicker.cpp
    daymatrix.cpp
Laurent Montel's avatar
Laurent Montel committed
178
179
180
    templatepickdlg.cpp
    templatedlg.cpp
    templatemenuaction.cpp
181
    migratekde4files.cpp
182
    akonadicollectionsearch.cpp
Laurent Montel's avatar
Laurent Montel committed
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
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
    birthdaydlg.h
    birthdaymodel.h
    editdlg.h
    editdlgtypes.h
    soundpicker.h
    sounddlg.h
    displaycalendar.h
    resourcescalendar.h
    undo.h
    kalarmapp.h
    mainwindowbase.h
    mainwindow.h
    messagedisplay.h
    messagedisplayhelper.h
    messagenotification.h
    messagewindow.h
    preferences.h
    prefdlg.h
    traywindow.h
    dbushandler.h
    recurrenceedit.h
    deferdlg.h
    eventid.h
    functions.h
    fontcolour.h
    fontcolourbutton.h
    alarmtimewidget.h
    specialactions.h
    reminder.h
    startdaytimer.h
    eventlistview.h
    alarmlistdelegate.h
    alarmlistview.h
    templatelistview.h
    kamail.h
    timeselector.h
    latecancel.h
    repetitionbutton.h
    emailidcombo.h
    find.h
    pickfileradio.h
    newalarmaction.h
    commandoptions.h
    resourceselector.h
    datepicker.h
    daymatrix.h
    templatepickdlg.h
    templatedlg.h
    templatemenuaction.h
    migratekde4files.h
    akonadicollectionsearch.h
David Jarvie's avatar
David Jarvie committed
234
)
235
236
237
238
239
240
if (ENABLE_WAKE_FROM_SUSPEND)
    set(kalarm_bin_SRCS ${kalarm_bin_SRCS}
        wakedlg.cpp
        wakedlg.h
    )
endif()
Laurent Montel's avatar
Laurent Montel committed
241
242
243

ki18n_wrap_ui(kalarm_bin_SRCS
    wakedlg.ui
David Jarvie's avatar
David Jarvie committed
244
    resources/singlefileresourceconfigdialog.ui
245
246
    resources/migration/dirresourceimportdialog_intro.ui
    resources/migration/dirresourceimportdialog_type.ui
Laurent Montel's avatar
Laurent Montel committed
247
248
)

249
qt_add_dbus_adaptor(kalarm_bin_SRCS data/org.kde.kalarm.kalarm.xml dbushandler.h DBusHandler)
Laurent Montel's avatar
Laurent Montel committed
250

251
qt_add_dbus_interfaces(kalarm_bin_SRCS data/org.kde.kmail.kmail.xml)
Laurent Montel's avatar
Laurent Montel committed
252

253
254
qt_add_dbus_interface(kalarm_bin_SRCS data/org.freedesktop.Notifications.xml notifications_interface)
qt_add_dbus_interface(kalarm_bin_SRCS data/org.freedesktop.DBus.Properties.xml dbusproperties)
255

256
kconfig_add_kcfg_files(kalarm_bin_SRCS GENERATE_MOC data/kalarmconfig.kcfgc)
Laurent Montel's avatar
Laurent Montel committed
257
258
259
260
261
262
263

#if (UNIX)
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/appicons/*-apps-kalarm.png")
ecm_add_app_icon(kalarm_bin_SRCS ICONS ${ICONS_SRCS})
add_executable(kalarm_bin ${kalarm_bin_SRCS})

set_target_properties(kalarm_bin PROPERTIES OUTPUT_NAME kalarm)
Laurent Montel's avatar
Laurent Montel committed
264
if (COMPILE_WITH_UNITY_CMAKE_SUPPORT)
265
266
267
    set_target_properties(kalarm_bin PROPERTIES UNITY_BUILD ON)
endif()

268
269
target_compile_definitions(kalarm_bin PRIVATE -DVERSION="${KALARM_VERSION}")

Laurent Montel's avatar
Laurent Montel committed
270
271

target_link_libraries(kalarm_bin
272
    kalarmprivate
273
    KF5::Auth
274
275
276
277
278
279
280
    KF5::Codecs
    KF5::ConfigCore
    KF5::Completion
    KF5::DBusAddons
    KF5::GlobalAccel
    KF5::GuiAddons
    KF5::Holidays
281
    KF5::IdleTime
282
283
    KF5::KIOWidgets
    KF5::Notifications
284
    KF5::NotifyConfig
285
286
287
    KF5::TextWidgets
    KF5::WindowSystem
    KF5::XmlGui
Laurent Montel's avatar
Laurent Montel committed
288
289
    KF5::KIOFileWidgets
    KF5::Crash
290
    Phonon::phonon4qt${QT_MAJOR_VERSION}
291
292
293
294
    KF5::AkonadiCore
    KF5::AkonadiMime
    KF5::AkonadiContact
    KF5::AkonadiWidgets
Laurent Montel's avatar
Laurent Montel committed
295
296
297
    KF5::CalendarCore
    KF5::CalendarUtils
    KF5::Contacts
298
299
    KF5::IdentityManagementWidgets
    KF5::PimTextEdit
300
    KF5::MailTransportAkonadi
301
    KF5::MailTransport
302
    KF5::Mime
Laurent Montel's avatar
Laurent Montel committed
303
304
305
    KF5::PimCommon
)

306
307
if (Qt${QT_MAJOR_VERSION}X11Extras_FOUND)
    target_link_libraries(kalarm_bin Qt${QT_MAJOR_VERSION}::X11Extras ${X11_X11_LIB})
Laurent Montel's avatar
Laurent Montel committed
308
309
310
311
312
313
314
315
endif()


install(TARGETS kalarm_bin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
#endif (UNIX)

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

316
317
318
install(FILES data/org.kde.kalarm.desktop  DESTINATION ${KDE_INSTALL_APPDIR})
install(FILES data/kalarm.autostart.desktop DESTINATION ${KDE_INSTALL_AUTOSTARTDIR})
install(FILES data/org.kde.kalarm.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR})
Laurent Montel's avatar
Laurent Montel committed
319

320
install(FILES data/kalarmconfig.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
321
install(FILES data/kalarmui.rc DESTINATION ${KDE_INSTALL_KXMLGUIDIR}/kalarm)
322
install(FILES data/org.kde.kalarm.kalarm.xml DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR})
323
install(FILES data/kalarm.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
Laurent Montel's avatar
Laurent Montel committed
324
325
326

########### KAuth helper ###############

327
if (ENABLE_WAKE_FROM_SUSPEND)
328
329
330
331
332
333
    add_executable(kalarm_helper rtcwakeaction.cpp rtcwakeaction.h ${libkalarm_common_SRCS})
    target_link_libraries(kalarm_helper KF5::AuthCore KF5::I18n)
    install(TARGETS kalarm_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
    kauth_install_helper_files(kalarm_helper org.kde.kalarm.rtcwake root)
    kauth_install_actions(org.kde.kalarm.rtcwake data/org.kde.kalarm.rtcwake.actions)
endif()