CMakeLists.txt 5.33 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.14.47")
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.70.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.42")
Laurent Montel's avatar
Laurent Montel committed
20

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

39
set(ECM_VERSION ${KF5_MIN_VERSION})
40

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

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

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

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

Laurent Montel's avatar
Laurent Montel committed
58

59

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

62 63
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
64
find_package(KF5Mime ${KMIME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
65
find_package(KF5NewStuff ${KMIME_LIB_VERSION} CONFIG REQUIRED)
66
find_package(QGpgme ${GPGME_LIB_VERSION} CONFIG REQUIRED)
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
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)
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
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(KF5LibkdepimAkonadi ${LIBKDEPIM_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
101
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
102 103 104

find_package(KF5AkonadiSearch "5.14.40" CONFIG REQUIRED)
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://kde.org/" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
105

Laurent Montel's avatar
Laurent Montel committed
106
set(CMAKE_CXX_STANDARD 14)
107
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
108
    add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
109
    add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054600)
110
endif()
111
if(BUILD_TESTING)
112
    add_definitions(-DBUILD_TESTING)
Laurent Montel's avatar
Laurent Montel committed
113
endif()
114 115
add_definitions(-DQT_NO_SIGNALS_SLOTS_KEYWORDS)
add_definitions(-DQT_NO_EMIT)
116

Sandro Knauß's avatar
Sandro Knauß committed
117
add_subdirectory(mimetreeparser)
118 119 120 121 122 123
add_subdirectory(messageviewer)
add_subdirectory(templateparser)
add_subdirectory(messagecomposer)
add_subdirectory(messagecore)
add_subdirectory(messagelist)
add_subdirectory(webengineviewer)
124

125
ecm_qt_install_logging_categories(
126 127 128 129
    EXPORT MESSAGELIB
    FILE messagelib.categories
    DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
    )
Laurent Montel's avatar
Laurent Montel committed
130

131
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)