CMakeLists.txt 4.08 KB
Newer Older
1
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
2
set(PIM_VERSION "5.17.40")
3
project(kaddressbook VERSION ${PIM_VERSION})
4
set(RELEASE_SERVICE_VERSION "21.07.40")
5
set(KF5_MIN_VERSION "5.83.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

Antonio Rojas's avatar
Antonio Rojas committed
12
13
14
15
16
17
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)

Laurent Montel's avatar
Laurent Montel committed
18
19
include(ECMSetupVersion)
include(ECMAddTests)
20

Laurent Montel's avatar
Laurent Montel committed
21
22
include(GenerateExportHeader)
include(ECMGenerateHeaders)
23

Laurent Montel's avatar
Laurent Montel committed
24
include(FeatureSummary)
25
include(KDEGitCommitHooks)
Laurent Montel's avatar
Laurent Montel committed
26
27
28
include(CheckFunctionExists)
include(ECMGeneratePriFile)

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

Laurent Montel's avatar
Laurent Montel committed
30
# Do NOT add quote
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.17.40")
set(AKONADI_VERSION "5.17.40")
set(KONTACTINTERFACE_LIB_VERSION "5.17.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.15.0")
Laurent Montel's avatar
Laurent Montel committed
49
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus PrintSupport)
50
51
52
53
54
set(LIBKDEPIM_LIB_VERSION "5.17.40")
set(LIBGRANTLEETHEME_LIB_VERSION "5.17.40")
set(PIMCOMMON_LIB_VERSION "5.17.40")
set(LIBKLEO_LIB_VERSION "5.17.40")
set(AKONADI_SEARCH_VERSION "5.17.40")
55
set(AKONADI_CONTACT_VERSION "5.17.41")
Laurent Montel's avatar
Laurent Montel committed
56

Laurent Montel's avatar
Laurent Montel committed
57
# Find KF5 package
58
find_package(KF5DBusAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
59
find_package(KF5CoreAddons ${KF5_MIN_VERSION} CONFIG REQUIRED)
60
61
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

Laurent Montel's avatar
Laurent Montel committed
64
65
66
67
68
69
find_package(KF5DocTools ${KF5_MIN_VERSION})
set_package_properties(KF5DocTools PROPERTIES DESCRIPTION
    "Tools to generate documentation"
    TYPE OPTIONAL
)

Laurent Montel's avatar
Laurent Montel committed
70
71
72
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
73
74
find_package(KF5Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KF5PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
75
find_package(KF5AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
76
find_package(KF5AkonadiContact ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
77
find_package(KF5GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
78

79
set(GPGMEPP_LIB_VERSION "1.11.1")
Laurent Montel's avatar
Laurent Montel committed
80
find_package(Gpgmepp ${GPGMEPP_LIB_VERSION} CONFIG REQUIRED)
Daniel Vrátil's avatar
Daniel Vrátil committed
81

82
set(QGPGME_LIB_VERSION "1.11.1")
83
find_package(QGpgme ${QGPGME_LIB_VERSION} CONFIG REQUIRED)
Laurent Montel's avatar
Laurent Montel committed
84
85

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

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

89
add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook\")
90
set(CMAKE_CXX_STANDARD 17)
91
set(CMAKE_CXX_STANDARD_REQUIRED ON)
92
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x050f00)
93
add_definitions(-DKF_DISABLE_DEPRECATED_BEFORE_AND_AT=0x055400)
94

Laurent Montel's avatar
Laurent Montel committed
95

Laurent Montel's avatar
Laurent Montel committed
96
find_package(KUserFeedback 1.0.0 CONFIG) # Needs Provider::describeDataSources()
97
98
99
100
101
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()
102
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
103

104
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
Laurent Montel's avatar
Laurent Montel committed
105
if (USE_UNITY_CMAKE_SUPPORT)
106
107
    set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
    add_definitions(-DCOMPILE_WITH_UNITY_CMAKE_SUPPORT)
108
endif()
109

110

Laurent Montel's avatar
Laurent Montel committed
111
add_subdirectory(src)
112
add_subdirectory(kontactplugin)
Laurent Montel's avatar
Minor    
Laurent Montel committed
113

114
ecm_qt_install_logging_categories(
Laurent Montel's avatar
Laurent Montel committed
115
116
117
118
        EXPORT KADDRESSBOOK
        FILE kaddressbook.categories
        DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
        )
Laurent Montel's avatar
Laurent Montel committed
119

120
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
121
ki18n_install(po)
122
if(KF5DocTools_FOUND)
Laurent Montel's avatar
Laurent Montel committed
123
    kdoctools_install(po)
124
125
    add_subdirectory(doc)
endif()
Laurent Montel's avatar
Laurent Montel committed
126
127

feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)