-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
CMakeLists.txt
232 lines (193 loc) · 7.03 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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
cmake_minimum_required(VERSION 3.16)
# KDE Applications Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "25")
set (RELEASE_SERVICE_VERSION_MINOR "03")
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(kio-extras VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "6.5.0")
set(KF_MIN_VERSION "6.0.0")
find_package(ECM ${KF_MIN_VERSION} REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${ECM_MODULE_PATH})
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(KDEGitCommitHooks)
include(ECMMarkNonGuiExecutable)
include(ECMMarkAsTest)
include(ECMOptionalAddSubdirectory)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(CheckIncludeFile)
include(CMakePushCheckState)
include(CMakePackageConfigHelpers)
include(FeatureSummary)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Network Widgets Svg Core5Compat)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS
Archive
Config
ConfigWidgets
CoreAddons
DocTools
DNSSD
I18n
KIO
Solid
GuiAddons
SyntaxHighlighting
KCMUtils
TextWidgets
)
# shall we use DBus?
# enabled per default on Linux & BSD systems
set(USE_DBUS_DEFAULT OFF)
if(UNIX AND NOT APPLE AND NOT ANDROID AND NOT HAIKU)
set(USE_DBUS_DEFAULT ON)
endif()
option(USE_DBUS "Build components using DBus" ${USE_DBUS_DEFAULT})
if(USE_DBUS)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS DBus)
find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS DBusAddons)
endif()
find_package(Qt6Test ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(Qt6Test PROPERTIES
PURPOSE "Required for tests"
TYPE OPTIONAL
)
add_feature_info("Qt6Test" Qt6Test_FOUND "Required for building tests")
if (NOT Qt6Test_FOUND)
set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
endif()
find_package(QCoro6 REQUIRED COMPONENTS Core)
qcoro_enable_coroutines()
include(KDEClangFormat)
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
if (NOT WIN32 AND USE_DBUS)
option(BUILD_ACTIVITIES "Build recentlyused:/, activities:/ KIO workers and fileitem plugin." ON)
if(BUILD_ACTIVITIES)
find_package(Qt6Sql REQUIRED)
find_package(PlasmaActivities REQUIRED)
find_package(PlasmaActivitiesStats REQUIRED)
endif()
endif()
find_package(Phonon4Qt6 4.6.60 NO_MODULE)
set_package_properties(Phonon4Qt6 PROPERTIES
DESCRIPTION "Qt-based audio library"
PURPOSE "Required for the audio preview plugin"
TYPE OPTIONAL)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
if(NOT WIN32)
# we need a version of samba which has already smbc_set_context(), Alex
set(SAMBA_REQUIRE_SMBC_SET_CONTEXT TRUE)
set(SAMBA_REQUIRE_SMBC_OPTION_SET TRUE)
find_package(Samba)
set_package_properties(Samba PROPERTIES DESCRIPTION "the SMB client library, a version with smbc_set_context() and smbc_option_set()"
URL "https://www.samba.org/"
TYPE OPTIONAL
PURPOSE "Needed to build the SMB KIO worker"
)
endif()
find_package(libssh 0.8.3 MODULE)
set_package_properties(libssh PROPERTIES DESCRIPTION "the SSH library with SFTP support"
URL "https://www.libssh.org/"
TYPE OPTIONAL
PURPOSE "Needed to build the SFTP KIO worker"
)
find_package(Libmtp 1.1.2)
set_package_properties(Libmtp PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the MTP KIO worker"
)
find_package(IMobileDevice)
set_package_properties(IMobileDevice PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the AFC (Apple File Conduit) KIO worker"
)
find_package(PList)
set_package_properties(PList PROPERTIES
TYPE OPTIONAL
PURPOSE "Needed to build the AFC (Apple File Conduit) KIO worker"
)
check_include_file(utime.h HAVE_UTIME_H)
# ECM's KDECompilerSettings.cmake should take care of enabling supporting on
# 32bit architectures.
# Thorw a fatal error if off_t isn't >=64bit to ensure that large files are working
# as expected.
# BUG: 165449
if(UNIX)
check_cxx_source_compiles("
#include <sys/types.h>
/* Check that off_t can represent 2**63 - 1 correctly.
We can't simply define LARGE_OFF_T to be 9223372036854775807,
since some C++ compilers masquerading as C compilers
incorrectly reject 9223372036854775807. */
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1];
int main() { return 0; }
"
OFFT_IS_64BIT)
if(NOT OFFT_IS_64BIT)
message(FATAL_ERROR "Large file support is not enabled.")
endif()
find_package(Gperf)
set_package_properties(Gperf PROPERTIES TYPE OPTIONAL
PURPOSE "Needed to build the man KIO worker"
)
else()
# FIXME: on windows we ignore support until trash gets integrated
endif()
ecm_set_disabled_deprecation_versions(
QT 5.15.2
KF 6.0
)
add_subdirectory(doc)
add_subdirectory(kcms)
if(BUILD_ACTIVITIES)
add_subdirectory( activities )
add_subdirectory( recentlyused )
endif()
add_subdirectory( filter )
if(Phonon4Qt6_FOUND)
add_subdirectory( kfileaudiopreview )
endif()
add_subdirectory( info )
add_subdirectory( archive )
if (NOT WIN32)
# does not compile: fish.cpp(41): fatal error C1083: Cannot open include file: 'sys/resource.h': No such file or directory
# Used for getting the resource limit for closing all child process FDs. Could be completely replaced by fcloseall() if available for Unix or _fcloseall() for Windows, either conditionally on Q_OS_type or using a configure test.
add_subdirectory( fish )
endif()
add_subdirectory( thumbnail )
if (libssh_FOUND)
add_subdirectory(sftp)
endif ()
if (NOT WIN32 AND NOT APPLE AND USE_DBUS)
add_subdirectory( filenamesearch )
endif()
if (Libmtp_FOUND AND USE_DBUS)
add_subdirectory(mtp)
endif()
if(NOT WIN32)
if(Gperf_FOUND)
add_subdirectory( man )
endif()
endif()
if(SAMBA_FOUND AND USE_DBUS)
add_subdirectory(smb)
endif()
if(IMobileDevice_FOUND AND PList_FOUND)
add_subdirectory(afc)
endif()
configure_file (config-runtime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-runtime.h )
ecm_qt_install_logging_categories(
EXPORT KIO_EXTRAS
FILE kio-extras.categories
DESTINATION "${KDE_INSTALL_LOGGINGCATEGORIESDIR}"
)
ki18n_install(po)
kdoctools_install(po)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)