CMakeLists.txt 3.53 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.13.40")
3

4
project(libkdepim VERSION ${PIM_VERSION})
5

6
set(KF5_MIN_VERSION "5.67.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
24
include(ECMSetupVersion)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMAddTests)
25

Laurent Montel's avatar
Laurent Montel committed
26

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

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

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(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
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)
52
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
64
option(BUILD_DESIGNERPLUGIN "Build plugin for Qt Designer" ON)
add_feature_info(DESIGNERPLUGIN ${BUILD_DESIGNERPLUGIN} "Build plugin for Qt Designer")
65

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

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


Laurent Montel's avatar
Laurent Montel committed
77
configure_package_config_file(MailTransportDBusServiceConfig.cmake.in
78
79
80
81
82
83
84
85
86
87
88
  ${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)

89
install(FILES libkdepim.categories libkdepim.renamecategories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
90

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