3 cmake_minimum_required(VERSION 2.8.12)
5 # we need some parts of the ECM CMake helpers
6 find_package(ECM 5.12.0 REQUIRED NO_MODULE)
7 set(CMAKE_MODULE_PATH ${kdepim_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
8 include(ECMOptionalAddSubdirectory)
9 include(ECMInstallIcons)
10 include(ECMSetupVersion)
12 include(ECMMarkNonGuiExecutable)
14 include(CMakePackageConfigHelpers)
15 include(FeatureSummary)
16 include(CheckFunctionExists)
18 include(KDEInstallDirs)
19 include(KDECMakeSettings)
20 include(KDECompilerSettings)
21 include(ECMAddAppIcon)
24 # Version scheme: "x.y.z build".
26 # x is the version number.
27 # y is the major release number.
28 # z is the minor release number.
30 # "x.y.z" follow the kdelibs version kdepim is released with.
32 # If "z" is 0, the version is "x.y"
34 # KDEPIM_DEV_VERSION is empty for final versions.
35 # For development versions "build" is something like "pre", "alpha1", "alpha2", "beta1", "beta2", "rc1", "rc2".
37 # Examples in chronological order:
38 # 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
41 set(KDEPIM_DEV_VERSION beta1)
44 if(DEFINED KDEPIM_DEV_VERSION)
45 set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
48 set(KDEPIM_VERSION_NUMBER "4.81")
49 set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")
52 set(KDEPIMLIBS_LIB_VERSION "4.88.0")
53 set(KCONTACTS_LIB_VERSION "4.91.0")
54 set(KCALENDARCORE_LIB_VERSION "4.81.0")
55 set(IDENTITYMANAGEMENT_LIB_VERSION "4.80.0")
56 set(KLDAP_LIB_VERSION "4.80.0")
57 set(KMAILTRANSPORT_LIB_VERSION "4.78.0")
58 set(CALENDARUTILS_LIB_VERSION "4.80.0")
59 set(KHOLIDAYS_LIB_VERSION "4.78.0")
60 set(KTNEF_LIB_VERSION "4.78.0")
61 set(KIMAP_LIB_VERSION "4.78.0")
62 set(KMBOX_LIB_VERSION "4.78.0")
63 set(AKONADICALENDAR_LIB_VERSION "4.80.0")
64 set(SYNDICATION_LIB_VERSION "4.78.0")
65 set(GPGME_LIB_VERSION "4.78.0")
66 set(KONTACTINTERFACE_LIB_VERSION "4.81.0")
67 set(AKONADIKALARM_LIB_VERSION "4.78.0")
68 set(KMIME_LIB_VERSION "4.82.0")
69 set(XMLRPCCLIENT_LIB_VERSION "4.78.0")
70 set(KBLOG_LIB_VERSION "4.78.0")
71 set(KPIMTEXTEDIT_LIB_VERSION "4.84.0")
73 set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}.0")
74 set(KDEPIM_LIB_SOVERSION "5")
75 set(AKONADINOTES_LIB_VERSION "4.78.0")
77 set(QT_REQUIRED_VERSION "5.4.0")
78 set(KF5_VERSION "5.12.0")
79 option(KDEPIM_BUILD_EXAMPLES "Build the kdepim example applications." FALSE)
80 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)
81 option(KDEPIM_MOBILE_UI "Build UI for mobile devices instead of for desktops" FALSE)
82 option(KDEPIM_BUILD_DESKTOP "Build Desktop Applications. Can be deactivated for mobile" TRUE)
83 option(KDEPIM_NO_WEBKIT "Do not use WebKit in the kdepim applications" FALSE)
84 option(KDEPIM_NO_TEXTTOSPEECH "Do not use TextToSpeech in the kdepim applications" FALSE)
86 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebKitWidgets Sql Concurrent UiTools Declarative OpenGL)
87 find_package(Qt5X11Extras NO_MODULE)
88 if (NOT KDEPIM_NO_TEXTTOSPEECH)
89 find_package(Qt5 OPTIONAL_COMPONENTS TextToSpeech)
91 find_package(Grantlee5 "5.0" CONFIG REQUIRED)
93 find_package(Qt5Designer NO_MODULE)
94 set_package_properties(Qt5Designer PROPERTIES
95 PURPOSE "Required to build the Qt Designer plugins"
100 find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
101 find_package(KF5Wallet ${KF5_VERSION} CONFIG REQUIRED)
102 find_package(KF5NewStuff ${KF5_VERSION} CONFIG REQUIRED)
103 find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
104 find_package(KF5WebKit ${KF5_VERSION} CONFIG REQUIRED)
105 find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
106 find_package(KF5NotifyConfig ${KF5_VERSION} CONFIG REQUIRED)
107 find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
108 find_package(KF5KHtml ${KF5_VERSION} CONFIG REQUIRED)
109 find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
110 find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
111 find_package(KF5Auth ${KF5_VERSION} CONFIG REQUIRED)
112 find_package(KF5DocTools REQUIRED)
113 find_package(Phonon4Qt5 CONFIG REQUIRED)
114 find_package(KF5DNSSD ${KF5_VERSION} CONFIG REQUIRED)
115 find_package(KF5TextEditor ${KF5_VERSION} CONFIG REQUIRED)
116 find_package(KF5Sonnet ${KF5_VERSION} CONFIG REQUIRED)
117 find_package(KF5GlobalAccel ${KF5_VERSION} CONFIG REQUIRED)
118 find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
120 # Find KdepimLibs Package
121 find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
122 find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
123 find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
124 find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
125 find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
126 find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
127 find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
128 find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
129 find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
130 find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
131 find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
132 find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED)
133 find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
134 find_package(KF5Mbox ${KMBOX_LIB_VERSION} CONFIG REQUIRED)
136 find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
138 find_package(KF5Syndication ${SYNDICATION_LIB_VERSION} CONFIG REQUIRED)
139 find_package(KF5Gpgmepp ${GPGME_LIB_VERSION} CONFIG REQUIRED)
140 find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
141 find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG REQUIRED)
142 find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
143 find_package(KF5XmlRpcClient ${XMLRPCCLIENT_LIB_VERSION} CONFIG REQUIRED)
144 find_package(KF5Blog ${KBLOG_LIB_VERSION} CONFIG REQUIRED)
145 find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
151 set(KDEPIM_HAVE_X11 ${X11_FOUND})
152 if (KDEPIM_NO_TEXTTOSPEECH)
153 set(KDEPIM_HAVE_TEXTTOSPEECH FALSE)
155 if (${Qt5TextToSpeech_FOUND})
156 set(KDEPIM_HAVE_TEXTTOSPEECH TRUE)
159 configure_file(config-kdepim.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdepim.h )
163 find_package(KF5GAPI "4.72.0" CONFIG)
165 include(GenerateExportHeader)
167 configure_file(kdepim-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-version.h @ONLY)
169 include_directories(${kdepim_SOURCE_DIR} ${kdepim_BINARY_DIR})
171 set(KF5AkonadiServer_MIN_VERSION "5.0.51")
172 find_package(KF5AkonadiServer ${KF5AkonadiServer_MIN_VERSION} CONFIG REQUIRED)
174 find_package(Xsltproc)
175 set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
177 find_package(KF5AkonadiSearch "5.0.4" CONFIG REQUIRED)
178 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")
181 set_package_properties(ZLIB PROPERTIES DESCRIPTION "The Zlib compression library" URL "http://www.zlib.net" TYPE REQUIRED)
183 set(Prison_MIN_VERSION "1.2.0")
184 find_package(KF5Prison ${Prison_MIN_VERSION} CONFIG)
185 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")
188 add_definitions( -DKDEPIM_STORAGESERVICE_GDRIVE )
191 if(KDEPIM_ENTERPRISE_BUILD)
192 message(STATUS "Enterprise build is enabled.")
195 ############### Desktop vs. Mobile options ##############
198 add_definitions( -DKDEPIM_MOBILE_UI )
200 add_definitions(-DQT_USE_QSTRINGBUILDER)
203 find_package(Boost 1.34.0)
204 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")
206 # Kleopatra needs to know if the topological.hpp header exists (part of Boost_graph).
207 find_path(Boost_TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
208 if(Boost_TOPOLOGICAL_SORT_DIR)
209 message(STATUS "The Boost Topological_sort header was found. Building Kleopatra")
211 message(STATUS "The Boost Topological_sort header was NOT found. Kleopatra will not be built")
215 # config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
216 configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
218 add_subdirectory(noteshared)
219 add_subdirectory(libkdepim)
220 add_subdirectory(calendarsupport)
221 add_subdirectory(calendarviews)
222 add_subdirectory(incidenceeditor-ng)
223 add_subdirectory(libkdepimdbusinterfaces)
224 add_subdirectory(libkleo)
225 add_subdirectory(libkpgp)
226 add_subdirectory(libksieve)
227 add_subdirectory(kdgantt2)
228 add_subdirectory(icons)
229 add_subdirectory(composereditor-ng)
230 add_subdirectory(messagecore)
231 add_subdirectory(grantleetheme)
232 add_subdirectory(messagelist)
233 add_subdirectory(templateparser)
234 include (kleopatra/ConfigureChecks.cmake)
237 if(Boost_TOPOLOGICAL_SORT_DIR)
238 add_subdirectory(kleopatra)
242 add_subdirectory(messageviewer)
243 add_subdirectory(messagecomposer)
244 add_subdirectory(pimcommon)
245 add_subdirectory(mailcommon)
246 add_subdirectory(kmail)
247 add_subdirectory(grantleeeditor)
249 if(KDEPIM_BUILD_EXAMPLES)
250 add_subdirectory(examples)
253 add_subdirectory(korganizer)
254 add_subdirectory(korgac)
255 add_subdirectory(sieveeditor)
256 add_subdirectory(storageservicemanager)
257 add_subdirectory(kaddressbookgrantlee)
258 if(KDEPIM_BUILD_DESKTOP)
259 add_subdirectory(agents)
260 add_subdirectory(akregator)
261 add_subdirectory(importwizard)
262 add_subdirectory(kaddressbook)
263 add_subdirectory(mboximporter)
264 add_subdirectory(knotes)
265 add_subdirectory(ktnef)
266 add_subdirectory(mailimporter)
267 add_subdirectory(pimsettingexporter)
268 add_subdirectory(kalarm)
269 add_subdirectory(blogilo)
272 add_subdirectory(kontact)
275 add_subdirectory(akonadiconsole)
276 add_subdirectory(console)
278 add_subdirectory(plugins) # Must be after KMail
280 add_subdirectory(accountwizard)
282 # doc must be a subdir of kdepim or packagers will kill us
283 add_subdirectory(doc)
285 install( FILES kdepim.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
287 feature_summary(WHAT ALL
288 INCLUDE_QUIET_PACKAGES
289 FATAL_ON_MISSING_REQUIRED_PACKAGES