CMakeLists.txt 5.58 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.17.2")
3
set(PIM_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
set(RELEASE_SERVICE_VERSION "21.04.2")
5
set(KALARM_VERSION "3.2.2")
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.79.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)
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})")
Laurent Montel's avatar
Laurent Montel committed
41
42
43
44
45
46
47
48
49
50
51
52
53
set(KALARMCALENDAR_LIB_VERSION "5.17.2")
set(KIMAP_LIB_VERSION "5.17.2")
set(AKONADI_MIMELIB_VERSION "5.17.2")
set(AKONADI_CONTACT_VERSION "5.17.2")

set(KMAILTRANSPORT_LIB_VERSION "5.17.2")
set(KPIMTEXTEDIT_LIB_VERSION "5.17.2")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.17.2")
set(AKONADI_VERSION "5.17.2")
set(KMIME_LIB_VERSION "5.17.2")
set(AKONADIKALARM_LIB_VERSION "5.17.2")
set(PIMCOMMON_LIB_VERSION "5.17.2")
set(GRANTLEETHEME_LIB_VERSION "5.17.2")
Laurent Montel's avatar
Laurent Montel committed
54

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

58
set(QT_REQUIRED_VERSION "5.14.0")
Laurent Montel's avatar
Laurent Montel committed
59
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Gui Network Widgets)
Laurent Montel's avatar
Laurent Montel committed
60
set(CALENDARUTILS_LIB_VERSION "5.17.2")
Laurent Montel's avatar
Laurent Montel committed
61

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

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

90
# Find KDE PIM packages
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
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
95
find_package(KF5AlarmCalendar ${KALARMCALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
96
97
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_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()
108
109
110
if (X11_FOUND)
    find_package(Qt5X11Extras ${QT_REQUIRED_VERSION} REQUIRED NO_MODULE)
endif()
Laurent Montel's avatar
Laurent Montel committed
111
112
113
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
114

Laurent Montel's avatar
Laurent Montel committed
115
set(KDEPIM_HAVE_X11 ${X11_FOUND})
David Jarvie's avatar
David Jarvie committed
116
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)
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=0x055000)
Laurent Montel's avatar
Laurent Montel committed
125
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
126

Laurent Montel's avatar
Laurent Montel committed
127
128
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
129
130
131
    if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
        message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
    else()
Laurent Montel's avatar
Laurent Montel committed
132
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
133
134
    endif()
endif()
135

Laurent Montel's avatar
Laurent Montel committed
136
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
137

138
ecm_qt_install_logging_categories(
139
140
141
142
    EXPORT KALARM
    FILE kalarm.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
143

Laurent Montel's avatar
Laurent Montel committed
144
add_subdirectory(doc)
145
146
ki18n_install(po)
kdoctools_install(po)
Laurent Montel's avatar
Laurent Montel committed
147
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)