CMakeLists.txt 7.39 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2
set(PIM_VERSION "5.17.40")
3
set(KDEPIM_RUNTIME_VERSION_NUMBER ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
project(kdepim-runtime VERSION ${KDEPIM_RUNTIME_VERSION_NUMBER})
5

Laurent Montel's avatar
Laurent Montel committed
6
7
8
9
if (POLICY CMP0053)
    cmake_policy(SET CMP0053 NEW)
endif()

Laurent Montel's avatar
Cleanup    
Laurent Montel committed
10
11
############### KDEPIM-Runtime version ################
# KDEPIM_RUNTIME_VERSION
12
# Version scheme: "x.y.z build".
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
13
14
15
16
17
#
# x is the version number.
# y is the major release number.
# z is the minor release number.
#
18
# "x.y.z" follow the kdelibs version kdepim is released with.
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
19
#
20
# If "z" is 0, it the version is "x.y"
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
21
#
22
# KDEPIM_DEV_VERSION
23
# is empty for final versions. For development versions "build" is
24
# something like "pre", "", "alpha", "beta1", "beta2", "rc1", "rc2".
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
25
26
27
28
29
#
# Examples in chronological order:
#
#    3.0
#    3.0.1
Laurent Montel's avatar
Laurent Montel committed
30
#    3.1 
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
31
32
33
34
35
36
#    3.1 beta1
#    3.1 beta2
#    3.1 rc1
#    3.1
#    3.1.1
#    3.2 pre
Laurent Montel's avatar
Laurent Montel committed
37
#    3.2 
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
38

39
40
set(KDEPIM_DEV_VERSION alpha)
set(RELEASE_SERVICE_VERSION "21.07.40")
Laurent Montel's avatar
Laurent Montel committed
41
42
43
44

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
45
46
endif()

47
set(KDEPIM_RUNTIME_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
48
49

configure_file(kdepim-runtime-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-runtime-version.h @ONLY)
Laurent Montel's avatar
Laurent Montel committed
50

51
set(KF5_MIN_VERSION "5.81.0")
52

53
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
54
set(CMAKE_MODULE_PATH ${kdepim-runtime_SOURCE_DIR}/cmake/ ${ECM_MODULE_PATH})
55

56

Laurent Montel's avatar
Laurent Montel committed
57
include(ECMSetupVersion)
58
include(FeatureSummary)
59
include(KDEGitCommitHooks)
60
61
include(KDEInstallDirs)
include(KDECMakeSettings)
62
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
63
include(ECMInstallIcons)
64
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
65
include(GenerateExportHeader)
66

67
set(CMAKE_CXX_STANDARD 17)
68
69
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Laurent Montel's avatar
Laurent Montel committed
70

71
set(QT_REQUIRED_VERSION "5.15.0")
72
73
74

set(KDEPIMRUNTIME_LIB_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}")
set(KDEPIMRUNTIME_LIB_SOVERSION "5")
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
set(AKONADI_VERSION "5.17.40")

set(IDENTITYMANAGEMENT_LIB_VERSION "5.17.40")
set(KMAILTRANSPORT_LIB_VERSION "5.17.40")
set(CALENDARUTILS_LIB_VERSION "5.17.40")
set(KIMAP_LIB_VERSION "5.17.40")
set(KMBOX_LIB_VERSION "5.17.40")
set(AKONADICALENDAR_LIB_VERSION "5.17.40")
set(KONTACTINTERFACE_LIB_VERSION "5.17.40")
set(AKONADIKALARM_LIB_VERSION "5.17.40")
set(KMIME_LIB_VERSION "5.17.40")
set(XMLRPCCLIENT_LIB_VERSION "5.17.40")
set(AKONADIMIME_LIB_VERSION "5.17.40")
set(AKONADICONTACT_LIB_VERSION "5.17.40")
set(AKONADINOTE_LIB_VERSION "5.17.40")
set(PIMCOMMON_LIB_VERSION "5.17.40")
set(KGAPI_LIB_VERSION "5.17.40")
set(LIBKDEPIM_LIB_VERSION "5.17.40")
set(KLDAP_LIB_VERSION "5.17.40")
set(GRANTLEETHEME_LIB_VERSION "5.17.40")
95

Laurent Montel's avatar
Laurent Montel committed
96
set( SharedMimeInfo_MINIMUM_VERSION "1.3" )
Laurent Montel's avatar
Laurent Montel committed
97
find_package(SharedMimeInfo ${SharedMimeInfo_MINIMUM_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
98

99
100
find_package(Sasl2)
set_package_properties(Sasl2 PROPERTIES TYPE REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
101

Daniel Vrátil's avatar
Daniel Vrátil committed
102
find_package(Qca-qt5 2.2.0 CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
103
104
105
set_package_properties(Qca-qt5 PROPERTIES DESCRIPTION "Qt Cryptographic Architecture"
                   URL "https://invent.kde.org/libraries/qca" TYPE REQUIRED
                   PURPOSE "Needed for ews resource.")
106
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
107
# QT5 package
108
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED TextToSpeech Network Widgets Test XmlPatterns DBus WebEngineWidgets NetworkAuth)
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
109

Laurent Montel's avatar
Laurent Montel committed
110

111
# KF5 package
112
113
114
115
116
117
118
119
120
121
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5NotifyConfig ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemModels ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED) # for KPluralHandlingSpinBox
find_package(KF5Notifications ${KF5_MIN_VERSION} CONFIG REQUIRED) # pop3, ews
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
122
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
123
find_package(KF5DAV ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
124
125
126
127
128
129
130
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
    "Tools to generate documentation"
    TYPE OPTIONAL
)


131
132

# KdepimLibs package
Laurent Montel's avatar
Laurent Montel committed
133
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
134
135
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
136
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
137
138
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
139
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
140
find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG)
141
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
142
143
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mbox ${KMBOX_LIB_VERSION} CONFIG REQUIRED)
Christian Mollekopf's avatar
Christian Mollekopf committed
144
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
145
find_package(KF5AkonadiNotes ${AKONADINOTE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
146
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
147
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
148
find_package(KPimGAPI ${KGAPI_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
149
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
150
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
151
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
152

153
154
155
156
157
#it will replace kwallet support
find_package(Qt5Keychain CONFIG)
set_package_properties(Qt5Keychain PROPERTIES
                                   DESCRIPTION "Provides support for secure credentials storage"
                                   URL "https://github.com/frankosterfeld/qtkeychain"
158
                                   TYPE REQUIRED)
159
160


161
option(KDEPIM_RUN_ISOLATED_TESTS "Run the isolated tests." FALSE)
162

Laurent Montel's avatar
Laurent Montel committed
163
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
164
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055200)
Laurent Montel's avatar
Laurent Montel committed
165
166
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.")
Laurent Montel's avatar
Laurent Montel committed
167
add_definitions(-DQT_NO_EMIT)
168
169
170
remove_definitions(-DQT_NO_FOREACH)
remove_definitions(-DQT_NO_KEYWORDS)
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
Laurent Montel's avatar
Laurent Montel committed
171

172
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
173

174
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
175
if (USE_UNITY_CMAKE_SUPPORT)
176
177
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
    add_definitions(-DCOMPILE_WITH_UNITY_CMAKE_SUPPORT)
178
179
endif()

180

181
add_subdirectory(resources)
Laurent Montel's avatar
Laurent Montel committed
182
add_subdirectory(agents)
Laurent Montel's avatar
Laurent Montel committed
183
add_subdirectory(defaultsetup)
Laurent Montel's avatar
Laurent Montel committed
184
add_subdirectory(kioslave)
Laurent Montel's avatar
Laurent Montel committed
185
add_subdirectory(migration)
186
add_subdirectory(kcms)
187

Laurent Montel's avatar
Laurent Montel committed
188
## install the MIME type spec file for KDEPIM specific MIME types
189
install(FILES kdepim-mime.xml DESTINATION ${KDE_INSTALL_MIMEDIR})
190
update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
191
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
192
193
194
195
        EXPORT KDEPIMRUNTIME
        FILE kdepim-runtime.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
196

197
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
198
ki18n_install(po)
Laurent Montel's avatar
Laurent Montel committed
199
200
201
202
203
if(KF5DocTools_FOUND)
    kdoctools_install(po)
    add_subdirectory(doc)
endif()

204
205
206
207
feature_summary(WHAT ALL
                INCLUDE_QUIET_PACKAGES
                FATAL_ON_MISSING_REQUIRED_PACKAGES
)