Commit 1f2358fb authored by Laurent Montel's avatar Laurent Montel 😁

Make it install

parent a711cdc6
# The following macros can be defined to alter behavior.
# (if desired, use add_definitions() to define them)
#
# EVENTVIEWS_NODECOS - turns-off decoration plugins in views.
# No idea why you would want to define this, perhaps to save
# screen real estate? But there are a config options for that.
project(calendarView)
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions(-DTRANSLATION_DOMAIN=\"libeventviews\")
if(KDEPIM_BUILD_EXAMPLES)
add_subdirectory(viewerapp)
endif()
option(EVENTVIEWS_NODECOS "Turn-off decoration plugins in views." FALSE)
if(EVENTVIEWS_NODECOS)
add_definitions(-DEVENTVIEWS_NODECOS)
endif()
########### next target ###############
set(eventviews_LIB_SRCS
eventview_p.cpp
eventview.cpp
helper.cpp
prefs.cpp
# Agenda view specific code.
agenda/agenda.cpp
agenda/agendaitem.cpp
agenda/agendaview.cpp
agenda/alternatelabel.cpp
agenda/calendardecoration.cpp
agenda/decorationlabel.cpp
agenda/timelabels.cpp
agenda/timelabelszone.cpp
agenda/timescaleconfigdialog.cpp
agenda/viewcalendar.cpp
journal/journalframe.cpp
journal/journalview.cpp
list/listview.cpp
month/monthgraphicsitems.cpp
month/monthitem.cpp
month/monthscene.cpp
month/monthview.cpp
multiagenda/multiagendaview.cpp
cmake_minimum_required(VERSION 2.8.12)
project(eventviews)
if(${CMAKE_SOURCE_DIR} STREQUAL ${eventviews_SOURCE_DIR})
# ECM setup
find_package(ECM 5.14.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
include(ECMPackageConfigHelpers)
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
set(KF5_VERSION "5.14.0")
set(KDEPIMLIBS_LIB_VERSION "5.0.42")
set(KDEPIM_LIB_VERSION "5.43.0")
set(QT_REQUIRED_VERSION "5.4.0")
set(KMIME_LIB_VERSION "4.87.0")
find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test UiTools)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX EVENTVIEWS
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/eventviews_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfigVersion.cmake"
SOVERSION 5
)
todo/tododelegates.cpp
todo/todomodel.cpp
todo/incidencetreemodel.cpp
########### Targets ###########
todo/todoviewquickaddline.cpp
todo/todoviewquicksearch.cpp
todo/todoviewsortfilterproxymodel.cpp
todo/todoviewview.cpp
todo/todoview.cpp
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
timeline/timelineview.cpp
timeline/timelineitem.cpp
timeline/timelineview_p.cpp
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5EventViews")
timespent/timespentview.cpp
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5EventViewsConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
whatsnext/whatsnextview.cpp
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
kconfig_add_kcfg_files(eventviews_LIB_SRCS prefs_base.kcfgc)
install(EXPORT KF5EventViewsTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5EventViewsTargets.cmake NAMESPACE KF5::)
ecm_qt_declare_logging_category(eventviews_LIB_SRCS HEADER calendarview_debug.h IDENTIFIER CALENDARVIEW_LOG CATEGORY_NAME log_calendarview)
ki18n_wrap_ui(eventviews_LIB_SRCS
agenda/timescaleedit_base.ui
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/eventviews_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
add_library(eventviews ${eventviews_LIB_SRCS})
generate_export_header(eventviews BASE_NAME eventviews)
target_link_libraries(eventviews
PUBLIC
KF5::AkonadiCore
KF5::CalendarSupport
KF5::CalendarCore
KF5::CalendarUtils
KF5::AkonadiCalendar
PRIVATE
KF5::Libkdepim
KF5::Codecs
kdgantt2
KF5::AkonadiWidgets
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
else()
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX EVENTVIEWS
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/eventviews_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5EventViewsConfigVersion.cmake"
SOVERSION 5
)
endif()
target_include_directories(eventviews PUBLIC "$<BUILD_INTERFACE:${calendarView_SOURCE_DIR};${calendarView_BINARY_DIR}>")
set_target_properties(eventviews PROPERTIES VERSION ${KDEPIM_LIB_VERSION} SOVERSION ${KDEPIM_LIB_SOVERSION})
install(TARGETS eventviews ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES agenda/calendardecoration.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
# The following macros can be defined to alter behavior.
# (if desired, use add_definitions() to define them)
#
# EVENTVIEWS_NODECOS - turns-off decoration plugins in views.
# No idea why you would want to define this, perhaps to save
# screen real estate? But there are a config options for that.
add_definitions( -DQT_NO_CAST_FROM_ASCII )
add_definitions( -DQT_NO_CAST_TO_ASCII )
add_definitions(-DTRANSLATION_DOMAIN=\"libeventviews\")
if(KDEPIM_BUILD_EXAMPLES)
add_subdirectory(viewerapp)
endif()
option(EVENTVIEWS_NODECOS "Turn-off decoration plugins in views." FALSE)
if(EVENTVIEWS_NODECOS)
add_definitions(-DEVENTVIEWS_NODECOS)
endif()
########### next target ###############
set(eventviews_LIB_SRCS
eventview_p.cpp
eventview.cpp
helper.cpp
prefs.cpp
# Agenda view specific code.
agenda/agenda.cpp
agenda/agendaitem.cpp
agenda/agendaview.cpp
agenda/alternatelabel.cpp
agenda/calendardecoration.cpp
agenda/decorationlabel.cpp
agenda/timelabels.cpp
agenda/timelabelszone.cpp
agenda/timescaleconfigdialog.cpp
agenda/viewcalendar.cpp
journal/journalframe.cpp
journal/journalview.cpp
list/listview.cpp
month/monthgraphicsitems.cpp
month/monthitem.cpp
month/monthscene.cpp
month/monthview.cpp
multiagenda/multiagendaview.cpp
todo/tododelegates.cpp
todo/todomodel.cpp
todo/incidencetreemodel.cpp
todo/todoviewquickaddline.cpp
todo/todoviewquicksearch.cpp
todo/todoviewsortfilterproxymodel.cpp
todo/todoviewview.cpp
todo/todoview.cpp
timeline/timelineview.cpp
timeline/timelineitem.cpp
timeline/timelineview_p.cpp
timespent/timespentview.cpp
whatsnext/whatsnextview.cpp
)
kconfig_add_kcfg_files(eventviews_LIB_SRCS prefs_base.kcfgc)
ecm_qt_declare_logging_category(eventviews_LIB_SRCS HEADER calendarview_debug.h IDENTIFIER CALENDARVIEW_LOG CATEGORY_NAME log_calendarview)
ki18n_wrap_ui(eventviews_LIB_SRCS
agenda/timescaleedit_base.ui
)
add_library(KF5EventViews ${eventviews_LIB_SRCS})
generate_export_header(KF5EventViews BASE_NAME eventviews)
add_library(KF5::EventViews ALIAS KF5EventViews)
target_link_libraries(KF5EventViews
PUBLIC
KF5::AkonadiCore
KF5::CalendarSupport
KF5::CalendarCore
KF5::CalendarUtils
KF5::AkonadiCalendar
PRIVATE
KF5::Libkdepim
KF5::Codecs
kdgantt2
KF5::AkonadiWidgets
)
target_include_directories(KF5EventViews INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/EventViews/;${KDE_INSTALL_INCLUDEDIR_KF5}/eventviews>")
target_include_directories(KF5EventViews PUBLIC "$<BUILD_INTERFACE:${eventviews_SOURCE_DIR}/src;${eventviews_BINARY_DIR}/src;>")
set_target_properties(KF5EventViews PROPERTIES
VERSION ${EVENTVIEWS_VERSION_STRING}
SOVERSION ${EVENTVIEWS_SOVERSION}
EXPORT_NAME EventViews
)
install(TARGETS
KF5EventViews
EXPORT KF5EventViewsTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
)
ecm_generate_headers(eventviews_CamelCase_HEADERS
HEADER_NAMES
Prefs
EventView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
)
ecm_generate_headers(eventviews_agenda_HEADERS
HEADER_NAMES
CalendarDecoration
AgendaView
ViewCalendar
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE agenda
)
ecm_generate_headers(eventviews_todo_HEADERS
HEADER_NAMES
TodoView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE todo
)
ecm_generate_headers(eventviews_month_HEADERS
HEADER_NAMES
MonthView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE month
)
ecm_generate_headers(eventviews_list_HEADERS
HEADER_NAMES
ListView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE list
)
ecm_generate_headers(eventviews_journal_HEADERS
HEADER_NAMES
JournalView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE journal
)
ecm_generate_headers(eventviews_multiagenda_HEADERS
HEADER_NAMES
MultiAgendaView
ConfigDialogInterface
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE multiagenda
)
ecm_generate_headers(eventviews_timeline_HEADERS
HEADER_NAMES
TimeLineView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE timeline
)
ecm_generate_headers(eventviews_timespent_HEADERS
HEADER_NAMES
TimeSpentView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE timespent
)
ecm_generate_headers(eventviews_whatsnext_HEADERS
HEADER_NAMES
WhatsNextView
REQUIRED_HEADERS eventviews_HEADERS
PREFIX EventViews
RELATIVE whatsnext
)
if(${CMAKE_SOURCE_DIR} STREQUAL ${eventviews_SOURCE_DIR})
install(FILES
${eventviews_CamelCase_HEADERS}
${eventviews_agenda_HEADERS}
${eventviews_todo_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/EventViews
COMPONENT Devel
)
install(FILES
${eventviews_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/eventviews_export.h
${eventviews_CamelCase_HEADERS}
${eventviews_agenda_HEADERS}
${eventviews_todo_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/eventviews
COMPONENT Devel
)
endif()
install(FILES agenda/calendardecoration.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
project(calendarviewsapp)
set(viewerapp_SRCS
main.cpp
......@@ -16,7 +15,7 @@ add_executable(viewerapp ${viewerapp_SRCS})
target_link_libraries(viewerapp
KF5::CalendarSupport
eventviews
KF5::EventViews
KF5::AkonadiWidgets
KF5::CalendarCore
KF5::AkonadiCalendar
......
......@@ -5,6 +5,6 @@ target_link_libraries(createcolorgui_test
Qt5::Test
Qt5::Core
Qt5::Gui
eventviews
KF5::EventViews
)
......@@ -102,7 +102,7 @@ PUBLIC
KF5::CalendarUtils
KF5::MailTransport
KF5::CalendarSupport # For KCalPrefs
eventviews
KF5::EventViews
kdgantt2 # For FreeBusy Editor
PRIVATE
KF5::Libkdepim
......
......@@ -29,8 +29,8 @@
#include "freebusyganttproxymodel.h"
#include <eventviews/agenda/agendaview.h>
#include <eventviews/agenda/viewcalendar.h>
#include <EventViews/AgendaView>
#include <EventViews/ViewCalendar>
#include <KCalCore/Event>
#include <KCalCore/MemoryCalendar>
......
......@@ -31,7 +31,7 @@
#include "freebusymodel/freebusycalendar.h"
#include "resourceitem.h"
#include <eventviews/agenda/viewcalendar.h>
#include <EventViews/ViewCalendar>
#include <QDialog>
#include <QStringList>
......
......@@ -72,7 +72,7 @@ generate_export_header(kcm_korganizer BASE_NAME kcm_korganizer)
target_link_libraries(kcm_korganizer
KF5::AkonadiCalendar
KF5::CalendarSupport
eventviews
KF5::EventViews
KF5::IncidenceEditorsng
KF5::Libkdepim
korganizer_core
......@@ -130,7 +130,7 @@ PUBLIC
korganizer_interfaces
PRIVATE
KF5::CalendarSupport
eventviews