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

4
project(Akonadi-Contact VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
5
6

# ECM setup
Laurent Montel's avatar
Laurent Montel committed
7

8
set(KF5_MIN_VERSION "5.73.0")
Laurent Montel's avatar
Laurent Montel committed
9

10
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
11
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
12
set(CMAKE_CXX_STANDARD 14)
13
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Laurent Montel's avatar
Laurent Montel committed
14

15
16
17
18
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

Laurent Montel's avatar
Laurent Montel committed
19
20
21
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(ECMGeneratePriFile)
22

Laurent Montel's avatar
Laurent Montel committed
23
24
include(ECMSetupVersion)
include(FeatureSummary)
Laurent Montel's avatar
Laurent Montel committed
25
include(ECMInstallIcons)
Laurent Montel's avatar
Laurent Montel committed
26
include(ECMQtDeclareLoggingCategory)
27

Laurent Montel's avatar
Laurent Montel committed
28

Laurent Montel's avatar
Laurent Montel committed
29
set(AKONADI_CONTACTS_VERSION ${PIM_VERSION})
30
31
set(KMIMELIB_VERSION "5.15.40")
set(AKONADI_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
32

33
set(QT_REQUIRED_VERSION "5.13.0")
Laurent Montel's avatar
Laurent Montel committed
34
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test)
Laurent Montel's avatar
Laurent Montel committed
35
########### Find packages ###########
36
37
38
find_package(KF5KIO ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5I18n ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Completion ${KF5_MIN_VERSION} CONFIG REQUIRED)
39
find_package(KF5Config ${KF5_MIN_VERSION} CONFIG REQUIRED)
40
41
find_package(KF5Codecs ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5IconThemes ${KF5_MIN_VERSION} CONFIG REQUIRED)
42
find_package(KF5Service ${KF5_MIN_VERSION} CONFIG REQUIRED)
43
find_package(KF5TextWidgets ${KF5_MIN_VERSION} CONFIG REQUIRED)
44
45
find_package(KF5WidgetsAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5XmlGui ${KF5_MIN_VERSION} CONFIG REQUIRED)
46
find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
47

48
49
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
50
find_package(KF5Mime ${KMIMELIB_VERSION} CONFIG REQUIRED)
Daniel Vrátil's avatar
Daniel Vrátil committed
51
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
52

53

Laurent Montel's avatar
Laurent Montel committed
54
55
########### Targets ###########

56

57
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
58
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
59

Laurent Montel's avatar
Laurent Montel committed
60
add_definitions(-DQT_NO_FOREACH)
61
add_definitions(-DQT_NO_KEYWORDS)
Kevin Funk's avatar
Kevin Funk committed
62
63
64
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif()
Laurent Montel's avatar
Laurent Montel committed
65

Laurent Montel's avatar
Laurent Montel committed
66
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
67
add_subdirectory(kcm)
68
add_subdirectory(serializers)
Laurent Montel's avatar
Laurent Montel committed
69

70
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
71
72
73
74
75
        EXPORT AKONADICONTACTS
        FILE akonadi-contacts.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )

76

77
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)