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

4
project(libkdepim VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.68.0")
Laurent Montel's avatar
Laurent Montel committed
7

8
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
9
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
set(LIBRARY_NAMELINK)
11
12
13
14
15

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

16
17
18
19
include(GenerateExportHeader)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
20

21
22
23
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
24

Laurent Montel's avatar
Laurent Montel committed
25

Laurent Montel's avatar
Laurent Montel committed
26
set(LIBKDEPIM_LIB_VERSION ${PIM_VERSION})
27
set(AKONADICONTACT_LIB_VERSION "5.14.40")
28
set(QT_REQUIRED_VERSION "5.11.0")
29
30
31
set(KLDAP_LIB_VERSION "5.14.40")
set(AKONADISEARCH_LIB_VERSION "5.14.40")
set(AKONADI_VERSION "5.14.40")
32

33
34
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus Network)

35
36
37
38
39
40
41
42
43
44
45
46
find_package(KF5Codecs ${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(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5ItemViews ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5JobWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Wallet ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
47
48

find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
49
find_package(KF5AkonadiContact ${AKONADICONTACT_LIB_VERSION} CONFIG REQUIRED)
50
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
51
find_package(KF5Ldap ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
52

53
54
option(FORCE_DISABLE_AKONADI_SEARCH "Disable features and API that require akonadi-search, e.g. because xapian isn't available" OFF)
if (NOT FORCE_DISABLE_AKONADI_SEARCH)
Laurent Montel's avatar
Laurent Montel committed
55
find_package(KF5AkonadiSearch ${AKONADISEARCH_LIB_VERSION} CONFIG REQUIRED)
56
set_package_properties(KF5AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://www.kde.org" TYPE REQUIRED PURPOSE "Provides search capabilities in KMail and Akonadi")
57
endif()
58

59
set(DISABLE_AKONADI_SEARCH ${FORCE_DISABLE_AKONADI_SEARCH})
60
configure_file(config-akonadi-search.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config-akonadi-search.h)
Laurent Montel's avatar
Laurent Montel committed
61

62
63
option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
64

65
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
66
   add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050e00)
67
   add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054400)
68
69
endif()

Laurent Montel's avatar
Laurent Montel committed
70
add_definitions(-DQT_NO_FOREACH)
Laurent Montel's avatar
Laurent Montel committed
71
set(CMAKE_CXX_STANDARD 14)
72
73
74
75
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Libkdepim")


Laurent Montel's avatar
Laurent Montel committed
76
configure_package_config_file(MailTransportDBusServiceConfig.cmake.in
77
78
79
80
81
82
83
84
85
86
87
  ${CMAKE_CURRENT_BINARY_DIR}/MailTransportDBusServiceConfig.cmake
  PATH_VARS KDE_INSTALL_DBUSINTERFACEDIR
  INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_PREFIX}/MailTransportDBusService")

install(FILES
  ${CMAKE_CURRENT_BINARY_DIR}/MailTransportDBusServiceConfig.cmake
  DESTINATION "${CMAKECONFIG_INSTALL_PREFIX}/MailTransportDBusService")


add_subdirectory(src)

88
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
89
90
91
92
        EXPORT LIBKDEPIM
        FILE libkdepim.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
93

Laurent Montel's avatar
Laurent Montel committed
94
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)