CMakeLists.txt 10.7 KB
Newer Older
1 2
project(kdepim)

Laurent Montel's avatar
Laurent Montel committed
3
cmake_minimum_required(VERSION 2.8.12)
Laurent Montel's avatar
Laurent Montel committed
4 5 6 7
if (POLICY CMP0063)
    cmake_policy(SET CMP0063 NEW)
endif()

Laurent Montel's avatar
Laurent Montel committed
8

9 10
set(LIBRARY_NAMELINK LIBRARY NAMELINK_SKIP)

Laurent Montel's avatar
Laurent Montel committed
11
# we need some parts of the ECM CMake helpers
Laurent Montel's avatar
Laurent Montel committed
12
find_package(ECM 5.20.0 REQUIRED NO_MODULE)
Laurent Montel's avatar
Laurent Montel committed
13 14 15 16 17 18
set(CMAKE_MODULE_PATH ${kdepim_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
include(ECMMarkNonGuiExecutable)
19 20
include(GenerateExportHeader)
include(ECMGenerateHeaders)
Laurent Montel's avatar
Laurent Montel committed
21 22 23
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(CheckFunctionExists)
Laurent Montel's avatar
Laurent Montel committed
24
include(ECMGeneratePriFile)
Laurent Montel's avatar
Laurent Montel committed
25 26 27

include(KDEInstallDirs)
include(KDECMakeSettings)
28
include(KDECompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
29
include(ECMAddAppIcon)
30
include(ECMQtDeclareLoggingCategory)
Laurent Montel's avatar
Laurent Montel committed
31

Laurent Montel's avatar
Laurent Montel committed
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
# KDEPIM_VERSION
# Version scheme: "x.y.z build".
#
# x is the version number.
# y is the major release number.
# z is the minor release number.
#
# "x.y.z" follow the kdelibs version kdepim is released with.
#
# If "z" is 0, the version is "x.y"
#
# KDEPIM_DEV_VERSION is empty for final versions.
# For development versions "build" is something like "pre", "alpha1", "alpha2", "beta1", "beta2", "rc1", "rc2".
#
# Examples in chronological order:
# 3.0, 3.0.1, 3.1 alpha1, 3.1 beta1, 3.1 beta2, 3.1 rc1, 3.1, 3.1.1, 3.2 pre, 3.2 alpha1

# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
50
set(KDEPIM_DEV_VERSION pre)
Laurent Montel's avatar
Laurent Montel committed
51 52 53 54 55 56

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
  set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
endif()

Laurent Montel's avatar
Laurent Montel committed
57
set(KDEPIM_VERSION_NUMBER "5.2.42")
Laurent Montel's avatar
Laurent Montel committed
58
set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
59 60


Laurent Montel's avatar
Laurent Montel committed
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
set(KDEPIMLIBS_LIB_VERSION "5.2.40")
set(KCONTACTS_LIB_VERSION "5.2.40")
set(KCALENDARCORE_LIB_VERSION "5.2.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.2.40")
set(KLDAP_LIB_VERSION "5.2.40")
set(KMAILTRANSPORT_LIB_VERSION "5.2.40")
set(CALENDARUTILS_LIB_VERSION "5.2.40")
set(KHOLIDAYS_LIB_VERSION "5.2.40")
set(KTNEF_LIB_VERSION "5.2.40")
set(KIMAP_LIB_VERSION "5.2.40")
set(KMBOX_LIB_VERSION "5.2.40")
set(AKONADICALENDAR_LIB_VERSION "5.2.40")
set(SYNDICATION_LIB_VERSION "5.2.40")
set(GPGMEPP_LIB_VERSION "5.2.40")
set(KONTACTINTERFACE_LIB_VERSION "5.2.40")
set(AKONADIKALARM_LIB_VERSION "5.2.40")
set(KMIME_LIB_VERSION "5.2.40")
set(XMLRPCCLIENT_LIB_VERSION "5.2.40")
set(KBLOG_LIB_VERSION "5.2.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.2.40")
set(AKONADI_VERSION "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
82

Laurent Montel's avatar
Laurent Montel committed
83
set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
Laurent Montel's avatar
Laurent Montel committed
84
set(KDEPIM_LIB_SOVERSION "5")
Laurent Montel's avatar
Laurent Montel committed
85
set(AKONADINOTES_LIB_VERSION "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
86

87
set(QT_REQUIRED_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
88
set(KF5_VERSION "5.20.0")
Laurent Montel's avatar
Laurent Montel committed
89
option(KDEPIM_ENTERPRISE_BUILD "Enable features specific to the enterprise branch, which are normally disabled. Also, it disables many components not needed for Kontact such as the Kolab client." FALSE)
Laurent Montel's avatar
Laurent Montel committed
90
option(QTWEBENGINE_SUPPORT_OPTION "Enable support for QtWebEngine. False by default." FALSE)
91
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test Sql Concurrent UiTools OpenGL)
Laurent Montel's avatar
Laurent Montel committed
92
find_package(Qt5X11Extras NO_MODULE)
93
find_package(Grantlee5 "5.0" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
94 95 96
set(LIBGRAVATAR_VERSION_LIB "5.2.40")
set(LIBMAILIMPORTER_VERSION_LIB "5.2.40")
set(MAILCOMMON_LIB_VERSION_LIB "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
97
set(KDEPIM_APPS_LIB_VERSION_LIB "5.2.42")
98
set(MESSAGELIB_LIB_VERSION_LIB "5.2.56")
Laurent Montel's avatar
Laurent Montel committed
99 100 101 102 103 104 105 106 107
set(LIBKLEO_LIB_VERSION_LIB "5.2.40")
set(LIBGRANTLEETHEME_LIB_VERSION_LIB "5.2.40")
set(PIMCOMMON_LIB_VERSION_LIB "5.2.40")
set(LIBKDEPIM_LIB_VERSION_LIB "5.2.40")
set(LIBINCIDENCEEDITOR_LIB_VERSION_LIB "5.2.40")
set(CALENDARSUPPORT_LIB_VERSION_LIB "5.2.40")
set(EVENTVIEW_LIB_VERSION_LIB "5.2.40")
set(KDGANTT2_LIB_VERSION_LIB "5.2.40")
set(LIBKSIEVE_LIB_VERSION_LIB "5.2.40")
Laurent Montel's avatar
Laurent Montel committed
108

Laurent Montel's avatar
Laurent Montel committed
109
if (QTWEBENGINE_SUPPORT_OPTION)
110
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED WebEngine WebEngineWidgets)
111
    find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)    
112
    set(WEBENGINE_TYPE "QtWebEngine")
113 114
else()
    find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED WebKitWidgets)
Laurent Montel's avatar
Laurent Montel committed
115
    find_package(KF5WebKit ${KF5_VERSION} CONFIG REQUIRED)
116
    set(WEBENGINE_TYPE "QtWebKit")
Laurent Montel's avatar
Laurent Montel committed
117
endif()
118

119
# Find KF5 package
Laurent Montel's avatar
Laurent Montel committed
120
find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Port++  
Laurent Montel committed
121 122 123
find_package(KF5Wallet ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5NewStuff ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
124
find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
125
find_package(KF5NotifyConfig ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
126
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
127
find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
128
find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
129
find_package(KF5Auth ${KF5_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Cleanup  
Laurent Montel committed
130
find_package(KF5DocTools REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
131
find_package(Phonon4Qt5 CONFIG REQUIRED)
132 133 134
find_package(KF5DNSSD ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5TextEditor ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Sonnet ${KF5_VERSION} CONFIG REQUIRED)
135
find_package(KF5GlobalAccel ${KF5_VERSION} CONFIG REQUIRED)
136
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
137 138

# Find KdepimLibs Package
Laurent Montel's avatar
Laurent Montel committed
139
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
Daniel Vrátil's avatar
Daniel Vrátil committed
140
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
141 142
find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
143
find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
144 145 146
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
147
find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
148 149 150
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED)
Aleix Pol Gonzalez's avatar
Aleix Pol Gonzalez committed
151
find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
152 153 154 155 156
find_package(KF5Mbox ${KMBOX_LIB_VERSION} CONFIG REQUIRED)

find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)

find_package(KF5Syndication ${SYNDICATION_LIB_VERSION} CONFIG REQUIRED)
157
find_package(KF5Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
158 159 160 161 162
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5XmlRpcClient ${XMLRPCCLIENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Blog ${KBLOG_LIB_VERSION} CONFIG REQUIRED)
163
find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
164

Laurent Montel's avatar
Laurent Montel committed
165 166

find_package(KF5Gravatar ${LIBGRAVATAR_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
167
find_package(KF5MailImporter ${LIBMAILIMPORTER_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
168 169 170 171 172 173 174
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5KaddressbookGrantlee ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5PimCommon ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
175
find_package(KF5IncidenceEditor ${LIBINCIDENCEEDITOR_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
176
find_package(KF5MessageCore ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
177 178 179
find_package(KF5MessageComposer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MessageList ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
180 181 182 183
find_package(KF5CalendarSupport ${CALENDARSUPPORT_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5EventViews ${EVENTVIEW_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5KDGantt2 ${KDGANTT2_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5FollowupReminder ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
184 185 186
find_package(KF5SendLater ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5ComposerEditorNG ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
187
find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION_LIB} CONFIG REQUIRED)
188
find_package(MailTransportDBusService CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
189

Laurent Montel's avatar
Laurent Montel committed
190

Laurent Montel's avatar
Laurent Montel committed
191 192 193 194 195 196 197
if (NOT APPLE)
    find_package(X11)
endif()

set(KDEPIM_HAVE_X11 ${X11_FOUND})
configure_file(config-kdepim.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdepim.h )

198 199

# Extra package
Laurent Montel's avatar
Laurent Montel committed
200
find_package(KF5GAPI "4.72.0" CONFIG)
201

Laurent Montel's avatar
Laurent Montel committed
202 203 204 205
configure_file(kdepim-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-version.h @ONLY)

include_directories(${kdepim_SOURCE_DIR} ${kdepim_BINARY_DIR})

Laurent Montel's avatar
Laurent Montel committed
206 207
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
208

Laurent Montel's avatar
Laurent Montel committed
209
find_package(KF5AkonadiSearch "5.2.40" CONFIG REQUIRED)
210
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "http://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
Laurent Montel's avatar
Laurent Montel committed
211

Laurent Montel's avatar
Laurent Montel committed
212
set(Prison_MIN_VERSION "1.2.1")
Laurent Montel's avatar
Minor  
Laurent Montel committed
213
find_package(KF5Prison ${Prison_MIN_VERSION} CONFIG)
214 215
set_package_properties(Prison PROPERTIES DESCRIPTION "The Prison library" URL "http://projects.kde.org/prison" TYPE OPTIONAL PURPOSE "Needed to show mobile barcodes of your contacts")

Laurent Montel's avatar
Laurent Montel committed
216
if( KF5GAPI_FOUND )
Laurent Montel's avatar
Laurent Montel committed
217 218
  add_definitions( -DKDEPIM_STORAGESERVICE_GDRIVE )
endif()
Laurent Montel's avatar
Laurent Montel committed
219

Laurent Montel's avatar
Laurent Montel committed
220 221 222 223
if(KDEPIM_ENTERPRISE_BUILD)
  message(STATUS "Enterprise build is enabled.")
endif()

Laurent Montel's avatar
Laurent Montel committed
224 225
############### Desktop vs. Mobile options ##############

Laurent Montel's avatar
Minor  
Laurent Montel committed
226 227
add_definitions(-DQT_USE_QSTRINGBUILDER)

Laurent Montel's avatar
Laurent Montel committed
228

229 230 231
find_package(Boost 1.34.0)
set_package_properties(Boost PROPERTIES DESCRIPTION "Boost C++ Libraries" URL "http://www.boost.org" TYPE REQUIRED PURPOSE "Boost is required for building most KDEPIM applications")

Laurent Montel's avatar
Laurent Montel committed
232 233
# config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
Laurent Montel's avatar
Laurent Montel committed
234

Laurent Montel's avatar
Cleanup  
Laurent Montel committed
235 236
add_subdirectory(kmail)
add_subdirectory(grantleeeditor)
Laurent Montel's avatar
Laurent Montel committed
237 238


Laurent Montel's avatar
Cleanup  
Laurent Montel committed
239 240 241
add_subdirectory(korganizer)
add_subdirectory(sieveeditor)
add_subdirectory(storageservicemanager)
Laurent Montel's avatar
Laurent Montel committed
242
add_subdirectory(akregator)
243 244 245 246 247 248 249
add_subdirectory(importwizard)
add_subdirectory(kaddressbook)
add_subdirectory(mboximporter)
add_subdirectory(knotes)
add_subdirectory(ktnef)
add_subdirectory(pimsettingexporter)
add_subdirectory(kalarm)
Laurent Montel's avatar
Laurent Montel committed
250
add_subdirectory(blogilo)
251 252 253


add_subdirectory(kontact)
Laurent Montel's avatar
Cleanup  
Laurent Montel committed
254 255 256

add_subdirectory(akonadiconsole)
add_subdirectory(console)
Laurent Montel's avatar
Laurent Montel committed
257

Laurent Montel's avatar
Cleanup  
Laurent Montel committed
258
add_subdirectory(plugins) # Must be after KMail
Laurent Montel's avatar
Laurent Montel committed
259

260 261
add_subdirectory(accountwizard)

Laurent Montel's avatar
Cleanup  
Laurent Montel committed
262 263
# doc must be a subdir of kdepim or packagers will kill us
add_subdirectory(doc)
Laurent Montel's avatar
Laurent Montel committed
264

265 266
install( FILES kdepim.categories DESTINATION ${KDE_INSTALL_CONFDIR} )

Laurent Montel's avatar
Laurent Montel committed
267 268 269 270
feature_summary(WHAT ALL
                INCLUDE_QUIET_PACKAGES
                FATAL_ON_MISSING_REQUIRED_PACKAGES
)