CMakeLists.txt 8.08 KB
Newer Older
1 2
project(korganizer)

3 4
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
Laurent Montel's avatar
Laurent Montel committed
5
add_definitions(-DTRANSLATION_DOMAIN=\"korganizer\")
6

Allen Winter's avatar
Allen Winter committed
7
include_directories(
Laurent Montel's avatar
indent  
Laurent Montel committed
8 9
    ${CMAKE_CURRENT_BINARY_DIR}
    )
10

11
if(BUILD_TESTING)
Laurent Montel's avatar
indent  
Laurent Montel committed
12 13
    add_subdirectory(tests)
    add_subdirectory(autotests)
14
endif()
15
add_subdirectory(interfaces)
16 17 18
add_subdirectory(pixmaps)
add_subdirectory(sounds)
add_subdirectory(kcmconfigs)
19 20 21
add_subdirectory(kontactplugin)
add_subdirectory(views/collectionview)
add_subdirectory(kconf_update)
22

23 24
set(PERL ${PERL_EXECUTABLE})
configure_file(
Laurent Montel's avatar
indent  
Laurent Montel committed
25 26
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ical2vcal.cmake ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal @ONLY
    )
27

Allen Winter's avatar
Allen Winter committed
28
########### next target ###############
29

Laurent Montel's avatar
Laurent Montel committed
30 31 32
set(korganizer_common_SRCS)
ecm_qt_declare_logging_category(korganizer_common_SRCS HEADER korganizer_debug.h IDENTIFIER KORGANIZER_LOG CATEGORY_NAME log_korganizer)

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

41 42
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pixmaps/*-apps-korganizer.png")
ecm_add_app_icon(korganizer_SRCS ICONS ${ICONS_SRCS})
43

44
add_executable(korganizer ${korganizer_SRCS})
45

46
target_link_libraries(korganizer
Laurent Montel's avatar
indent  
Laurent Montel committed
47 48 49 50 51 52 53 54
    KF5::KontactInterface
    KF5::CalendarCore
    KF5::Libkdepim
    KF5::KdepimDBusInterfaces
    korganizerprivate
    korganizer_interfaces
    korganizer_core
    )
55

56
install(TARGETS
Laurent Montel's avatar
indent  
Laurent Montel committed
57 58
    korganizer ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
    )
59 60 61

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

62
set(kcm_korganizer_PART_SRCS
Laurent Montel's avatar
indent  
Laurent Montel committed
63 64 65 66 67
    kcmdesignerfields.cpp
    korganizer_debug.cpp
    prefs/koprefsdialog.cpp
    widgets/kitemiconcheckcombo.cpp
    )
68

69 70
add_library(kcm_korganizer MODULE ${kcm_korganizer_PART_SRCS})
generate_export_header(kcm_korganizer BASE_NAME kcm_korganizer) 
71

72
target_link_libraries(kcm_korganizer
Laurent Montel's avatar
indent  
Laurent Montel committed
73 74 75 76 77 78 79 80 81 82 83 84 85 86
    KF5::AkonadiCalendar
    KF5::CalendarSupport
    KF5::EventViews
    KF5::IncidenceEditor
    KF5::Libkdepim
    korganizer_core
    korganizerprivate
    Qt5::UiTools
    KF5::CalendarCore
    KF5::Holidays
    KF5::MailTransport
    Qt5::UiTools
    KF5::PimCommon
    )
87

88
install(TARGETS
Laurent Montel's avatar
indent  
Laurent Montel committed
89 90 91
    kcm_korganizer
    DESTINATION ${KDE_INSTALL_PLUGINDIR}
    )
92 93 94

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

95
set(korganizerpart_PART_SRCS korganizer_part.cpp korganizer_debug.cpp)
96

97
add_library(korganizerpart MODULE ${korganizerpart_PART_SRCS})
98

99
target_link_libraries(korganizerpart
Laurent Montel's avatar
indent  
Laurent Montel committed
100 101 102 103 104 105 106 107
    KF5::CalendarSupport
    korganizer_core
    korganizer_interfaces
    korganizerprivate
    KF5::AkonadiCore
    KF5::CalendarCore
    KF5::CalendarUtils
    )
108

109
install(TARGETS
Laurent Montel's avatar
indent  
Laurent Montel committed
110 111 112
    korganizerpart
    DESTINATION ${KDE_INSTALL_PLUGINDIR}
    )
113

Allen Winter's avatar
Allen Winter committed
114

115
########### next target ###############
116

117
set(korganizer_core_LIB_SRCS
Laurent Montel's avatar
indent  
Laurent Montel committed
118 119 120 121
    prefs/koprefs.cpp
    kocore.cpp
    ${korganizer_common_SRCS}
    )
122

123
kconfig_add_kcfg_files(korganizer_core_LIB_SRCS settings/koprefs_base.kcfgc)
124

125
add_library(korganizer_core ${korganizer_core_LIB_SRCS})
Laurent Montel's avatar
Laurent Montel committed
126
generate_export_header(korganizer_core BASE_NAME korganizer_core)
127 128

target_link_libraries(korganizer_core
Laurent Montel's avatar
indent  
Laurent Montel committed
129 130 131 132 133 134 135
    PUBLIC
    korganizer_interfaces
    PRIVATE
    KF5::CalendarSupport
    KF5::EventViews
    KF5::IdentityManagement
    )
136

137
target_include_directories(korganizer_core PUBLIC
Laurent Montel's avatar
indent  
Laurent Montel committed
138 139
    "$<BUILD_INTERFACE:${korganizer_SOURCE_DIR};${korganizer_BINARY_DIR}>"
    )
140

141
set_target_properties(korganizer_core PROPERTIES
Laurent Montel's avatar
indent  
Laurent Montel committed
142 143 144
    VERSION ${KDEPIM_LIB_VERSION}
    SOVERSION ${KDEPIM_LIB_SOVERSION}
    )
145 146

install(TARGETS
Laurent Montel's avatar
indent  
Laurent Montel committed
147 148
    korganizer_core ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
    )
149 150 151

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

152
set(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
153
    ${korganizer_common_SRCS}
154 155
    korgmigrateapplication.cpp
    collectiongeneralpage.cpp
156 157 158
    aboutdata.cpp
    actionmanager.cpp
    akonadicollectionview.cpp
159 160 161
    views/collectionview/reparentingmodel.cpp
    views/collectionview/controller.cpp
    views/collectionview/calendardelegate.cpp
162
    views/collectionview/quickview.cpp
163 164 165 166
    calendarview.cpp
    datechecker.cpp
    datenavigator.cpp
    datenavigatorcontainer.cpp
Laurent Montel's avatar
Laurent Montel committed
167 168
    dialog/exportwebdialog.cpp
    dialog/filtereditdialog.cpp
Laurent Montel's avatar
Laurent Montel committed
169
    job/htmlexportjob.cpp
Laurent Montel's avatar
Laurent Montel committed
170
    widgets/kdatenavigator.cpp
171 172 173 174 175
    kocheckableproxymodel.cpp
    kocorehelper.cpp
    kodaymatrix.cpp
    kodialogmanager.cpp
    koeventpopupmenu.cpp
Laurent Montel's avatar
Laurent Montel committed
176
    dialog/noteeditdialog.cpp
177
    koeventview.cpp
Laurent Montel's avatar
Laurent Montel committed
178
    dialog/koeventviewerdialog.cpp
179 180
    koglobals.cpp
    kohelper.cpp
Laurent Montel's avatar
Laurent Montel committed
181
    impl/korganizerifaceimpl.cpp
182 183
    koviewmanager.cpp
    kowindowlist.cpp
Laurent Montel's avatar
Laurent Montel committed
184
    widgets/navigatorbar.cpp
Laurent Montel's avatar
Laurent Montel committed
185
    dialog/searchdialog.cpp
Laurent Montel's avatar
Laurent Montel committed
186
    helper/searchcollectionhelper.cpp
187 188 189 190 191 192 193 194 195
    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/timespentview/kotimespentview.cpp
    views/todoview/kotodoview.cpp
    views/whatsnextview/kowhatsnextview.cpp
Laurent Montel's avatar
indent  
Laurent Montel committed
196
    )
197

198
kconfig_add_kcfg_files(korganizerprivate_LIB_SRCS settings/htmlexportsettings.kcfgc)
199

200
ki18n_wrap_ui(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
201 202
    ui/filteredit_base.ui
    ui/kogroupwareprefspage.ui
203
    views/multiagendaview/multiagendaviewconfigwidget.ui
Laurent Montel's avatar
Laurent Montel committed
204
    ui/searchdialog_base.ui
205
    views/collectionview/quickview.ui
Laurent Montel's avatar
indent  
Laurent Montel committed
206
    )
207

208
qt5_add_resources(korganizerprivate_LIB_SRCS
209 210
    agendaitem_pixmaps/agendaitemtheme.qrc)

211
qt5_add_dbus_adaptor(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
212
    data/org.kde.korganizer.Korganizer.xml impl/korganizerifaceimpl.h
213
    KOrganizerIfaceImpl
Laurent Montel's avatar
indent  
Laurent Montel committed
214
    )
215

216
qt5_add_dbus_adaptor(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
217
    data/org.kde.Korganizer.Calendar.xml actionmanager.h
218
    ActionManager calendaradaptor KOrgCalendarAdaptor
Laurent Montel's avatar
indent  
Laurent Montel committed
219
    )
220

221
qt5_add_dbus_interfaces(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
222
    data/org.kde.korganizer.Korganizer.xml
Laurent Montel's avatar
indent  
Laurent Montel committed
223
    )
224

225
qt5_add_dbus_interfaces(korganizerprivate_LIB_SRCS
226
    ${CMAKE_SOURCE_DIR}/korgac/org.kde.korganizer.KOrgac.xml
Laurent Montel's avatar
indent  
Laurent Montel committed
227
    )
228

229
qt5_add_dbus_interfaces(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
230
    ${CMAKE_SOURCE_DIR}/korganizer/data/org.kde.korganizer.Korganizer.xml
Laurent Montel's avatar
indent  
Laurent Montel committed
231
    )
232

233 234
add_library(korganizerprivate ${korganizerprivate_LIB_SRCS})
generate_export_header(korganizerprivate BASE_NAME korganizerprivate)
235

236
target_link_libraries(korganizerprivate
Laurent Montel's avatar
indent  
Laurent Montel committed
237
    PUBLIC
Laurent Montel's avatar
Laurent Montel committed
238
    KF5::PimCommon
Laurent Montel's avatar
indent  
Laurent Montel committed
239 240
    PRIVATE
    KF5::CalendarSupport
Laurent Montel's avatar
Laurent Montel committed
241
    KF5::EventViews
242
    KF5::IncidenceEditor
Laurent Montel's avatar
Laurent Montel committed
243
    KF5::Libkdepim
Laurent Montel's avatar
Build++  
Laurent Montel committed
244
    KF5::KdepimDBusInterfaces
245
    korganizer_core
Allen Winter's avatar
Allen Winter committed
246
    korganizer_interfaces
Laurent Montel's avatar
Laurent Montel committed
247
    KF5::AkonadiCore
248 249 250
    KF5::AkonadiCalendar
    KF5::AkonadiNotes
    KF5::AkonadiSearchPIM
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
251
    KF5::Contacts
Laurent Montel's avatar
Laurent Montel committed
252 253 254
    KF5::CalendarCore
    KF5::CalendarUtils
    KF5::Holidays
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
255
    KF5::Mime
Laurent Montel's avatar
Laurent Montel committed
256
    KF5::IdentityManagement
Laurent Montel's avatar
Laurent Montel committed
257 258
    KF5::KCMUtils
    KF5::NewStuff
Laurent Montel's avatar
Laurent Montel committed
259
    KF5::Ldap
260
    KF5::MailCommon
Laurent Montel's avatar
indent  
Laurent Montel committed
261
    )
Allen Winter's avatar
Allen Winter committed
262

263
target_include_directories(korganizerprivate PUBLIC
264
    "$<BUILD_INTERFACE:${korganizer_SOURCE_DIR};${korganizer_BINARY_DIR}>"
Laurent Montel's avatar
indent  
Laurent Montel committed
265
    )
266

267
set_target_properties(korganizerprivate PROPERTIES
Laurent Montel's avatar
Laurent Montel committed
268 269
    VERSION ${KDEPIM_LIB_VERSION}
    SOVERSION ${KDEPIM_LIB_SOVERSION}
Laurent Montel's avatar
indent  
Laurent Montel committed
270
    )
271

272
install(TARGETS
273
    korganizerprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
274
    LIBRARY NAMELINK_SKIP
Laurent Montel's avatar
indent  
Laurent Montel committed
275
    )
Allen Winter's avatar
Allen Winter committed
276

277
########### install files ###############
278

279
install(FILES
Laurent Montel's avatar
Laurent Montel committed
280
    settings/korganizer.kcfg
281
    DESTINATION ${KDE_INSTALL_KCFGDIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
282
    )
283

284
install(FILES
Laurent Montel's avatar
Laurent Montel committed
285
    data/korganizer_part.rc
286
    DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/korganizer
Laurent Montel's avatar
indent  
Laurent Montel committed
287
    )
288

289
install(FILES
290
    dbuscalendar.desktop
291
    DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
292
    )
293

294
install(FILES
Laurent Montel's avatar
Laurent Montel committed
295
    korganizer_part.desktop data/webcal.protocol
296
    DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
297
    )
298

299
install(FILES
Laurent Montel's avatar
Laurent Montel committed
300
    data/korganizerui.rc
301
    DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/korganizer
Laurent Montel's avatar
indent  
Laurent Montel committed
302
    )
303

304
install(FILES
Laurent Montel's avatar
Laurent Montel committed
305
    data/org.kde.Korganizer.Calendar.xml data/org.kde.korganizer.Korganizer.xml
306
    DESTINATION ${KDE_INSTALL_DBUSINTERFACEDIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
307
    )
308

309
install(FILES
Laurent Montel's avatar
Laurent Montel committed
310
    data/korganizer.knsrc
311
    DESTINATION ${KDE_INSTALL_CONFDIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
312
    )
313

314
install(PROGRAMS
Laurent Montel's avatar
Laurent Montel committed
315
    org.kde.korganizer.desktop korganizer-import.desktop
316
    DESTINATION ${KDE_INSTALL_APPDIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
317
    )
318

319
install(FILES
Laurent Montel's avatar
Laurent Montel committed
320
    org.kde.korganizer.appdata.xml
321
    DESTINATION ${KDE_INSTALL_METAINFODIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
322
    )
323

324
install(PROGRAMS
325
    ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal
326
    DESTINATION ${KDE_INSTALL_BINDIR}
Laurent Montel's avatar
indent  
Laurent Montel committed
327
    )
Laurent Montel's avatar
Laurent Montel committed
328 329 330
if ("${CMAKE_BINARY_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
  feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
endif()