CMakeLists.txt 3.56 KB
Newer Older
1
cmake_minimum_required(VERSION 3.5)
2
set(PIM_VERSION "5.15.41")
3
project(kaddressbook VERSION ${PIM_VERSION})
Laurent Montel's avatar
Laurent Montel committed
4
5
set(RELEASE_SERVICE_VERSION "20.07.90")
set(KF5_MIN_VERSION "5.71.0")
Laurent Montel's avatar
Laurent Montel committed
6

7
find_package(ECM ${KF5_MIN_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
8
9
10
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMInstallIcons)

11

Laurent Montel's avatar
Laurent Montel committed
12
13
include(ECMSetupVersion)
include(ECMAddTests)
14

Laurent Montel's avatar
Laurent Montel committed
15
16
include(GenerateExportHeader)
include(ECMGenerateHeaders)
17

Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
include(FeatureSummary)
include(CheckFunctionExists)
include(ECMGeneratePriFile)

Daniel Vrátil's avatar
Daniel Vrátil committed
22

Laurent Montel's avatar
Laurent Montel committed
23
24
include(KDEInstallDirs)
include(KDECMakeSettings)
25
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
Laurent Montel's avatar
Laurent Montel committed
26
27
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
28

29

Laurent Montel's avatar
Laurent Montel committed
30
# Do NOT add quote
Laurent Montel's avatar
Laurent Montel committed
31
set(KDEPIM_DEV_VERSION alpha)
Laurent Montel's avatar
Laurent Montel committed
32
33
34
35

# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
    set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
36
endif()
Laurent Montel's avatar
Laurent Montel committed
37

38
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
Laurent Montel's avatar
Laurent Montel committed
39

40
41
42
set(KPIMTEXTEDIT_LIB_VERSION "5.15.40")
set(AKONADI_VERSION "5.15.40")
set(KONTACTINTERFACE_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
43

44
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
Laurent Montel's avatar
Laurent Montel committed
45
46
47
set(KDEPIM_LIB_SOVERSION "5")


48
set(QT_REQUIRED_VERSION "5.13.0")
Laurent Montel's avatar
Laurent Montel committed
49
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus PrintSupport)
Laurent Montel's avatar
Laurent Montel committed
50
51
52
set(LIBKDEPIM_LIB_VERSION "5.15.40")
set(LIBGRANTLEETHEME_LIB_VERSION "5.15.40")
set(PIMCOMMON_LIB_VERSION "5.15.40")
53
set(LIBKLEO_LIB_VERSION "5.15.40")
Laurent Montel's avatar
Laurent Montel committed
54
55
set(AKONADI_SEARCH_VERSION "5.15.40")

Laurent Montel's avatar
Laurent Montel committed
56
# Find KF5 package
57
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
58
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
59
60
61
find_package(KF5DocTools ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KCMUtils ${KF5_MIN_VERSION} CONFIG REQUIRED)
find_package(KF5Crash ${KF5_MIN_VERSION} REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
62
find_package(KF5Libkleo ${LIBKLEO_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
63
64
65
66
67

# Find KdepimLibs Package
find_package(KF5PimTextEdit ${KPIMTEXTEDIT_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KF5KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
68
69
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
70
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
71

Laurent Montel's avatar
Laurent Montel committed
72
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
73

74
set(GPGMEPP_LIB_VERSION "1.11.1")
Laurent Montel's avatar
Laurent Montel committed
75
find_package(Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED)
Daniel Vrátil's avatar
Daniel Vrátil committed
76

77
78
set(QGPGME_LIB_VERSION "1.13.0")
find_package(QGpgme ${QGPGME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
79
80

include_directories(${kaddressbook_SOURCE_DIR} ${kaddressbook_BINARY_DIR})
Laurent Montel's avatar
Laurent Montel committed
81

82
find_package(KF5Prison ${KF5_MIN_VERSION} CONFIG REQUIRED)
Allen Winter's avatar
Allen Winter committed
83

84
add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook\")
Laurent Montel's avatar
Laurent Montel committed
85
set(CMAKE_CXX_STANDARD 14)
86
set(CMAKE_CXX_STANDARD_REQUIRED ON)
87
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
88
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x054A00)
89

Laurent Montel's avatar
Laurent Montel committed
90
add_definitions(-DQT_NO_FOREACH)
91
add_definitions(-DQT_NO_KEYWORDS)
Laurent Montel's avatar
Laurent Montel committed
92

Laurent Montel's avatar
Laurent Montel committed
93
find_package(KUserFeedback 1.0.0 CONFIG) # Needs Provider::describeDataSources()
94
95
96
97
98
99
100
set_package_properties(KUserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional). It can be disable in apps.")

if (TARGET KUserFeedbackWidgets)
    add_definitions(-DWITH_KUSERFEEDBACK)
endif()


Laurent Montel's avatar
Laurent Montel committed
101
add_subdirectory(src)
102
add_subdirectory(kontactplugin)
Laurent Montel's avatar
Minor    
Laurent Montel committed
103

104
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
105
106
107
108
        EXPORT KADDRESSBOOK
        FILE kaddressbook.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
109

Laurent Montel's avatar
Laurent Montel committed
110
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
111
112
113
if(KF5DocTools_FOUND)
    add_subdirectory(doc)
endif()