CMakeLists.txt 7.19 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
project(kmail)
2

Thomas McGuire's avatar
Thomas McGuire committed
3
include(CheckIncludeFiles)
4

Laurent Montel's avatar
Laurent Montel committed
5

Laurent Montel's avatar
Laurent Montel committed
6
7
8
cmake_minimum_required(VERSION 3.1)
if (POLICY CMP0063)
    cmake_policy(SET CMP0063 NEW)
Laurent Montel's avatar
Laurent Montel committed
9
endif()
10
set(KF5_VERSION "5.35.0")
Laurent Montel's avatar
Laurent Montel committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
find_package(ECM ${KF5_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMAddTests)
include(ECMMarkNonGuiExecutable)
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(CMakePackageConfigHelpers)
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

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

# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
33
set(KDEPIM_DEV_VERSION )
Laurent Montel's avatar
Laurent Montel committed
34
35
36
37
38
39

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

Laurent Montel's avatar
Laurent Montel committed
40
set(KDEPIM_VERSION_NUMBER "5.6.1")
Laurent Montel's avatar
Laurent Montel committed
41
42
43
set(KDEPIM_VERSION "${KDEPIM_VERSION_NUMBER}${KDEPIM_DEV_VERSION}")


Laurent Montel's avatar
Laurent Montel committed
44
45
46
47
48
49
50
51
52
53
54
55
56
set(AKONADI_MIMELIB_VERSION "5.6.0")
set(AKONADI_CONTACT_VERSION "5.6.0")
set(KCONTACTS_LIB_VERSION "5.6.0")
set(KCALENDARCORE_LIB_VERSION "5.6.0")
set(CALENDARUTILS_LIB_VERSION "5.6.0")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.6.0")
set(KLDAP_LIB_VERSION "5.6.0")
set(KMAILTRANSPORT_LIB_VERSION "5.6.0")
set(KONTACTINTERFACE_LIB_VERSION "5.6.0")
set(KMIME_LIB_VERSION "5.6.0")
set(KPIMTEXTEDIT_LIB_VERSION "5.6.0")
set(AKONADI_VERSION "5.6.0")
set(KTNEF_LIB_VERSION "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
57
58
59
60

set(KDEPIM_LIB_VERSION "${KDEPIM_VERSION_NUMBER}")
set(KDEPIM_LIB_SOVERSION "5")

61
set(QT_REQUIRED_VERSION "5.7.0")
Laurent Montel's avatar
Laurent Montel committed
62
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)
63

Laurent Montel's avatar
Laurent Montel committed
64
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED DBus Network Test Widgets WebEngine WebEngineWidgets Xml)
Laurent Montel's avatar
Laurent Montel committed
65
66
67
68
69
70
71
72
set(LIBGRAVATAR_VERSION_LIB "5.6.0")
set(MAILCOMMON_LIB_VERSION_LIB "5.6.0")
set(KDEPIM_APPS_LIB_VERSION_LIB "5.6.0")
set(MESSAGELIB_LIB_VERSION_LIB "5.6.0")
set(LIBKLEO_LIB_VERSION_LIB "5.6.0")
set(PIMCOMMON_LIB_VERSION_LIB "5.6.0")
set(LIBKDEPIM_LIB_VERSION_LIB "5.6.0")
set(LIBKSIEVE_LIB_VERSION_LIB "5.6.0")
Laurent Montel's avatar
Laurent Montel committed
73
74
75

find_package(KF5WebEngineViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
76
find_package(KF5AkonadiSearch "5.6.0" CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
77
78
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")

79
set(GPGMEPP_LIB_VERSION "1.8.0")
80
81
find_package(Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Find KF5 package
find_package(KF5Bookmarks ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Codecs ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5DocTools ${KF5_VERSION} REQUIRED)
find_package(KF5GuiAddons ${KF5_VERSION} REQUIRED)
find_package(KF5I18n ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5ItemViews ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_VERSION} REQUIRED)
find_package(KF5KIO ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5KCMUtils ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Notifications ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5NotifyConfig ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Parts ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5Sonnet ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5WindowSystem ${KF5_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_VERSION} CONFIG REQUIRED)

# Find KdepimLibs Package
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADI_MIMELIB_VERSION} CONFIG REQUIRED)
find_package(KF5Contacts ${KCONTACTS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarCore ${KCALENDARCORE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5CalendarUtils ${CALENDARUTILS_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
115
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
116
117
118
119
120
121
122
123
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)

find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)

find_package(KF5FollowupReminder ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5Gravatar ${LIBGRAVATAR_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5KdepimDBusInterfaces ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
124
find_package(KF5LibkdepimAkonadi ${LIBKDEPIM_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
125
126
127
128
129
130
131
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5LibKSieve ${LIBKSIEVE_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MailCommon ${MAILCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MessageCore ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MessageComposer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MessageList ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5MessageViewer ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
132
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
133
134
find_package(KF5SendLater ${KDEPIM_APPS_LIB_VERSION_LIB} CONFIG REQUIRED)
find_package(KF5TemplateParser ${MESSAGELIB_LIB_VERSION_LIB} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
135
find_package(KF5Tnef ${KTNEF_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
136
137
find_package(MailTransportDBusService CONFIG REQUIRED)

138
139
140
141
142

if (Qt5WebEngineWidgets_VERSION VERSION_GREATER "5.7.99")
    set(WEBENGINEVIEWER_PRINT_SUPPORT true)
endif()

Laurent Montel's avatar
Laurent Montel committed
143
configure_file(config-enterprise.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-enterprise.h )
144
configure_file(config-kmail.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kmail.h)
Laurent Montel's avatar
Laurent Montel committed
145

146
147
148
include_directories(${kmail_SOURCE_DIR} ${kmail_BINARY_DIR})
configure_file(kmail-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kmail-version.h @ONLY)

149
150
151
add_definitions(-DQT_NO_CAST_FROM_ASCII)
add_definitions(-DQT_NO_CAST_TO_ASCII)
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
152
153
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
add_definitions(-DQT_USE_QSTRINGBUILDER)
154
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
155

156
add_subdirectory(src)
157
add_subdirectory(agents)
Laurent Montel's avatar
Laurent Montel committed
158
add_subdirectory(ktnef)
Laurent Montel's avatar
Laurent Montel committed
159

Laurent Montel's avatar
Laurent Montel committed
160
install( FILES kmail.renamecategories kmail.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
Laurent Montel's avatar
Laurent Montel committed
161

Laurent Montel's avatar
Laurent Montel committed
162
163
add_subdirectory(doc)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
164

165
166
167
168
169
170
171
if (${Qt5WebEngine_VERSION} GREATER "5.7.99")
    MESSAGE(STATUS "QtWebEngine greater or equal 5.8.0 provides printing support and dnd fix. It's a good idea to use it")
else()
    if (${Qt5WebEngine_VERSION} GREATER "5.6.99")
        MESSAGE(STATUS "QtWebEngine 5.7.0 doesn't provide printing support. It has a lot of regression. Better to upgrade QtWebEngine to 5.8.0")
    endif()
endif()