-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
164 lines (130 loc) · 5.43 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
# SPDX-License-Identifier: CC0-1.0
# SPDX-FileCopyrightText: none
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(PIM_VERSION "6.3.40")
project(kaddressbook VERSION ${PIM_VERSION})
set(RELEASE_SERVICE_VERSION "25.03.40")
set(KF_MIN_VERSION "6.9.0")
find_package(ECM ${KF_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(ECMInstallIcons)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMAddAppIcon)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(ECMFeatureSummary)
include(ECMSetupVersion)
include(ECMAddTests)
include(ECMCheckOutboundLicense)
include(GenerateExportHeader)
include(ECMGenerateHeaders)
include(KDEGitCommitHooks)
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES src/*.cpp src/*.h kontactplugin/*.cpp kontactplugin/*.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
include(CheckFunctionExists)
# Do NOT add quote
set(KDEPIM_DEV_VERSION alpha)
# add an extra space
if(DEFINED KDEPIM_DEV_VERSION)
set(KDEPIM_DEV_VERSION " ${KDEPIM_DEV_VERSION}")
endif()
set(KDEPIM_VERSION "${PIM_VERSION}${KDEPIM_DEV_VERSION} (${RELEASE_SERVICE_VERSION})")
set(AKONADI_VERSION "6.3.40")
set(KONTACTINTERFACE_LIB_VERSION "6.3.40")
set(KDEPIM_LIB_VERSION "${PIM_VERSION}")
set(KDEPIM_LIB_SOVERSION "6")
find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED Widgets Test DBus PrintSupport)
set(LIBKDEPIM_LIB_VERSION "6.3.40")
set(LIBGRANTLEETHEME_LIB_VERSION "6.3.40")
set(PIMCOMMON_LIB_VERSION "6.3.40")
set(AKONADI_SEARCH_VERSION "6.3.40")
set(AKONADI_CONTACT_VERSION "6.3.40")
set(KLDAP_LIB_VERSION "6.3.40")
# Find KF6 package
find_package(KF6DBusAddons ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6CoreAddons ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6KCMUtils ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6Crash ${KF_MIN_VERSION} REQUIRED)
find_package(KF6IconThemes ${KF_MIN_VERSION} CONFIG REQUIRED)
find_package(KF6DocTools ${KF_MIN_VERSION})
set_package_properties(KF6DocTools PROPERTIES DESCRIPTION
"Tools to generate documentation"
TYPE OPTIONAL
)
find_package(KF6UserFeedback ${KF_MIN_VERSION})
set_package_properties(KF6UserFeedback PROPERTIES DESCRIPTION "User Feedback lib" TYPE OPTIONAL PURPOSE "Allow to send Telemetry Information (optional).")
find_package(KPim6Akonadi ${AKONADI_VERSION} CONFIG REQUIRED)
find_package(KPim6KontactInterface ${KONTACTINTERFACE_LIB_VERSION} CONFIG REQUIRED)
find_package(KPim6Libkdepim ${LIBKDEPIM_LIB_VERSION} CONFIG REQUIRED)
find_package(KPim6LdapCore ${KLDAP_LIB_VERSION} CONFIG REQUIRED)
find_package(KPim6PimCommonAkonadi ${PIMCOMMON_LIB_VERSION} CONFIG REQUIRED)
find_package(KPim6PimCommonActivities ${PIMCOMMON_LIB_VERSION} CONFIG)
if(UNIX)
find_package(KPim6AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG REQUIRED)
else()
find_package(KPim6AkonadiSearch ${AKONADI_SEARCH_VERSION} CONFIG)
set_package_properties(KPim6AkonadiSearch PROPERTIES DESCRIPTION "The Akonadi Search libraries" URL "https://invent.kde.org/pim/akonadi-search"
TYPE OPTIONAL PURPOSE "Provides search capabilities in KAddressbook and Akonadi (only debug)")
endif()
if(NOT KPim6AkonadiSearch_FOUND)
add_definitions(-DFORCE_DISABLE_AKONADI_SEARCH)
endif()
find_package(KPim6AkonadiContactWidgets ${AKONADI_CONTACT_VERSION} CONFIG REQUIRED)
find_package(KPim6GrantleeTheme ${LIBGRANTLEETHEME_LIB_VERSION} CONFIG REQUIRED)
include_directories(${kaddressbook_SOURCE_DIR} ${kaddressbook_BINARY_DIR})
add_definitions(-DTRANSLATION_DOMAIN=\"kaddressbook\")
add_definitions(-DQT_NO_CONTEXTLESS_CONNECT)
ecm_set_disabled_deprecation_versions(QT 6.8.1
KF 6.10.0
)
if(TARGET KF6::UserFeedbackWidgets)
set(KADDRESSBOOK_WITH_KUSERFEEDBACK true)
endif()
option(USE_UNITY_CMAKE_SUPPORT "Use UNITY cmake support (speedup compile time)" OFF)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT OFF)
if(USE_UNITY_CMAKE_SUPPORT)
set(COMPILE_WITH_UNITY_CMAKE_SUPPORT ON)
add_definitions(-DCOMPILE_WITH_UNITY_CMAKE_SUPPORT)
endif()
if(TARGET KPim6::PimCommonActivities)
option(OPTION_USE_PLASMA_ACTIVITIES "Activate plasma activities (experimental)" OFF)
if(OPTION_USE_PLASMA_ACTIVITIES)
if(NOT WIN32 AND NOT APPLE)
set(OPTION_USE_PLASMA_ACTIVITIES true)
else()
set(OPTION_USE_PLASMA_ACTIVITIES false)
endif()
endif()
if(OPTION_USE_PLASMA_ACTIVITIES)
if(NOT WIN32 AND NOT APPLE)
find_package(PlasmaActivities "6.1.0")
set_package_properties(PlasmaActivities PROPERTIES DESCRIPTION
"Allow to compile with plasma activities"
TYPE OPTIONAL
)
endif()
if(TARGET Plasma::Activities)
set(HAVE_ACTIVITY_SUPPORT TRUE)
endif()
endif()
endif()
configure_file(config-kaddressbook.h.in ${CMAKE_CURRENT_BINARY_DIR}/config-kaddressbook.h)
add_subdirectory(src)
add_subdirectory(kontactplugin)
ecm_qt_install_logging_categories(
EXPORT KADDRESSBOOK
FILE kaddressbook.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
ki18n_install(po)
if(KF6DocTools_FOUND)
kdoctools_install(po)
add_subdirectory(doc)
endif()
ecm_feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
file(GLOB_RECURSE ALL_SOURCE_FILES src/*.cpp src/*.h kontactplugin/*.cpp kontactplugin/*.h)
ecm_check_outbound_license(LICENSES GPL-2.0-only FILES ${ALL_SOURCE_FILES})