CMakeLists.txt 5.57 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.18.41")
3

Laurent Montel's avatar
Laurent Montel committed
4

5
project(Messagelib VERSION ${PIM_VERSION})
6

7
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)
8
option(KDEPIM_RUN_AKONADI_TEST "Enable autotest based on Akonadi." TRUE)
9

Laurent Montel's avatar
Laurent Montel committed
10
11
option(MESSAGEVIEWER_EXPERIMENTAL_CONVERSATIONVIEW "Experimental conversationview (in progress)" FALSE)

12
set(KF5_MIN_VERSION "5.84.0")
Laurent Montel's avatar
Laurent Montel committed
13

Laurent Montel's avatar
Laurent Montel committed
14

Laurent Montel's avatar
Laurent Montel committed
15
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
16
set(AKONADIMIME_LIB_VERSION "5.18.40")
Laurent Montel's avatar
Laurent Montel committed
17

18
set(QT_REQUIRED_VERSION "5.15.0")
19
20
21
22
23
24
25
26
27
28
29
30
31
set(AKONADICONTACT_LIB_VERSION "5.18.40")
set(AKONADI_VERSION "5.18.40")
set(GRANTLEETHEME_LIB_VERSION "5.18.40")
set(GRAVATAR_LIB_VERSION "5.18.40")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.18.40")
set(KLDAP_LIB_VERSION "5.18.40")
set(KMAILTRANSPORT_LIB_VERSION "5.18.40")
set(KMBOX_LIB_VERSION "5.18.40")
set(KMIME_LIB_VERSION "5.18.40")
set(KPIMTEXTEDIT_LIB_VERSION "5.18.40")
set(LIBKDEPIM_LIB_VERSION "5.18.40")
set(LIBKLEO_LIB_VERSION "5.18.40")
set(PIMCOMMON_LIB_VERSION "5.18.40")
32
set(GPGME_LIB_VERSION "1.13.1")
33
set(AKONADI_SEARCH_VERSION "5.18.40")
34

35
set(ECM_VERSION ${KF5_MIN_VERSION})
36

Laurent Montel's avatar
Laurent Montel committed
37
find_package(ECM ${ECM_VERSION} CONFIG REQUIRED)
38
set(CMAKE_MODULE_PATH ${Messagelib_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
39
40
41
42
43

include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

44
45
46
47
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
48

49
include(FeatureSummary)
50
include(KDEGitCommitHooks)
51
52
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
53

Laurent Montel's avatar
Laurent Montel committed
54

55

56
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Gui Test)
Laurent Montel's avatar
Laurent Montel committed
57

58
59
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
60
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
61
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
62
find_package(QGpgme ${GPGME_LIB_VERSION} CONFIG REQUIRED)
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Network PrintSupport WebEngine WebEngineWidgets)
find_package(KF5Archive ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ConfigWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Sonnet ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5SyntaxHighlighting ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
79
find_package(KF5GuiAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
80
81
82
83
84
85

find_package(Grantlee5 "5.2" CONFIG REQUIRED) #Use KF5_VERSION in the future

find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5AkonadiMime ${AKONADIMIME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
86
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
87
88
89
90
91
92
93
94
95
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Gravatar ${GRAVATAR_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5IdentityManagement ${IDENTITYMANAGEMENT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5MailTransportAkonadi ${KMAILTRANSPORT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Mbox ${KMBOX_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
96
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
97

98
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
99
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://invent.kde.org/pim/akonadi-search" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
100

101
set(CMAKE_CXX_STANDARD 17)
102
set(CMAKE_CXX_STANDARD_REQUIRED ON)
103
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
104
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055500)
105
if(BUILD_TESTING)
106
    add_definitions(-DBUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
107
endif()
108
add_definitions(-DQT_NO_EMIT)
109
remove_definitions(-DQT_NO_FOREACH)
110
111
remove_definitions(-DQT_NO_KEYWORDS)
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
112

113

114
115
116
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)

set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
Laurent Montel's avatar
Laurent Montel committed
117
if (USE_UNITY_CMAKE_SUPPORT)
118
119
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
    add_definitions(-DCOMPILE_WITH_UNITY_CMAKE_SUPPORT)
120
121
endif()

Sandro Knauß's avatar
Sandro Knauß committed
122
add_subdirectory(mimetreeparser)
123
124
125
126
127
128
add_subdirectory(messageviewer)
add_subdirectory(templateparser)
add_subdirectory(messagecomposer)
add_subdirectory(messagecore)
add_subdirectory(messagelist)
add_subdirectory(webengineviewer)
129

130
ecm_qt_install_logging_categories(
131
132
133
134
    EXPORT MESSAGELIB
    FILE messagelib.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
135

136
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
137
ki18n_install(po)
138
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)