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

Allen Winter's avatar
Allen Winter committed
3
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5850)
4 5
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
Laurent Montel's avatar
Laurent Montel committed
6

7 8

# enable exception handling
Allen Winter's avatar
Allen Winter committed
9 10 11 12 13 14 15 16 17 18
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")

include_directories(
  ${CMAKE_CURRENT_SOURCE_DIR}/interfaces
  ${CMAKE_CURRENT_BINARY_DIR}
  ${CMAKE_SOURCE_DIR}/calendarsupport
  ${CMAKE_BINARY_DIR}/calendarsupport
  ${CMAKE_SOURCE_DIR}/libkdepimdbusinterfaces
  ${CMAKE_BINARY_DIR}/libkdepimdbusinterfaces
  ${CMAKE_SOURCE_DIR}/incidenceeditor-ng
19
  ${CMAKE_SOURCE_DIR}/calendarviews
Laurent Montel's avatar
Laurent Montel committed
20
  ${CMAKE_SOURCE_DIR}/pimcommon/
Laurent Montel's avatar
Laurent Montel committed
21
  ${CMAKE_SOURCE_DIR}/libkdepim
Allen Winter's avatar
Allen Winter committed
22 23
  ${AKONADI_INCLUDE_DIR}
  ${Boost_INCLUDE_DIRS}
24 25
  ${QT_INCLUDES}
  ${ZLIB_INCLUDE_DIRS}
Allen Winter's avatar
Allen Winter committed
26
)
27

28 29 30 31 32 33 34
add_subdirectory(tests)
add_subdirectory(interfaces)
if(KDEPIM_BUILD_DESKTOP)
  add_subdirectory(pixmaps)
  add_subdirectory(sounds)
  add_subdirectory(plugins)
  add_subdirectory(kcmconfigs)
Allen Winter's avatar
Allen Winter committed
35
endif()
36

37 38 39 40
set(PERL ${PERL_EXECUTABLE})
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/ical2vcal.cmake ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal @ONLY
)
41

Allen Winter's avatar
Allen Winter committed
42
########### next target ###############
43

