CMakeLists.txt 5.26 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2 3
set(PIM_VERSION "5.14.40")
set(PIM_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "20.07.40")
David Jarvie's avatar
David Jarvie committed
5
set(KALARM_VERSION "3.0.0")
Laurent Montel's avatar
Laurent Montel committed
6

7
project(kalarm VERSION ${KALARM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
8

9
set(KF5_MIN_VERSION "5.70.0")
Laurent Montel's avatar
Laurent Montel committed
10

11
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
12 13 14
set(CMAKE_MODULE_PATH ${kalarm_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(ECMInstallIcons)

15

Laurent Montel's avatar
Laurent Montel committed
16 17
include(ECMSetupVersion)
include(ECMAddTests)
18

Laurent Montel's avatar
Laurent Montel committed
19 20
include(GenerateExportHeader)
include(ECMGenerateHeaders)
21

Laurent Montel's avatar
Laurent Montel committed
22 23 24 25 26 27
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

include(KDEInstallDirs)
include(KDECMakeSettings)
28
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
29 30
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
31

Laurent Montel's avatar
Laurent Montel committed
32
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
33
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
34 35 36 37 38 39 40

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
endif()


41
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
Laurent Montel's avatar
Laurent Montel committed
42 43 44 45 46 47 48 49 50 51 52
set(KIMAP_LIB_VERSION "5.14.40")
set(AKONADI_MIMELIB_VERSION "5.14.40")
set(AKONADI_CONTACT_VERSION "5.14.40")

set(KMAILTRANSPORT_LIB_VERSION "5.14.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.14.40")
set(AKONADI_VERSION "5.14.40")
set(KMIME_LIB_VERSION "5.14.40")
set(AKONADIKALARM_LIB_VERSION "5.14.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
53

54
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
55 56
set(KDEPIM_LIB_SOVERSION "5")

57
set(QT_REQUIRED_VERSION "5.12.0")
Laurent Montel's avatar
Laurent Montel committed
58 59
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Network Widgets)
find_package(Qt5X11Extras NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
60 61 62 63
set(MAILCOMMON_LIB_VERSION_LIB "5.14.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.14.40")
set(KCALENDARCORE_LIB_VERSION "5.14.40")
set(CALENDARUTILS_LIB_VERSION "5.14.40")
Laurent Montel's avatar
Laurent Montel committed
64

65
option(FILE_RESOURCES "Use file system resources instead of Akonadi resources." TRUE)
David Jarvie's avatar
David Jarvie committed
66

Laurent Montel's avatar
Laurent Montel committed
67
# Find KF5 package
68 69 70 71 72
find_package(KF5Auth ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
David Jarvie's avatar
David Jarvie committed
73
find_package(KF5Crash ${KF5_MIN_VERSION} CONFIG REQUIRED)
74 75 76 77 78 79 80 81 82 83 84 85 86 87
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5GlobalAccel ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5GuiAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
88 89 90
find_package(Phonon4Qt5 CONFIG REQUIRED)

# Find KdepimLibs Package
Laurent Montel's avatar
Laurent Montel committed
91
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
92 93 94 95 96 97 98 99 100
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
101
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
102 103 104
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
105
configure_file(kalarm-version-string.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kalarm-version-string.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
106 107 108

if (NOT APPLE)
    find_package(X11)
Laurent Montel's avatar
Laurent Montel committed
109
endif()
Laurent Montel's avatar
Laurent Montel committed
110 111 112
set(CMAKE_MODULE_PATH ${kalarm_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
find_package(Xsltproc)
set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
David Jarvie's avatar
David Jarvie committed
113

Laurent Montel's avatar
Laurent Montel committed
114
set(KDEPIM_HAVE_X11 ${X11_FOUND})
David Jarvie's avatar
David Jarvie committed
115 116
set(FILE_RESOURCES ${FILE_RESOURCES})
configure_file(src/config-kalarm.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kalarm.h)
Laurent Montel's avatar
Laurent Montel committed
117

Laurent Montel's avatar
Laurent Montel committed
118
include_directories(${kalarm_SOURCE_DIR} ${kalarm_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
119

Laurent Montel's avatar
Laurent Montel committed
120
add_definitions(-DQT_MESSAGELOGCONTEXT)
Laurent Montel's avatar
Laurent Montel committed
121
add_definitions(-DQT_NO_FOREACH)
122
add_definitions(-DQT_NO_KEYWORDS)
123
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
124
	#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00) # for the moment we can't port QWheelEvent
125
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
126 127
endif()

128

Laurent Montel's avatar
Laurent Montel committed
129
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
130

131
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
132 133 134 135
        EXPORT KALARM
        FILE kalarm.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
136

Laurent Montel's avatar
Laurent Montel committed
137 138
add_subdirectory(doc)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)