CMakeLists.txt 2.98 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
Laurent Montel's avatar
Laurent Montel committed
2
set(PIM_VERSION "5.16.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.77.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
32
33
set(KMIMELIB_VERSION "5.16.40")
set(AKONADI_VERSION "5.16.40")
set(LIBKLEO_LIB_VERSION "5.16.40")
set(GRANTLEETHEME_LIB_VERSION "5.16.40")
34
set(GRANTLEE_LIB_VERSION "5.2")
Laurent Montel's avatar
Laurent Montel committed
35

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

50
51
find_package(KF5Contacts ${KF5_MIN_VERSION} CONFIG REQUIRED)

Laurent Montel's avatar
Laurent Montel committed
52
find_package(KF5Mime ${KMIMELIB_VERSION} CONFIG REQUIRED)
Daniel Vrátil's avatar
Daniel Vrátil committed
53
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
54
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG)
55
56

if (NOT WIN32 OR MSVC)
57
58
    set_package_properties(KF5Libkleo PROPERTIES TYPE REQUIRED)
endif()
59

60
find_package(KF5GrantleeTheme ${GRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
61

62
find_package(Grantlee5 ${GRANTLEE_LIB_VERSION} CONFIG REQUIRED)
63

Laurent Montel's avatar
Laurent Montel committed
64
65
########### Targets ###########

66

67
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
68
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054E00)
69

Laurent Montel's avatar
Laurent Montel committed
70
add_definitions(-DQT_NO_FOREACH)
71
add_definitions(-DQT_NO_KEYWORDS)
Kevin Funk's avatar
Kevin Funk committed
72
73
74
if(BUILD_TESTING)
   add_definitions(-DBUILD_TESTING)
endif()
Laurent Montel's avatar
Laurent Montel committed
75

Laurent Montel's avatar
Laurent Montel committed
76
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" FALSE)
77

Laurent Montel's avatar
Laurent Montel committed
78
79
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT false)
if (USE_UNITY_CMAKE_SUPPORT)
80
81
82
    if(${CMAKE_VERSION} VERSION_LESS "3.16.0")
        message(STATUS "CMAKE version is less than 3.16.0 . We can't use cmake unify build support")
    else()
Laurent Montel's avatar
Laurent Montel committed
83
        set(COMPILE_WITH_UNITY_CMAKE_SUPPORT true)
84
85
86
    endif()
endif()

Laurent Montel's avatar
Laurent Montel committed
87
add_subdirectory(src)
Laurent Montel's avatar
Laurent Montel committed
88
add_subdirectory(kcm)
89
add_subdirectory(serializers)
Laurent Montel's avatar
Laurent Montel committed
90

91
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
92
93
94
95
96
        EXPORT AKONADICONTACTS
        FILE akonadi-contacts.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )

97

98
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)