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

4
project(libkdepim VERSION ${PIM_VERSION})
5

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

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

16
17
18
19
include(ECMSetupVersion)
include(FeatureSummary)
include(KDEInstallDirs)
include(KDECMakeSettings)
20
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
21
22
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
23

Laurent Montel's avatar
Laurent Montel committed
24

Laurent Montel's avatar
Laurent Montel committed
25
set(LIBKDEPIM_LIB_VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
26
set(AKONADICONTACT_LIB_VERSION "5.12.0")
27
set(QT_REQUIRED_VERSION "5.11.0")
Laurent Montel's avatar
Laurent Montel committed
28
29
30
31
set(KLDAP_LIB_VERSION "5.12.0")
set(KCONTACTS_LIB_VERSION "5.12.0")
set(AKONADISEARCH_LIB_VERSION "5.12.0")
set(AKONADI_VERSION "5.12.0")
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
47
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(KF5IconThemes ${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)
48
49

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

54
55
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
56
find_package(KF5AkonadiSearch ${AKONADISEARCH_LIB_VERSION} CONFIG REQUIRED)
57
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")
58
endif()
59

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

63
find_package(KF5DesignerPlugin ${KF5_MIN_VERSION} CONFIG)
Laurent Montel's avatar
Laurent Montel committed
64
set_package_properties(KF5DesignerPlugin PROPERTIES DESCRIPTION "KF5 designer plugin" TYPE OPTIONAL)
65

Laurent Montel's avatar
Laurent Montel committed
66
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
Laurent Montel's avatar
Laurent Montel committed
67
add_definitions(-DQT_NO_FOREACH)
Laurent Montel's avatar
Laurent Montel committed
68
set(CMAKE_CXX_STANDARD 14)
69
70
71
72
########### CMake Config Files ###########
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5Libkdepim")


Laurent Montel's avatar
Laurent Montel committed
73
configure_package_config_file(MailTransportDBusServiceConfig.cmake.in
74
75
76
77
78
79
80
81
82
83
84
  ${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)

85
install(FILES libkdepim.categories libkdepim.renamecategories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
86

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