CMakeLists.txt 5.14 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.14.90")
3

Laurent Montel's avatar
Laurent Montel committed
4
5
6
7
if (POLICY CMP0053)
    cmake_policy(SET CMP0053 NEW)
endif()

8
project(Messagelib VERSION ${PIM_VERSION})
9

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

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

15
set(KF5_MIN_VERSION "5.71.0")
Laurent Montel's avatar
Laurent Montel committed
16

Laurent Montel's avatar
Laurent Montel committed
17

Laurent Montel's avatar
Laurent Montel committed
18
set(MESSAGELIB_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
19
set(AKONADIMIME_LIB_VERSION "5.14.90")
Laurent Montel's avatar
Laurent Montel committed
20

21
set(QT_REQUIRED_VERSION "5.13.0")
Laurent Montel's avatar
Laurent Montel committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
set(AKONADICONTACT_LIB_VERSION "5.14.90")
set(AKONADI_VERSION "5.14.90")
set(GRANTLEETHEME_LIB_VERSION "5.14.90")
set(GRAVATAR_LIB_VERSION "5.14.90")
set(IDENTITYMANAGEMENT_LIB_VERSION "5.14.90")
set(KDEPIM_APPS_LIB_VERSION "5.14.90")
set(KLDAP_LIB_VERSION "5.14.90")
set(KMAILTRANSPORT_LIB_VERSION "5.14.90")
set(KMBOX_LIB_VERSION "5.14.90")
set(KMIME_LIB_VERSION "5.14.90")
set(KPIMTEXTEDIT_LIB_VERSION "5.14.90")
set(LIBKDEPIM_LIB_VERSION "5.14.90")
set(LIBKLEO_LIB_VERSION "5.14.90")
set(PIMCOMMON_LIB_VERSION "5.14.90")
36
set(GPGME_LIB_VERSION "1.11.1")
37

38
set(ECM_VERSION ${KF5_MIN_VERSION})
39

Laurent Montel's avatar
Laurent Montel committed
40
find_package(ECM ${ECM_VERSION} CONFIG REQUIRED)
41
42
set(CMAKE_MODULE_PATH ${Messagelib_SOURCE_DIR}/cmake/modules ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
43
44
45
46
47

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

48
49
50
51
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
52

53
54
55
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
56

Laurent Montel's avatar
Laurent Montel committed
57

58

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

61
62
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
63
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
64
find_package(KF5NewStuff ${KF5_MIN_VERSION} CONFIG REQUIRED)
65
find_package(QGpgme ${GPGME_LIB_VERSION} CONFIG REQUIRED)
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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)

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)
88
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
89
90
91
92
93
94
95
96
97
98
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(KF5KaddressbookGrantlee ${KDEPIM_APPS_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
99
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
100

Laurent Montel's avatar
Laurent Montel committed
101
find_package(KF5AkonadiSearch "5.14.90" CONFIG REQUIRED)
102
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://kde.org/" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
103

Laurent Montel's avatar
Laurent Montel committed
104
set(CMAKE_CXX_STANDARD 14)
105
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Laurent Montel's avatar
Laurent Montel committed
106
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
107
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054800)
108
if(BUILD_TESTING)
109
    add_definitions(-DBUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
110
endif()
111
add_definitions(-DQT_NO_EMIT)
112

Sandro Knauß's avatar
Sandro Knauß committed
113
add_subdirectory(mimetreeparser)
114
115
116
117
118
119
add_subdirectory(messageviewer)
add_subdirectory(templateparser)
add_subdirectory(messagecomposer)
add_subdirectory(messagecore)
add_subdirectory(messagelist)
add_subdirectory(webengineviewer)
120

121
ecm_qt_install_logging_categories(
122
123
124
125
    EXPORT MESSAGELIB
    FILE messagelib.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
126

127
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)