CMakeLists.txt 6.02 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.13.3")
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
set(KDEPIM_DEV_VERSION)
Laurent Montel's avatar
Laurent Montel committed
40
set(KDE_APPLICATIONS_VERSION "19.12.3")
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} (${KDE_APPLICATIONS_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.63.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

Laurent Montel's avatar
Laurent Montel committed
66

67
set(QT_REQUIRED_VERSION "5.11.0")
68
69
70

set(KDEPIMRUNTIME_LIB_VERSION "${KDEPIM_RUNTIME_VERSION_NUMBER}")
set(KDEPIMRUNTIME_LIB_SOVERSION "5")
Laurent Montel's avatar
Laurent Montel committed
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
set(AKONADI_VERSION "5.13.3")

set(IDENTITYMANAGEMENT_LIB_VERSION "5.13.3")
set(KMAILTRANSPORT_LIB_VERSION "5.13.3")
set(CALENDARUTILS_LIB_VERSION "5.13.3")
set(KDAV_LIB_VERSION "5.13.3")
set(KIMAP_LIB_VERSION "5.13.3")
set(KMBOX_LIB_VERSION "5.13.3")
set(AKONADICALENDAR_LIB_VERSION "5.13.3")
set(KONTACTINTERFACE_LIB_VERSION "5.13.3")
set(AKONADIKALARM_LIB_VERSION "5.13.3")
set(KMIME_LIB_VERSION "5.13.3")
set(AKONADIMIME_LIB_VERSION "5.13.3")
set(AKONADICONTACT_LIB_VERSION "5.13.3")
set(AKONADINOTE_LIB_VERSION "5.13.3")
set(PIMCOMMON_LIB_VERSION "5.13.3")
set(KGAPI_LIB_VERSION "5.13.3")
88

Laurent Montel's avatar
Laurent Montel committed
89
set( SharedMimeInfo_MINIMUM_VERSION "1.3" )
Laurent Montel's avatar
Laurent Montel committed
90
find_package(SharedMimeInfo ${SharedMimeInfo_MINIMUM_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
91

92
93
find_package(Sasl2)
set_package_properties(Sasl2 PROPERTIES TYPE REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
94

95
find_package(Qca-qt5)
96
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
97
# QT5 package
98
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED TextToSpeech Network Widgets Test XmlPatterns DBus WebEngineWidgets NetworkAuth)
99
100
101
102
103
if (NOT Qca-qt5_FOUND)
    message(STATUS "QCA not found, public key authentication will not be supported")
else()
    add_definitions(-DHAVE_QCA)
endif()
Laurent Montel's avatar
Cleanup    
Laurent Montel committed
104

Laurent Montel's avatar
Laurent Montel committed
105

106
# KF5 package
107
108
109
110
111
112
113
114
115
116
117
118
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)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
119
120

# KdepimLibs package
Laurent Montel's avatar
Laurent Montel committed
121
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Sandro Knauß's avatar
Sandro Knauß committed
122
find_package(KPimKDAV ${KDAV_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
123
124
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
125
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
126
127
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
128
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
129
find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG)
130
find_package(KF5CalendarCore ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
131
132
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mbox ${KMBOX_LIB_VERSION} CONFIG REQUIRED)
Christian Mollekopf's avatar
Christian Mollekopf committed
133
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
134
find_package(KF5AkonadiNotes ${AKONADINOTE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
135
find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
136
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
137
138
find_package(KPimGAPI ${KGAPI_LIB_VERSION} CONFIG REQUIRED)

139
option(KDEPIM_RUN_ISOLATED_TESTS "Run the isolated tests." FALSE)
140
option(NO_REGENERATE_MIME "Don't regenerate mime file (developer-only option)" FALSE )
141

142
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
143
144
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050D00)
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x053F00)
145
endif()
Laurent Montel's avatar
Laurent Montel committed
146
147
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
148
149


150
add_subdirectory(resources)
Laurent Montel's avatar
Laurent Montel committed
151
add_subdirectory(agents)
Laurent Montel's avatar
Laurent Montel committed
152
add_subdirectory(defaultsetup)
Laurent Montel's avatar
Laurent Montel committed
153
add_subdirectory(kioslave)
Laurent Montel's avatar
Laurent Montel committed
154
add_subdirectory(migration)
Laurent Montel's avatar
Laurent Montel committed
155
add_subdirectory(doc)
156

Laurent Montel's avatar
Laurent Montel committed
157
## install the MIME type spec file for KDEPIM specific MIME types
158
install(FILES kdepim-mime.xml DESTINATION ${KDE_INSTALL_MIMEDIR})
159
160
161
if (NOT NO_REGENERATE_MIME)
   update_xdg_mimetypes(${KDE_INSTALL_MIMEDIR})
endif()   
Laurent Montel's avatar
Laurent Montel committed
162

163
install(FILES kdepim-runtime.renamecategories kdepim-runtime.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
164

165
166
167
168
feature_summary(WHAT ALL
                INCLUDE_QUIET_PACKAGES
                FATAL_ON_MISSING_REQUIRED_PACKAGES
)