-
-
Notifications
You must be signed in to change notification settings - Fork 73
/
CMakeLists.txt
228 lines (191 loc) · 6.46 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
cmake_minimum_required(VERSION 3.16)
# KDE Application 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(Dolphin VERSION ${RELEASE_SERVICE_VERSION})
set(QT_MIN_VERSION "6.4.0")
set(KF6_MIN_VERSION "6.2.0")
# ECM setup
find_package(ECM ${KF6_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGenerateDBusServiceFile)
include(ECMConfiguredInstall)
include(CMakePackageConfigHelpers)
include(GenerateExportHeader)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(CheckIncludeFiles)
include(CheckLibraryExists)
include(CheckFunctionExists)
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHIN
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/dolphin_version.h"
)
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINVCS
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
SOVERSION 6
)
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
SOVERSION 6
)
find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core
Concurrent
Widgets
Gui
DBus
)
if (UNIX AND NOT APPLE AND NOT HAIKU)
set(HAVE_X11 TRUE)
endif()
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
KCMUtils
NewStuff
CoreAddons
I18n
DBusAddons
Bookmarks
Config
KIO
Parts
Solid
IconThemes
Completion
TextWidgets
Notifications
Crash
WindowSystem
WidgetsAddons
Codecs
GuiAddons
)
find_package(KF6UserFeedback ${KF6_MIN_VERSION})
set_package_properties(KF6UserFeedback
PROPERTIES TYPE OPTIONAL
PURPOSE "Used for submission of telemetry data"
)
if(KF6UserFeedback_FOUND)
set(HAVE_KUSERFEEDBACK TRUE)
endif()
find_package(KF6 ${KF6_MIN_VERSION} OPTIONAL_COMPONENTS
DocTools
)
find_package(Phonon4Qt6 CONFIG REQUIRED)
find_package(PackageKitQt6)
set_package_properties(PackageKitQt6
PROPERTIES DESCRIPTION "Software Manager integration"
TYPE RECOMMENDED
PURPOSE "Used in the service menu installer"
)
if(PackageKitQt6_FOUND)
set(HAVE_PACKAGEKIT TRUE)
endif()
find_package(KF6FileMetaData ${KF6_MIN_VERSION})
set_package_properties(KF6FileMetaData PROPERTIES
URL "https://projects.kde.org/kfilemetadata"
TYPE REQUIRED
PURPOSE "For accessing file metadata labels and filesystem metadata"
)
find_package(KF6Baloo ${KF6_MIN_VERSION})
set_package_properties(KF6Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
URL "https://www.kde.org"
TYPE OPTIONAL
PURPOSE "For adding desktop-wide search and tagging support to dolphin"
)
find_package(KF6BalooWidgets ${RELEASE_SERVICE_VERSION})
set_package_properties(KF6BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
URL "https://www.kde.org"
TYPE OPTIONAL
)
if (KF6Baloo_FOUND AND KF6BalooWidgets_FOUND)
message(STATUS "Baloo packages are found")
set(HAVE_BALOO TRUE)
else()
message(WARNING "Baloo packages not found. They are needed for the metadata features of Dolphin (including the information panel).")
endif()
# TODO: drop HAVE_TERMINAL once we are sure the terminal panel works on Windows too.
if(WIN32)
set(HAVE_TERMINAL FALSE)
else()
set(HAVE_TERMINAL TRUE)
endif()
# Compatibility with platforms without native fts (e.g. musl)
check_include_files("sys/types.h;sys/stat.h;fts.h" HAVE_FTS_H)
if(HAVE_FTS_H AND NOT HAIKU)
check_function_exists(fts_open HAVE_FTS_OPEN)
if(NOT HAVE_FTS_OPEN)
check_library_exists(fts fts_open "" HAVE_LIB_FTS)
endif()
endif()
if(HAVE_LIB_FTS)
set(FTS_LIB fts)
else()
set(FTS_LIB "")
endif()
add_subdirectory(src)
add_subdirectory(doc)
add_subdirectory(appiumtests)
# CMake files
set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/DolphinVcs")
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/DolphinVcsConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
INSTALL_DESTINATION ${CMAKECONFIG_INSTALL_DIR}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfig.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
COMPONENT Devel
)
install(EXPORT DolphinVcsTargets
DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
FILE DolphinVcsTargets.cmake
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin"
COMPONENT Devel
)
if(FLATPAK)
ecm_generate_dbus_service_file(
NAME org.freedesktop.FileManager1
EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
SYSTEMD_SERVICE plasma-dolphin.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
)
else()
ecm_generate_dbus_service_file(
NAME org.freedesktop.FileManager1
EXECUTABLE "${KDE_INSTALL_FULL_BINDIR}/dolphin --daemon"
SYSTEMD_SERVICE plasma-dolphin.service
DESTINATION ${KDE_INSTALL_DBUSSERVICEDIR}
RENAME org.kde.dolphin.FileManager1.service
)
endif()
ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR})
ecm_qt_install_logging_categories(
EXPORT DOLPHIN
FILE dolphin.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
ki18n_install(po)
if(KF6DocTools_FOUND)
kdoctools_install(po)
endif()
install(FILES completions/dolphin.zsh RENAME _dolphin DESTINATION ${KDE_INSTALL_ZSHAUTOCOMPLETEDIR})
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
include(KDEClangFormat)
# add clang-format target
file(GLOB_RECURSE ALL_CLANG_FORMAT_SOURCE_FILES *.cpp *.h *.c)
kde_clang_format(${ALL_CLANG_FORMAT_SOURCE_FILES})
include(KDEGitCommitHooks)
kde_configure_git_pre_commit_hook(CHECKS CLANG_FORMAT)