CMakeLists.txt 7.93 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1 2 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 33 34 35 36 37 38 39 40 41 42 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 75 76 77 78 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 125 126 127 128 129 130 131 132 133 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 162 163 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 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
project(korganizer)

add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions(-DTRANSLATION_DOMAIN=\"korganizer\")

include_directories(
    ${CMAKE_CURRENT_BINARY_DIR}
    )

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)

set(PERL ${PERL_EXECUTABLE})
configure_file(
    ${CMAKE_CURRENT_SOURCE_DIR}/data/ical2vcal.cmake ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal @ONLY
    )

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

set(korganizer_common_SRCS)
ecm_qt_declare_logging_category(korganizer_common_SRCS HEADER korganizer_debug.h IDENTIFIER KORGANIZER_LOG CATEGORY_NAME log_korganizer)

set(korganizer_SRCS
    main.cpp
    korganizer.cpp
    koapp.cpp
    plugininterface/korganizerplugininterface.cpp
    ${korganizer_common_SRCS}
    )

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

add_executable(korganizer ${korganizer_SRCS})

target_link_libraries(korganizer
    KF5::KontactInterface
    KF5::CalendarCore
    KF5::Libkdepim
    KF5::KdepimDBusInterfaces
    korganizerprivate
    korganizer_interfaces
    korganizer_core
    )

install(TARGETS
    korganizer ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}
    )

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

set(kcm_korganizer_PART_SRCS
    kcmdesignerfields.cpp
    korganizer_debug.cpp
    prefs/koprefsdialog.cpp
    widgets/kitemiconcheckcombo.cpp
    )

add_library(kcm_korganizer MODULE ${kcm_korganizer_PART_SRCS})
generate_export_header(kcm_korganizer BASE_NAME kcm_korganizer) 

target_link_libraries(kcm_korganizer
    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
    )

install(TARGETS
    kcm_korganizer
    DESTINATION ${KDE_INSTALL_PLUGINDIR}
    )

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

set(korganizerpart_PART_SRCS korganizer_part.cpp korganizer_debug.cpp)

add_library(korganizerpart MODULE ${korganizerpart_PART_SRCS})

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)

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 ###############

set(korganizerprivate_LIB_SRCS
    ${korganizer_common_SRCS}
    korgmigrateapplication.cpp
    collectiongeneralpage.cpp
    aboutdata.cpp
    actionmanager.cpp
    akonadicollectionview.cpp
    views/collectionview/reparentingmodel.cpp
    views/collectionview/controller.cpp
    views/collectionview/calendardelegate.cpp
    views/collectionview/quickview.cpp
    calendarview.cpp
    datechecker.cpp
    datenavigator.cpp
    datenavigatorcontainer.cpp
    dialog/exportwebdialog.cpp
    dialog/filtereditdialog.cpp
    job/htmlexportjob.cpp
    widgets/kdatenavigator.cpp
    kocheckableproxymodel.cpp
    kocorehelper.cpp
    kodaymatrix.cpp
    kodialogmanager.cpp
    koeventpopupmenu.cpp
    dialog/noteeditdialog.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/timespentview/kotimespentview.cpp
    views/todoview/kotodoview.cpp
    views/whatsnextview/kowhatsnextview.cpp
    )

kconfig_add_kcfg_files(korganizerprivate_LIB_SRCS settings/htmlexportsettings.kcfgc)

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
    )

qt5_add_resources(korganizerprivate_LIB_SRCS
    agendaitem_pixmaps/agendaitemtheme.qrc)

qt5_add_dbus_adaptor(korganizerprivate_LIB_SRCS
    data/org.kde.korganizer.Korganizer.xml impl/korganizerifaceimpl.h
    KOrganizerIfaceImpl
    )

qt5_add_dbus_adaptor(korganizerprivate_LIB_SRCS
    data/org.kde.Korganizer.Calendar.xml actionmanager.h
    ActionManager calendaradaptor KOrgCalendarAdaptor
    )

qt5_add_dbus_interfaces(korganizerprivate_LIB_SRCS
    data/org.kde.korganizer.Korganizer.xml
    )

qt5_add_dbus_interfaces(korganizerprivate_LIB_SRCS
Laurent Montel's avatar
Laurent Montel committed
226
    ../korgac/org.kde.korganizer.KOrgac.xml
Laurent Montel's avatar
Laurent Montel committed
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 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
    )

qt5_add_dbus_interfaces(korganizerprivate_LIB_SRCS
    ${CMAKE_SOURCE_DIR}/korganizer/src/data/org.kde.korganizer.Korganizer.xml
    )

add_library(korganizerprivate ${korganizerprivate_LIB_SRCS})
generate_export_header(korganizerprivate BASE_NAME korganizerprivate)

target_link_libraries(korganizerprivate
    PUBLIC
    KF5::PimCommon
    PRIVATE
    KF5::CalendarSupport
    KF5::EventViews
    KF5::IncidenceEditor
    KF5::Libkdepim
    KF5::KdepimDBusInterfaces
    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
    KF5::MailCommon
    )

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
    data/korganizer_part.rc
    DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/korganizer
    )

install(FILES
    dbuscalendar.desktop
    DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR}
    )

install(FILES
    korganizer_part.desktop data/webcal.protocol
    DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
    )

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

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

install(FILES
    data/korganizer.knsrc
    DESTINATION ${KDE_INSTALL_CONFDIR}
    )

install(PROGRAMS
    org.kde.korganizer.desktop korganizer-import.desktop
    DESTINATION ${KDE_INSTALL_APPDIR}
    )

install(FILES
    org.kde.korganizer.appdata.xml
    DESTINATION ${KDE_INSTALL_METAINFODIR}
    )

install(PROGRAMS
    ${CMAKE_CURRENT_BINARY_DIR}/ical2vcal
    DESTINATION ${KDE_INSTALL_BINDIR}
    )