Commit bff2e904 authored by Laurent Montel's avatar Laurent Montel 😁

Make it installable

parent 6aa33986
......@@ -102,7 +102,7 @@ target_link_libraries(akonadiconsole_bin
KF5::AkonadiCore
KF5::AkonadiPrivate
KF5::AkonadiContact
calendarsupport
KF5::CalendarSupport
KF5::CalendarCore
KF5::Libkdepim
KF5::MessageViewer
......
......@@ -382,7 +382,7 @@
<customwidget>
<class>CalendarSupport::IncidenceViewer</class>
<extends>QWidget</extends>
<header location="global">calendarsupport/next/incidenceviewer.h</header>
<header location="global">CalendarSupport/IncidenceViewer</header>
</customwidget>
<customwidget>
<class>MessageViewer::Viewer</class>
......
cmake_minimum_required(VERSION 2.8.12)
project(calendarsupport)
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DTRANSLATION_DOMAIN=\"calendarsupport\")
########### next target ###############
set(calendarsupport_LIB_SRCS
archivedialog.cpp
attachmenthandler.cpp
calendarsingleton.cpp
calendarutils.cpp
categoryconfig.cpp
categoryhierarchyreader.cpp
cellitem.cpp
collectionselection.cpp
eventarchiver.cpp
identitymanager.cpp
incidenceattachmentmodel.cpp
kcalmodel.cpp
kcalprefs.cpp
messagewidget.cpp
utils.cpp
tagcache.cpp
printing/calprintpluginbase.cpp
printing/calprintdefaultplugins.cpp
printing/calprinter.cpp
printing/journalprint.cpp
printing/yearprint.cpp
next/incidenceviewer.cpp
if(${CMAKE_SOURCE_DIR} STREQUAL ${calendarsupport_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 CALENDARSUPPORT
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
SOVERSION 5
)
ki18n_wrap_ui(calendarsupport_LIB_SRCS
printing/calprintdayconfig_base.ui
printing/calprintincidenceconfig_base.ui
printing/calprintjournalconfig_base.ui
printing/calprintmonthconfig_base.ui
printing/calprinttodoconfig_base.ui
printing/calprintweekconfig_base.ui
printing/calprintyearconfig_base.ui
)
ecm_qt_declare_logging_category(calendarsupport_LIB_SRCS HEADER calendarsupport_debug.h IDENTIFIER CALENDARSUPPORT_LOG CATEGORY_NAME log_calendarsupport)
kconfig_add_kcfg_files(calendarsupport_LIB_SRCS kcalprefs_base.kcfgc)
add_library(calendarsupport ${calendarsupport_LIB_SRCS})
generate_export_header(calendarsupport BASE_NAME calendarsupport)
target_link_libraries(
calendarsupport
PUBLIC
KF5::Mime
KF5::IdentityManagement
KF5::AkonadiCalendar
PRIVATE
KF5::AkonadiWidgets
KF5::Holidays
KF5::Codecs
KF5::AkonadiCore
KF5::CalendarCore
KF5::CalendarUtils
kdepimdbusinterfaces
)
########### Targets ###########
target_include_directories(calendarsupport PUBLIC "$<BUILD_INTERFACE:${calendarsupport_SOURCE_DIR};${calendarsupport_BINARY_DIR};${Boost_INCLUDE_DIRS}>")
add_definitions("-DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII")
set_target_properties(calendarsupport
PROPERTIES VERSION ${KDEPIM_LIB_VERSION}
SOVERSION ${KDEPIM_LIB_SOVERSION}
)
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5CalendarSupport")
install(TARGETS calendarsupport ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
ecm_configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/KF5CalendarSupportConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
############# Next target #######################
install(EXPORT KF5CalendarSupportTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KF5CalendarSupportTargets.cmake NAMESPACE KF5::)
set(calendarsupportcollectionpage_LIB_SRCS
collectiongeneralpage.cpp
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5} COMPONENT Devel
)
add_library(calendarsupportcollectionpage ${calendarsupportcollectionpage_LIB_SRCS})
add_dependencies(calendarsupportcollectionpage mailcommon)
generate_export_header(calendarsupportcollectionpage BASE_NAME calendarsupportcollectionpage)
target_link_libraries(
calendarsupportcollectionpage
PUBLIC
KF5::AkonadiCore
mailcommon
PRIVATE
KF5::CalendarCore
pimcommon
KF5::AkonadiCalendar
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
else()
ecm_setup_version(${KDEPIM_LIB_VERSION} VARIABLE_PREFIX CALENDARSUPPORT
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5CalendarSupportConfigVersion.cmake"
SOVERSION 5
)
endif()
target_include_directories(calendarsupportcollectionpage PUBLIC "$<BUILD_INTERFACE:${calendarsupport_SOURCE_DIR};${calendarsupport_BINARY_DIR};${Boost_INCLUDE_DIRS}>")
set_target_properties(calendarsupportcollectionpage
PROPERTIES VERSION ${KDEPIM_LIB_VERSION}
SOVERSION ${KDEPIM_LIB_VERSION}
)
add_subdirectory(src)
install(TARGETS calendarsupportcollectionpage ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(FILES calendarplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/KF5CalendarSupportTargets.cmake")
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DTRANSLATION_DOMAIN=\"calendarsupport\")
########### next target ###############
set(calendarsupport_LIB_SRCS
archivedialog.cpp
attachmenthandler.cpp
calendarsingleton.cpp
calendarutils.cpp
categoryconfig.cpp
categoryhierarchyreader.cpp
cellitem.cpp
collectionselection.cpp
eventarchiver.cpp
identitymanager.cpp
incidenceattachmentmodel.cpp
kcalmodel.cpp
kcalprefs.cpp
messagewidget.cpp
utils.cpp
tagcache.cpp
printing/calprintpluginbase.cpp
printing/calprintdefaultplugins.cpp
printing/calprinter.cpp
printing/journalprint.cpp
printing/yearprint.cpp
next/incidenceviewer.cpp
)
ki18n_wrap_ui(calendarsupport_LIB_SRCS
printing/calprintdayconfig_base.ui
printing/calprintincidenceconfig_base.ui
printing/calprintjournalconfig_base.ui
printing/calprintmonthconfig_base.ui
printing/calprinttodoconfig_base.ui
printing/calprintweekconfig_base.ui
printing/calprintyearconfig_base.ui
)
ecm_qt_declare_logging_category(calendarsupport_LIB_SRCS HEADER calendarsupport_debug.h IDENTIFIER CALENDARSUPPORT_LOG CATEGORY_NAME log_calendarsupport)
kconfig_add_kcfg_files(calendarsupport_LIB_SRCS kcalprefs_base.kcfgc)
add_library(KF5CalendarSupport ${calendarsupport_LIB_SRCS})
generate_export_header(KF5CalendarSupport BASE_NAME calendarsupport)
add_library(KF5::CalendarSupport ALIAS KF5CalendarSupport)
target_include_directories(KF5CalendarSupport INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}/CalendarSupport/;${KDE_INSTALL_INCLUDEDIR_KF5}/calendarsupport>")
target_include_directories(KF5CalendarSupport PUBLIC "$<BUILD_INTERFACE:${CalendarSupport_SOURCE_DIR}/src;${CalendarSupport_BINARY_DIR}/src;${Boost_INCLUDE_DIRS}>")
target_link_libraries(
KF5CalendarSupport
PUBLIC
KF5::Mime
KF5::IdentityManagement
KF5::AkonadiCalendar
PRIVATE
KF5::AkonadiWidgets
KF5::Holidays
KF5::Codecs
KF5::AkonadiCore
KF5::CalendarCore
KF5::CalendarUtils
kdepimdbusinterfaces
)
set_target_properties(KF5CalendarSupport PROPERTIES
VERSION ${CALENDARSUPPORT_VERSION_STRING}
SOVERSION ${CALENDARSUPPORT_SOVERSION}
EXPORT_NAME CalendarSupport
)
install(TARGETS
KF5CalendarSupport
EXPORT KF5CalendarSupportTargets ${KF5_INSTALL_TARGETS_DEFAULT_ARGS}
)
ecm_generate_headers(CalendarSupport_CamelCase_HEADERS
HEADER_NAMES
Utils
CategoryConfig
CellItem
CollectionSelection
KCalPrefs
IdentityManager
EventArchiver
Plugin
CategoryHierarchyReader
CalendarSingleton
CollectionGeneralPage
MessageWidget
ArchiveDialog
REQUIRED_HEADERS CalendarSupport_HEADERS
PREFIX CalendarSupport
)
ecm_generate_headers(CalendarSupport_printer_HEADERS
HEADER_NAMES
PrintPlugin
CalPrinter
CalPrintDefaultPlugins
REQUIRED_HEADERS CalendarSupport_HEADERS
PREFIX CalendarSupport
RELATIVE printing
)
ecm_generate_headers(CalendarSupport_next_HEADERS
HEADER_NAMES
IncidenceViewer
REQUIRED_HEADERS CalendarSupport_HEADERS
PREFIX CalendarSupport
RELATIVE next
)
if(${CMAKE_SOURCE_DIR} STREQUAL ${calendarsupport_SOURCE_DIR})
install(FILES
${CalendarSupport_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/CalendarSupport
COMPONENT Devel
)
install(FILES
${CalendarSupport_HEADERS}
${CMAKE_CURRENT_BINARY_DIR}/calendarsupport_export.h
${CalendarSupport_CamelCase_HEADERS}
DESTINATION ${KDE_INSTALL_INCLUDEDIR_KF5}/calendarsupport
COMPONENT Devel
)
endif()
############# Next target #######################
set(calendarsupportcollectionpage_LIB_SRCS
collectiongeneralpage.cpp
)
add_library(calendarsupportcollectionpage ${calendarsupportcollectionpage_LIB_SRCS})
add_dependencies(calendarsupportcollectionpage mailcommon)
generate_export_header(calendarsupportcollectionpage BASE_NAME calendarsupportcollectionpage)
target_link_libraries(
calendarsupportcollectionpage
PUBLIC
KF5::AkonadiCore
mailcommon
PRIVATE
KF5::CalendarCore
pimcommon
KF5::AkonadiCalendar
)
target_include_directories(calendarsupportcollectionpage PUBLIC "$<BUILD_INTERFACE:${calendarsupport_SOURCE_DIR};${calendarsupport_BINARY_DIR};${Boost_INCLUDE_DIRS}>")
set_target_properties(calendarsupportcollectionpage
PROPERTIES VERSION ${KDEPIM_LIB_VERSION}
SOVERSION ${KDEPIM_LIB_VERSION}
)
install(TARGETS calendarsupportcollectionpage ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(FILES calendarplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
......@@ -87,7 +87,7 @@ generate_export_header(eventviews BASE_NAME eventviews)
target_link_libraries(eventviews
PUBLIC
KF5::AkonadiCore
calendarsupport
KF5::CalendarSupport
KF5::CalendarCore
KF5::CalendarUtils
......
......@@ -34,7 +34,7 @@
#include <Akonadi/Calendar/ETMCalendar>
#include <Akonadi/Calendar/IncidenceChanger>
#include <calendarsupport/utils.h>
#include <CalendarSupport/Utils>
#include <KCalCore/Incidence>
#include <KCalCore/Todo>
......
......@@ -27,8 +27,8 @@
#include "prefs.h"
#include "prefs_base.h" // for enums
#include <calendarsupport/kcalprefs.h>
#include <calendarsupport/utils.h>
#include <CalendarSupport/KCalPrefs>
#include <CalendarSupport/Utils>
#include <KContacts/VCardDrag>
......
......@@ -25,7 +25,7 @@
#include "viewcalendar.h"
#include <calendarsupport/cellitem.h>
#include <CalendarSupport/CellItem>
#include <Akonadi/Calendar/ETMCalendar>
#include <Item>
......
......@@ -37,10 +37,10 @@
#include "calendarview_debug.h"
#include <Akonadi/Calendar/ETMCalendar>
#include <calendarsupport/collectionselection.h>
#include <CalendarSupport/CollectionSelection>
#include <Akonadi/Calendar/IncidenceChanger>
#include <calendarsupport/utils.h>
#include <calendarsupport/kcalprefs.h>
#include <CalendarSupport/Utils>
#include <CalendarSupport/KCalPrefs>
#include <KCalCore/CalFilter>
#include <KCalCore/CalFormat>
......
......@@ -21,7 +21,7 @@
#include "eventviews_export.h"
#include <calendarsupport/plugin.h>
#include <CalendarSupport/Plugin>
#include <QUrl>
......
......@@ -25,7 +25,7 @@
#include "helper.h"
#include "calendarview_debug.h"