Fix tooltip
[kdepim.git] / CMakeLists.txt
blob3320724842732affa85ebc56b6a587020c90c163
1 project(kdepim)
3 cmake_minimum_required(VERSION 2.8.12)
5 option(KDEPIM_SUPERBUILD "Build standalone lib but not application" FALSE)
6 option(KDEPIM_BUILD_WITH_INSTALLED_LIB "Build kdepim application against installed lib" FALSE)
8 if (KDEPIM_SUPERBUILD)
10 # Remove it when splitted
11 # This CMakeLists.txt is a "superbuild" for the frameworks.
12 # This means it can be used to build them all standalone one-by-one.
13 # This is useful to compile all them with one command.
14 # use mkdir build-superbuild && cd build-superbuild && cmake -DKDEPIM_SUPERBUILD=TRUE ../ && make -j8 sb_all
16 include(SuperBuild.cmake)
18 set(LIBRARY_NAMELINK)
19 sb_add_project(libfollowupreminder)
20 sb_add_project(libsendlater)
21 sb_add_project(grantleetheme)
22 sb_add_project(libkdepim)
23 sb_add_project(libkdepimdbusinterfaces)
24 sb_add_project(kdgantt2)
25 sb_add_project(mailimporter)
26 sb_add_project(pimcommon)
27 sb_add_project(libgravatar)
28 sb_add_project(composereditor-ng)
29 sb_add_project(noteshared)
30 sb_add_project(libkleo)
31 sb_add_project(kaddressbookgrantlee)
32 sb_add_project(calendarsupport)
33 sb_add_project(eventviews)
34 sb_add_project(incidenceeditor-ng)
35 sb_add_project(libksieve)
36 sb_add_project(messagecore)
37 sb_add_project(messagelist)
38 sb_add_project(messageviewer)
39 sb_add_project(templateparser)
40 sb_add_project(messagecomposer)
41 sb_add_project(mailcommon)
42 sb_end()
44 else()
46 set(LIBRARY_NAMELINK LIBRARY NAMELINK_SKIP)
48 # we need some parts of the ECM CMake helpers
49 find_package(ECM 5.16.0 REQUIRED NO_MODULE)
50 set(CMAKE_MODULE_PATH ${kdepim_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
51 include(ECMOptionalAddSubdirectory)
52 include(ECMInstallIcons)
53 include(ECMSetupVersion)
54 include(ECMAddTests)
55 include(ECMMarkNonGuiExecutable)
56 include(GenerateExportHeader)
57 include(ECMGenerateHeaders)
58 include(CMakePackageConfigHelpers)
59 include(FeatureSummary)
60 include(CheckFunctionExists)
61 include(ECMGeneratePriFile)
63 include(KDEInstallDirs)
64 include(KDECMakeSettings)
65 include(KDECompilerSettings)
66 include(ECMAddAppIcon)
67 include(ECMQtDeclareLoggingCategory)
69 # KDEPIM_VERSION
70 # Version scheme: "x.y.z build".
72 # x is the version number.
73 # y is the major release number.
74 # z is the minor release number.
76 # "x.y.z" follow the kdelibs version kdepim is released with.
78 # If "z" is 0, the version is "x.y"
80 # KDEPIM_DEV_VERSION is empty for final versions.
81 # For development versions "build" is something like "pre", "alpha1", "alpha2", "beta1", "beta2", "rc1", "rc2".
83 # Examples in chronological order:
84 # 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
86 # Do NOT add quote
87 set(KDEPIM_DEV_VERSION )
89 # add an extra space
90 if(DEFINED KDEPIM_DEV_VERSION)
91   set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
92 endif()
94 set(KDEPIM_VERSION_NUMBER "5.1.2")
95 set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")
98 set(KDEPIMLIBS_LIB_VERSION "5.1")
99 set(KCONTACTS_LIB_VERSION "4.92.0")
100 set(KCALENDARCORE_LIB_VERSION "4.81.0")
101 set(IDENTITYMANAGEMENT_LIB_VERSION "4.82.0")
102 set(KLDAP_LIB_VERSION "4.80.0")
103 set(KMAILTRANSPORT_LIB_VERSION "4.78.0")
104 set(CALENDARUTILS_LIB_VERSION "4.80.0")
105 set(KHOLIDAYS_LIB_VERSION "4.80.0")
106 set(KTNEF_LIB_VERSION "4.78.0")
107 set(KIMAP_LIB_VERSION "4.78.0")
108 set(KMBOX_LIB_VERSION "4.78.0")
109 set(AKONADICALENDAR_LIB_VERSION "4.80.0")
110 set(SYNDICATION_LIB_VERSION "4.78.0")
111 set(GPGMEPP_LIB_VERSION "4.80.0")
112 set(KONTACTINTERFACE_LIB_VERSION "4.82.0")
113 set(AKONADIKALARM_LIB_VERSION "4.78.0")
114 set(KMIME_LIB_VERSION "4.87.0")
115 set(XMLRPCCLIENT_LIB_VERSION "4.78.0")
116 set(KBLOG_LIB_VERSION "4.80.0")
117 set(KPIMTEXTEDIT_LIB_VERSION "4.91.0")
119 set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
120 set(KDEPIM_LIB_SOVERSION "5")
121 set(AKONADINOTES_LIB_VERSION "4.78.0")
123 set(QT_REQUIRED_VERSION "5.4.0")
124 set(KF5_VERSION "5.16.0")
125 option(KDEPIM_BUILD_EXAMPLES "Build the kdepim example applications." FALSE)
126 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)
128 find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test WebKitWidgets Sql Concurrent UiTools OpenGL)
129 find_package(Qt5X11Extras NO_MODULE)
130 find_package(Grantlee5 "5.0" CONFIG REQUIRED)
132 find_package(Qt5Designer NO_MODULE)
133 set_package_properties(Qt5Designer PROPERTIES
134    PURPOSE "Required to build the Qt Designer plugins"
135    TYPE OPTIONAL
138 find_package(Gpgme REQUIRED)
141 # Find KF5 package
142 find_package(KF5KDELibs4Support ${KF5_VERSION} CONFIG REQUIRED)
143 find_package(KF5Wallet ${KF5_VERSION} CONFIG REQUIRED)
144 find_package(KF5NewStuff ${KF5_VERSION} CONFIG REQUIRED)
145 find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
146 find_package(KF5WebKit ${KF5_VERSION} CONFIG REQUIRED)
147 find_package(KF5Archive ${KF5_VERSION} CONFIG REQUIRED)
148 find_package(KF5NotifyConfig ${KF5_VERSION} CONFIG REQUIRED)
149 find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
150 find_package(KF5KHtml ${KF5_VERSION} CONFIG REQUIRED)
151 find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
152 find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
153 find_package(KF5Auth ${KF5_VERSION} CONFIG REQUIRED)
154 find_package(KF5DocTools REQUIRED)
155 find_package(Phonon4Qt5 CONFIG REQUIRED)
156 find_package(KF5DNSSD ${KF5_VERSION} CONFIG REQUIRED)
157 find_package(KF5TextEditor ${KF5_VERSION} CONFIG REQUIRED)
158 find_package(KF5Sonnet ${KF5_VERSION} CONFIG REQUIRED)
159 find_package(KF5GlobalAccel ${KF5_VERSION} CONFIG REQUIRED)
160 find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
162 # Find KdepimLibs Package
163 find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
164 find_package(KF5Akonadi ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
165 find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
166 find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
167 find_package(KF5AkonadiContact ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
168 find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
169 find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
170 find_package(KF5MailTransport ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
171 find_package(KF5AkonadiMime ${KDEPIMLIBS_LIB_VERSION} CONFIG REQUIRED)
172 find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
173 find_package(KF5Holidays ${KHOLIDAYS_LIB_VERSION} CONFIG REQUIRED)
174 find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED)
175 find_package(KF5IMAP ${KIMAP_LIB_VERSION} CONFIG REQUIRED)
176 find_package(KF5Mbox ${KMBOX_LIB_VERSION} CONFIG REQUIRED)
178 find_package(KF5AkonadiCalendar ${AKONADICALENDAR_LIB_VERSION} CONFIG REQUIRED)
180 find_package(KF5Syndication ${SYNDICATION_LIB_VERSION} CONFIG REQUIRED)
181 find_package(KF5Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED)
182 find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
183 find_package(KF5AlarmCalendar ${AKONADIKALARM_LIB_VERSION} CONFIG REQUIRED)
184 find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
185 find_package(KF5XmlRpcClient ${XMLRPCCLIENT_LIB_VERSION} CONFIG REQUIRED)
186 find_package(KF5Blog ${KBLOG_LIB_VERSION} CONFIG REQUIRED)
187 find_package(KF5AkonadiNotes ${AKONADINOTES_LIB_VERSION} CONFIG REQUIRED)
189 if (KDEPIM_BUILD_WITH_INSTALLED_LIB)
190 set(KDEPIM_LIB_INSTALLED_VERSION "5.0.46")
192 find_package(KF5MailCommon ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
193 find_package(KF5KaddressbookGrantlee ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
194 find_package(KF5MessageViewer ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
195 find_package(KF5Libkleo ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
196 find_package(KF5GrantleeTheme ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
197 find_package(KF5PimCommon ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
198 find_package(KF5Libkdepim ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
199 find_package(KF5IncidenceEditorsng ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
200 find_package(KF5MessageCore ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
201 find_package(KF5MessageComposer ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
202 find_package(KF5MessageList ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
203 find_package(KF5TemplateParser ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
204 find_package(KF5MailImporter ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
205 find_package(KF5NoteShared ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
206 find_package(KF5CalendarSupport ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
207 find_package(KF5EventViews ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
208 find_package(KF5KDGantt2 ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
209 find_package(KF5FollowupReminder ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
210 find_package(KF5SendLater ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
211 find_package(KF5KDGantt2 ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
212 find_package(KF5ComposerEditorNG ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
213 find_package(KF5KdepimDBusInterfaces ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
214 find_package(KF5LibKSieve ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
215 find_package(KF5Gravatar ${KDEPIM_LIB_INSTALLED_VERSION} CONFIG REQUIRED)
216 find_package(MailTransportDBusService CONFIG REQUIRED)
217 endif()
219 if (NOT APPLE)
220     find_package(X11)
221 endif()
223 set(KDEPIM_HAVE_X11 ${X11_FOUND})
224 configure_file(config-kdepim.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kdepim.h )
227 # Extra package
228 find_package(KF5GAPI "4.72.0" CONFIG)
230 configure_file(kdepim-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kdepim-version.h @ONLY)
232 include_directories(${kdepim_SOURCE_DIR} ${kdepim_BINARY_DIR})
234 set(KF5AkonadiServer_MIN_VERSION "5.1.51")
235 find_package(KF5AkonadiServer ${KF5AkonadiServer_MIN_VERSION} CONFIG REQUIRED)
237 find_package(Xsltproc)
238 set_package_properties(Xsltproc PROPERTIES DESCRIPTION "XSLT processor from libxslt" TYPE REQUIRED PURPOSE "Required to generate D-Bus interfaces for all Akonadi resources.")
240 find_package(KF5AkonadiSearch "5.0.42" CONFIG REQUIRED)
241 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")
243 set(Prison_MIN_VERSION "1.2.1")
244 find_package(KF5Prison ${Prison_MIN_VERSION} CONFIG)
245 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")
247 if( KF5GAPI_FOUND )
248   add_definitions( -DKDEPIM_STORAGESERVICE_GDRIVE )
249 endif()
251 if(KDEPIM_ENTERPRISE_BUILD)
252   message(STATUS "Enterprise build is enabled.")
253 endif()
255 ############### Desktop vs. Mobile options ##############
257 add_definitions(-DQT_USE_QSTRINGBUILDER)
260 find_package(Boost 1.34.0)
261 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")
263 # Kleopatra needs to know if the topological.hpp header exists (part of Boost_graph).
264 find_path(Boost_TOPOLOGICAL_SORT_DIR NAMES boost/graph/topological_sort.hpp PATHS ${Boost_INCLUDE_DIRS})
265 if(Boost_TOPOLOGICAL_SORT_DIR)
266   message(STATUS "The Boost Topological_sort header was found. Building Kleopatra")
267 else()
268   message(STATUS "The Boost Topological_sort header was NOT found. Kleopatra will not be built")
269 endif()
272 # config-enterprise.h is needed for both ENTERPRISE_BUILD and BUILD_EVERYTHING
273 configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
274 if (NOT KDEPIM_BUILD_WITH_INSTALLED_LIB)
275 add_subdirectory(libfollowupreminder)
276 add_subdirectory(libsendlater)
277 add_subdirectory(libgravatar)
278 add_subdirectory(noteshared)
279 add_subdirectory(libkdepim)
280 add_subdirectory(calendarsupport)
281 add_subdirectory(eventviews)
282 add_subdirectory(incidenceeditor-ng)
283 add_subdirectory(libkdepimdbusinterfaces)
284 add_subdirectory(libkleo)
285 add_subdirectory(libksieve)
286 add_subdirectory(kdgantt2)
287 add_subdirectory(kaddressbookgrantlee)
288 add_subdirectory(composereditor-ng)
289 add_subdirectory(messagecore)
290 add_subdirectory(grantleetheme)
291 add_subdirectory(messagelist)
292 add_subdirectory(templateparser)
293 add_subdirectory(mailimporter)
294 add_subdirectory(messageviewer)
295 add_subdirectory(messagecomposer)
296 add_subdirectory(pimcommon)
297 add_subdirectory(mailcommon)
299 set(MAILTRANSPORT_DBUS_SERVICE ${CMAKE_SOURCE_DIR}/libkdepim/src/interfaces/org.kde.mailtransport.service.xml)
300 endif()
301 add_subdirectory(icons)
303 include (kleopatra/ConfigureChecks.cmake)
305 if(KF5Gpgmepp_FOUND)
306   if(Boost_TOPOLOGICAL_SORT_DIR)
307     add_subdirectory(kleopatra)
308   endif()
309 endif()
311 add_subdirectory(kmail)
312 add_subdirectory(grantleeeditor)
314 if(KDEPIM_BUILD_EXAMPLES)
315   add_subdirectory(examples)
316 endif()
318 add_subdirectory(korganizer)
319 add_subdirectory(korgac)
320 add_subdirectory(sieveeditor)
321 add_subdirectory(storageservicemanager)
322 add_subdirectory(agents)
323 add_subdirectory(akregator)
324 add_subdirectory(importwizard)
325 add_subdirectory(kaddressbook)
326 add_subdirectory(mboximporter)
327 add_subdirectory(knotes)
328 add_subdirectory(ktnef)
329 add_subdirectory(pimsettingexporter)
330 add_subdirectory(kalarm)
331 add_subdirectory(blogilo)
334 add_subdirectory(kontact)
336 add_subdirectory(akonadiconsole)
337 add_subdirectory(console)
339 add_subdirectory(plugins) # Must be after KMail
341 add_subdirectory(accountwizard)
343 # doc must be a subdir of kdepim or packagers will kill us
344 add_subdirectory(doc)
346 install( FILES kdepim.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
348 feature_summary(WHAT ALL
349                 INCLUDE_QUIET_PACKAGES
350                 FATAL_ON_MISSING_REQUIRED_PACKAGES
352 endif()