44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
if(KDEPIM_BUILD_DESKTOP)
  set(korganizer_SRCS
    main.cpp
    korganizer.cpp
    koapp.cpp
  )

  kde4_add_app_icon(korganizer_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/pixmaps/hi*-apps-korganizer.png")

  kde4_add_executable(korganizer ${korganizer_SRCS})

  target_link_libraries(korganizer
    ${KDE4_KDEUI_LIBS}
    ${KDE4_KPARTS_LIBRARY}
    ${KDEPIMLIBS_KHOLIDAYS_LIBS}
    ${KDEPIMLIBS_KONTACTINTERFACE_LIBS}
    ${KDEPIMLIBS_AKONADI_LIBS}
    ${KDEPIMLIBS_KCALCORE_LIBS}
    ${KDEPIMLIBS_KCALUTILS_LIBS}
    kdepim
    kdepimdbusinterfaces
    korganizerprivate
    korganizer_interfaces
    korganizer_core
    calendarsupport
    akonadi-calendar
  )

  install(TARGETS
    korganizer ${INSTALL_TARGETS_DEFAULT_ARGS}
  )
75 76 77

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

78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
  set(kcm_korganizer_PART_SRCS
    kcmdesignerfields.cpp
    koprefsdialog.cpp
    kitemiconcheckcombo.cpp
  )

  kde4_add_plugin(kcm_korganizer ${kcm_korganizer_PART_SRCS})

  target_link_libraries(kcm_korganizer
    akonadi-calendar
    calendarsupport
    eventviews
    incidenceeditorsng
    kdepim
    korganizer_core
    korganizerprivate
Laurent Montel's avatar
Laurent Montel committed
94
    pimcommon
95 96 97 98 99 100 101 102 103 104 105 106 107
    ${KDEPIMLIBS_AKONADI_LIBS}
    ${KDEPIMLIBS_KCALCORE_LIBS}
    ${KDEPIMLIBS_KCALUTILS_LIBS}
    ${KDEPIMLIBS_KHOLIDAYS_LIBS}
    ${KDEPIMLIBS_MAILTRANSPORT_LIBS}
    ${KDE4_KDEUI_LIBS}
    ${QT_QTUITOOLS_LIBRARY}
  )

  install(TARGETS
    kcm_korganizer
    DESTINATION ${PLUGIN_INSTALL_DIR}
  )
108 109 110

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

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
  set(korganizerpart_PART_SRCS korganizer_part.cpp)

  kde4_add_plugin(korganizerpart ${korganizerpart_PART_SRCS})

  target_link_libraries(korganizerpart
    calendarsupport
    korganizer_core
    korganizer_interfaces
    korganizerprivate
    ${KDEPIMLIBS_AKONADI_LIBS}
    ${KDEPIMLIBS_KCALCORE_LIBS}
    ${KDEPIMLIBS_KCALUTILS_LIBS}
    ${KDE4_KDECORE_LIBS}
    ${KDE4_KPARTS_LIBS}
  )

  install(TARGETS
    korganizerpart
    DESTINATION ${PLUGIN_INSTALL_DIR}
  )

endif()
Allen Winter's avatar
Allen Winter committed
133

134
########### next target ###############
135

136 137 138 139
set(korganizer_core_LIB_SRCS
  koprefs.cpp
  kocore.cpp
)
140

141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
kde4_add_kcfg_files(korganizer_core_LIB_SRCS koprefs_base.kcfgc)

kde4_add_library(korganizer_core ${LIBRARY_TYPE} ${korganizer_core_LIB_SRCS})

target_link_libraries(korganizer_core
  calendarsupport
  eventviews
  incidenceeditorsng
  kdepim
  korganizer_interfaces
  ${KDEPIMLIBS_AKONADI_LIBS}
  ${KDEPIMLIBS_KCALCORE_LIBS}
  ${KDEPIMLIBS_KCALUTILS_LIBS}
  ${KDEPIMLIBS_KMIME_LIBS}
  ${KDEPIMLIBS_KPIMIDENTITIES_LIBS}
  ${KDE4_KDECORE_LIBS}
  ${KDE4_KIO_LIBS}
)
159

160 161 162 163 164 165 166 167
set_target_properties(korganizer_core PROPERTIES
  VERSION ${GENERIC_LIB_VERSION}
  SOVERSION ${GENERIC_LIB_SOVERSION}
)

install(TARGETS
  korganizer_core ${INSTALL_TARGETS_DEFAULT_ARGS}
)
168 169 170

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

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 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
if(KDEPIM_BUILD_DESKTOP)

set(korganizerprivate_LIB_SRCS
    aboutdata.cpp
    actionmanager.cpp
    akonadicollectionview.cpp
    calendarview.cpp
    datechecker.cpp
    datenavigator.cpp
    datenavigatorcontainer.cpp
    docprefs.cpp
    exportwebdialog.cpp
    filtereditdialog.cpp
    htmlexportjob.cpp
    kdatenavigator.cpp
    kocheckableproxymodel.cpp
    kocorehelper.cpp
    kodaymatrix.cpp
    kodialogmanager.cpp
    koeventpopupmenu.cpp
    koeventview.cpp
    koeventviewerdialog.cpp
    koglobals.cpp
    kohelper.cpp
    korganizerifaceimpl.cpp
    koviewmanager.cpp
    kowindowlist.cpp
    navigatorbar.cpp
    previewdialog.cpp
    searchdialog.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/timespentview/kotimespentview.cpp
    views/todoview/kotodoview.cpp
    views/whatsnextview/kowhatsnextview.cpp
  )

  kde4_add_kcfg_files(korganizerprivate_LIB_SRCS htmlexportsettings.kcfgc)

  kde4_add_ui_files(korganizerprivate_LIB_SRCS
    filteredit_base.ui
    kogroupwareprefspage.ui
    multiagendaviewconfigwidget.ui
    searchdialog_base.ui
    timescaleedit_base.ui
  )

  qt4_add_resources(korganizerprivate_LIB_SRCS
    agendaitem_pixmaps/agendaitemtheme.qrc)

  qt4_add_dbus_adaptor(korganizerprivate_LIB_SRCS
    org.kde.korganizer.Korganizer.xml korganizerifaceimpl.h
    KOrganizerIfaceImpl
  )

  qt4_add_dbus_adaptor(korganizerprivate_LIB_SRCS
    org.kde.Korganizer.Calendar.xml actionmanager.h
    ActionManager calendaradaptor KOrgCalendarAdaptor
233 234
  )

235 236 237
  qt4_add_dbus_interfaces(korganizerprivate_LIB_SRCS
    org.kde.korganizer.Korganizer.xml
  )
238

239 240 241
  qt4_add_dbus_interfaces(korganizerprivate_LIB_SRCS
    ${CMAKE_SOURCE_DIR}/korgac/org.kde.korganizer.KOrgac.xml
  )
242

243 244 245 246 247 248 249 250 251 252
  qt4_add_dbus_interfaces(korganizerprivate_LIB_SRCS
    ${CMAKE_SOURCE_DIR}/korganizer/org.kde.korganizer.Korganizer.xml
  )

  kde4_add_library(korganizerprivate ${LIBRARY_TYPE} ${korganizerprivate_LIB_SRCS})

  target_link_libraries(korganizerprivate
    pimcommon
    akonadi_next
    akonadi-calendar
253 254 255
    calendarsupport
    eventviews
    incidenceeditorsng
Allen Winter's avatar
Allen Winter committed
256
    kdepim
257 258 259
    kdepimdbusinterfaces
    kdgantt2
    korganizer_core
Allen Winter's avatar
Allen Winter committed
260
    korganizer_interfaces
261
    ${KDEPIMLIBS_AKONADI_CALENDAR_LIBS}
Allen Winter's avatar
Allen Winter committed
262
    ${KDEPIMLIBS_AKONADI_LIBS}
263
    ${KDEPIMLIBS_KABC_LIBS}
Allen Winter's avatar
Allen Winter committed
264 265
    ${KDEPIMLIBS_KCALCORE_LIBS}
    ${KDEPIMLIBS_KCALUTILS_LIBS}
266
    ${KDEPIMLIBS_KHOLIDAYS_LIBS}
Allen Winter's avatar
Allen Winter committed
267 268
    ${KDEPIMLIBS_KMIME_LIBS}
    ${KDEPIMLIBS_KPIMIDENTITIES_LIBS}
269 270 271 272 273
    ${KDEPIMLIBS_MAILTRANSPORT_LIBS}
    ${KDE4_KCMUTILS_LIBS}
    ${KDE4_KNEWSTUFF3_LIBS}
    ${KDE4_KPRINTUTILS_LIBS}
    ${ZLIB_LIBRARIES}
Allen Winter's avatar
Allen Winter committed
274 275
  )

276
  set_target_properties(korganizerprivate PROPERTIES
Allen Winter's avatar
Allen Winter committed
277 278
    VERSION ${GENERIC_LIB_VERSION}
    SOVERSION ${GENERIC_LIB_SOVERSION}
279
  )
280

Allen Winter's avatar
Allen Winter committed
281
  install(TARGETS
282 283
    korganizerprivate ${INSTALL_TARGETS_DEFAULT_ARGS}
    LIBRARY NAMELINK_SKIP
Allen Winter's avatar
Allen Winter committed
284 285
  )

286
########### install files ###############
287

288 289 290 291
  install(FILES
    korganizer.kcfg
    DESTINATION ${KCFG_INSTALL_DIR}
  )
292

293 294 295 296 297 298 299 300 301
  install(FILES
    korganizer_part.rc
    DESTINATION ${DATA_INSTALL_DIR}/korganizer
  )

  install(FILES
    dbuscalendar.desktop
    DESTINATION ${SERVICETYPES_INSTALL_DIR}
  )
302

303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341
  install(FILES
    tips
    DESTINATION ${DATA_INSTALL_DIR}/korganizer
  )

  install(FILES
    korganizer_part.desktop webcal.protocol
    DESTINATION ${SERVICES_INSTALL_DIR}
  )

  install(FILES
    korganizerui.rc
    DESTINATION ${DATA_INSTALL_DIR}/korganizer
  )

  install(FILES
    korganizer.upd
    DESTINATION ${KCONF_UPDATE_INSTALL_DIR}
  )

  install(FILES
    org.kde.Korganizer.Calendar.xml org.kde.korganizer.Korganizer.xml
    DESTINATION ${DBUS_INTERFACES_INSTALL_DIR}
  )

  install(FILES
    korganizer.knsrc
    DESTINATION ${CONFIG_INSTALL_DIR}
  )

  install(PROGRAMS
    korganizer.desktop korganizer-import.desktop
    DESTINATION ${XDG_APPS_INSTALL_DIR}
  )

  install(PROGRAMS
    ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal
    DESTINATION ${BIN_INSTALL_DIR}
  )
Allen Winter's avatar
Allen Winter committed
342 343

endif()