CMakeLists.txt 5.16 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.15.40")
3
set(PIM_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "20.11.80")
5
set(KALARM_VERSION "3.1.0")
Laurent Montel's avatar
Laurent Montel committed
6

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

Laurent Montel's avatar
Laurent Montel committed
9
set(KF5_MIN_VERSION "5.74.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
15
16
set(CMAKE_MODULE_PATH ${kalarm_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(ECMInstallIcons)

include(ECMSetupVersion)
include(ECMAddTests)
17

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

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

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

Laurent Montel's avatar
Laurent Montel committed
31
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
32
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
33
34

# add an extra space
35
if (DEFINED KDEPIM_DEV_VERSION)
Laurent Montel's avatar
Laurent Montel committed
36
37
38
39
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
endif()


40
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
41
42
43
44
45
46
47
48
49
50
set(KIMAP_LIB_VERSION "5.15.40")
set(AKONADI_MIMELIB_VERSION "5.15.40")
set(AKONADI_CONTACT_VERSION "5.15.40")

set(KMAILTRANSPORT_LIB_VERSION "5.15.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.15.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.15.40")
set(AKONADI_VERSION "5.15.40")
set(KMIME_LIB_VERSION "5.15.40")
set(AKONADIKALARM_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
51
set(PIMCOMMON_LIB_VERSION "5.15.40")
52
set(GRANTLEETHEME_LIB_VERSION "5.15.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.13.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
set(MAILCOMMON_LIB_VERSION "5.15.40")
61
set(CALENDARUTILS_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
62

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

65
# Find KF5 packages
66
find_package(KF5Auth ${KF5_MIN_VERSION} CONFIG REQUIRED)
67
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
68
69
70
71
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
72
find_package(KF5Crash ${KF5_MIN_VERSION} CONFIG REQUIRED)
73
74
75
76
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)
77
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
78
79
80
81
82
83
84
85
86
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)
Laurent Montel's avatar
Laurent Montel committed
87
88
find_package(Phonon4Qt5 CONFIG REQUIRED)

89
# Find KDE PIM packages
Laurent Montel's avatar
Laurent Montel committed
90
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
91
92
93
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
94
find_package(KF5AlarmCalendar ${KALARMCALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
95
96
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
97
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
98
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
99
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
100
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
101
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
102
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
103
configure_file(kalarm-version-string.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kalarm-version-string.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
104
105
106

if (NOT APPLE)
    find_package(X11)
Laurent Montel's avatar
Laurent Montel committed
107
endif()
Laurent Montel's avatar
Laurent Montel committed
108
109
110
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
111

Laurent Montel's avatar
Laurent Montel committed
112
set(KDEPIM_HAVE_X11 ${X11_FOUND})
David Jarvie's avatar
David Jarvie committed
113
114
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
115

Laurent Montel's avatar
Laurent Montel committed
116
include_directories(${kalarm_SOURCE_DIR} ${kalarm_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
117

Laurent Montel's avatar
Laurent Montel committed
118
add_definitions(-DQT_MESSAGELOGCONTEXT)
Laurent Montel's avatar
Laurent Montel committed
119
add_definitions(-DQT_NO_FOREACH)
120
add_definitions(-DQT_NO_KEYWORDS)
121
122
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
David Jarvie's avatar
David Jarvie committed
123
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
124
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
125

126

Laurent Montel's avatar
Laurent Montel committed
127
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
128

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

Laurent Montel's avatar
Laurent Montel committed
135
136
add_subdirectory(doc)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)