CMakeLists.txt 6.46 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(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 "20.11.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.72.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
59
60
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
61
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
62
include(ECMInstallIcons)
63
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
64
include(GenerateExportHeader)
65

66
67
68
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

Laurent Montel's avatar
Laurent Montel committed
69

70
set(QT_REQUIRED_VERSION "5.13.0")
71
72
73

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

set(IDENTITYMANAGEMENT_LIB_VERSION "5.15.40")
set(KMAILTRANSPORT_LIB_VERSION "5.15.40")
set(CALENDARUTILS_LIB_VERSION "5.15.40")
set(KDAV_LIB_VERSION "5.15.40")
set(KIMAP_LIB_VERSION "5.15.40")
set(KMBOX_LIB_VERSION "5.15.40")
set(AKONADICALENDAR_LIB_VERSION "5.15.40")
set(KONTACTINTERFACE_LIB_VERSION "5.15.40")
set(AKONADIKALARM_LIB_VERSION "5.15.40")
set(KMIME_LIB_VERSION "5.15.40")
set(XMLRPCCLIENT_LIB_VERSION "5.15.40")
set(AKONADIMIME_LIB_VERSION "5.15.40")
set(AKONADICONTACT_LIB_VERSION "5.15.40")
set(AKONADINOTE_LIB_VERSION "5.15.40")
set(PIMCOMMON_LIB_VERSION "5.15.40")
set(KGAPI_LIB_VERSION "5.15.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.15.40")
set(KLDAP_LIB_VERSION "5.15.40")
94

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

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

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

Laurent Montel's avatar
Laurent Montel committed
109

110
# KF5 package
111
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(KF5DocTools ${KF5_MIN_VERSION} CONFIG REQUIRED) # pop3
find_package(KF5Holidays ${KF5_MIN_VERSION} CONFIG REQUIRED)
122
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
123
124

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

145
option(KDEPIM_RUN_ISOLATED_TESTS "Run the isolated tests." FALSE)
146
option(NO_REGENERATE_MIME "Don't regenerate mime file (developer-only option)" FALSE )
147

Laurent Montel's avatar
Laurent Montel committed
148
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
149
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054800)
Laurent Montel's avatar
Laurent Montel committed
150
151
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
152
add_definitions(-DQT_NO_EMIT)
Laurent Montel's avatar
Laurent Montel committed
153

154
add_subdirectory(resources)
Laurent Montel's avatar
Laurent Montel committed
155
add_subdirectory(agents)
Laurent Montel's avatar
Laurent Montel committed
156
add_subdirectory(defaultsetup)
Laurent Montel's avatar
Laurent Montel committed
157
add_subdirectory(kioslave)
Laurent Montel's avatar
Laurent Montel committed
158
add_subdirectory(migration)
159
add_subdirectory(kcms)
Laurent Montel's avatar
Laurent Montel committed
160
add_subdirectory(doc)
161

Laurent Montel's avatar
Laurent Montel committed
162
## install the MIME type spec file for KDEPIM specific MIME types
163
install(FILES kdepim-mime.xml DESTINATION ${KDE_INSTALL_MIMEDIR})
164
165
166
if (NOT NO_REGENERATE_MIME)
   update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
endif()   
167
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
168
169
170
171
        EXPORT KDEPIMRUNTIME
        FILE kdepim-runtime.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
172

173
174
175
176
feature_summary(WHAT ALL
                INCLUDE_QUIET_PACKAGES
                FATAL_ON_MISSING_REQUIRED_PACKAGES
)