CMakeLists.txt 7.33 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.16.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

Laurent Montel's avatar
Laurent Montel committed
39
40
set(KDEPIM_DEV_VERSION alpha)
set(RELEASE_SERVICE_VERSION "21.03.80")
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.78.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)
Laurent Montel's avatar
Laurent Montel committed
59
60
61
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
   include(KDEGitCommitHooks)
endif()
62
63
include(KDEInstallDirs)
include(KDECMakeSettings)
64
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
65
include(ECMInstallIcons)
66
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
67
include(GenerateExportHeader)
68

69
70
71
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Laurent Montel's avatar
Laurent Montel committed
72

73
set(QT_REQUIRED_VERSION "5.14.0")
74
75
76

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

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

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

101
102
find_package(Sasl2)
set_package_properties(Sasl2 PROPERTIES TYPE REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
103

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

Laurent Montel's avatar
Laurent Montel committed
112

113
# KF5 package
114
115
116
117
118
119
120
121
122
123
124
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(KF5DocTools ${KF5_MIN_VERSION} CONFIG REQUIRED) # pop3
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
125
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
126
find_package(KF5DAV ${KF5_MIN_VERSION} CONFIG REQUIRED)
127
128

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

149
150
151
152
153
#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"
154
                                   TYPE REQUIRED)
155
156


157
option(KDEPIM_RUN_ISOLATED_TESTS "Run the isolated tests." FALSE)
158

Laurent Montel's avatar
Laurent Montel committed
159
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
160
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054F00)
Laurent Montel's avatar
Laurent Montel committed
161
162
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
163
add_definitions(-DQT_NO_EMIT)
Laurent Montel's avatar
Laurent Montel committed
164

165
166
167
168
169
170
171
172
173
174
175
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
    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()
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
    endif()
endif()

176
add_subdirectory(resources)
Laurent Montel's avatar
Laurent Montel committed
177
add_subdirectory(agents)
Laurent Montel's avatar
Laurent Montel committed
178
add_subdirectory(defaultsetup)
Laurent Montel's avatar
Laurent Montel committed
179
add_subdirectory(kioslave)
Laurent Montel's avatar
Laurent Montel committed
180
add_subdirectory(migration)
181
add_subdirectory(kcms)
Laurent Montel's avatar
Laurent Montel committed
182
add_subdirectory(doc)
183

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

Laurent Montel's avatar
Laurent Montel committed
193
194
195
if(ECM_VERSION VERSION_GREATER_EQUAL 5.79)
    kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
endif()
196
197
198
199
feature_summary(WHAT ALL
                INCLUDE_QUIET_PACKAGES
                FATAL_ON_MISSING_REQUIRED_PACKAGES
)