1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-06-30 23:46:46 +00:00
dolphin/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

238 lines
6.8 KiB
CMake
Raw Permalink Normal View History

2021-06-25 15:57:07 +00:00
cmake_minimum_required(VERSION 3.16)
2014-06-28 22:49:11 +00:00
# KDE Application Version, managed by release script
set (RELEASE_SERVICE_VERSION_MAJOR "24")
set (RELEASE_SERVICE_VERSION_MINOR "07")
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})
2023-05-07 16:27:41 +00:00
set(QT_MIN_VERSION "6.4.0")
set(KF6_MIN_VERSION "6.2.0")
2014-06-28 22:49:11 +00:00
# ECM setup
2023-02-06 21:42:39 +00:00
find_package(ECM ${KF6_MIN_VERSION} CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
2014-06-28 22:49:11 +00:00
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings NO_POLICY_SCOPE)
2014-06-28 22:49:11 +00:00
include(ECMSetupVersion)
include(ECMGenerateHeaders)
include(ECMGenerateDBusServiceFile)
include(ECMConfiguredInstall)
include(CMakePackageConfigHelpers)
2014-06-28 22:49:11 +00:00
include(GenerateExportHeader)
include(FeatureSummary)
include(ECMQtDeclareLoggingCategory)
include(ECMDeprecationSettings)
include(CheckIncludeFiles)
include(CheckLibraryExists)
2024-03-09 10:24:58 +00:00
include(CheckFunctionExists)
2014-06-28 22:49:11 +00:00
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHIN
2015-08-22 16:22:37 +00:00
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/src/dolphin_version.h"
)
2023-05-07 16:27:41 +00:00
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
)
2023-05-07 16:27:41 +00:00
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
SOVERSION 6
2014-06-28 22:49:11 +00:00
)
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()
2023-02-06 21:42:39 +00:00
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
KCMUtils
NewStuff
CoreAddons
I18n
DBusAddons
Bookmarks
Config
KIO
Parts
Solid
IconThemes
Completion
TextWidgets
Notifications
2015-11-14 21:37:40 +00:00
Crash
Open externally called files/directories in new tabs Summary: FEATURE: 183429 FIXED-IN: 19.08.0 GUI: new cli argument --new-window Externally called files/directories are opened in a a new tab of an instance of Dolphin that already exists. If any of the given URIs are already open in a tab, then those tabs are activated instead of a new tab being opened. If there is no instance then the files/directories are opened in a new window. The newly opened file/directory has its tab activated, and consequently, the window is also activated. When the user clicks "Open In New Window" or "Detach Tab", the files/directories are opened in a new window. Test Plan: [Manual] Before testing, set the default file manager in system settings as the newly built Dolphin executable. One must also include the new dolphin executable in the $PATH, otherwise some functions will attempt to open the system dolphin instead of the new one. Furthermore, running two different versions of Dolphin (in particular, where one does not have this patch included) can result in bugs appearing, in particular, new tabs not opening as old instances will not recognise the DBus commands sent to it. However, I see no reason why a user will have two different versions of Dolphin (apart from people like us :D). Open directories with the help of auxillary programs (i.e. a browser). The files/directories should appear in a new window if an instance does not exist. If an existence already exists, then a new tab should be opened and activated in that instance and the window activated. Use QDBusViewer to open folders/items by calling the ShowFolders/ShowItems methods in org.freedesktop.FileManager1 of the Dolphin instance. When a user chooses to "Open In New Window"/"Detach Tab" then the files/directories should be opened in a new window. Reviewers: #dolphin, elvisangelaccio Subscribers: zzag, dfaure, fvogt, fikrim, magar, fbg13, davidedmundson, kwin, ngraham, elvisangelaccio, anthonyfieroni, kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D16648
2019-05-30 20:22:43 +00:00
WindowSystem
WidgetsAddons
2023-01-15 00:38:10 +00:00
Codecs
)
2023-11-10 17:55:23 +00:00
find_package(KF6UserFeedback ${KF6_MIN_VERSION})
set_package_properties(KF6UserFeedback
PROPERTIES TYPE OPTIONAL
PURPOSE "Used for submission of telemetry data"
)
2023-11-10 17:55:23 +00:00
if(KF6UserFeedback_FOUND)
set(HAVE_KUSERFEEDBACK TRUE)
endif()
2023-02-06 21:42:39 +00:00
find_package(KF6 ${KF6_MIN_VERSION} OPTIONAL_COMPONENTS
DocTools
)
find_package(PlasmaActivities)
set_package_properties(PlasmaActivities PROPERTIES DESCRIPTION "PlasmaActivities libraries"
2019-11-16 16:53:28 +00:00
URL "https://www.kde.org"
TYPE OPTIONAL
PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
)
2014-06-28 22:49:11 +00:00
find_package(Phonon4Qt6 CONFIG REQUIRED)
2014-06-28 22:49:11 +00:00
find_package(PackageKitQt6)
set_package_properties(PackageKitQt6
PROPERTIES DESCRIPTION "Software Manager integration"
TYPE OPTIONAL
PURPOSE "Used in the service menu installer"
)
if(PackageKitQt6_FOUND)
set(HAVE_PACKAGEKIT TRUE)
endif()
2023-02-06 21:42:39 +00:00
find_package(KF6Baloo ${KF6_MIN_VERSION})
set_package_properties(KF6Baloo PROPERTIES DESCRIPTION "Baloo Core libraries"
2019-11-16 16:53:28 +00:00
URL "https://www.kde.org"
2014-06-28 22:49:11 +00:00
TYPE OPTIONAL
PURPOSE "For adding desktop-wide search and tagging support to dolphin"
)
find_package(KF6BalooWidgets ${RELEASE_SERVICE_VERSION})
2023-02-06 21:42:39 +00:00
set_package_properties(KF6BalooWidgets PROPERTIES DESCRIPTION "Baloos Widgets"
2019-11-16 16:53:28 +00:00
URL "https://www.kde.org"
2014-06-28 22:49:11 +00:00
TYPE OPTIONAL
)
2023-02-06 21:42:39 +00:00
find_package(KF6FileMetaData ${KF6_MIN_VERSION})
set_package_properties(KF6FileMetaData PROPERTIES
2014-06-28 22:49:11 +00:00
URL "https://projects.kde.org/kfilemetadata"
TYPE OPTIONAL
PURPOSE "For accessing file metadata labels"
)
if (PlasmaActivities_FOUND)
set(HAVE_PLASMA_ACTIVITIES TRUE)
endif()
2023-02-06 21:42:39 +00:00
if (KF6Baloo_FOUND AND KF6BalooWidgets_FOUND AND KF6FileMetaData_FOUND)
2015-02-04 11:27:20 +00:00
message(STATUS "Baloo packages are found")
2014-06-28 22:49:11 +00:00
set(HAVE_BALOO TRUE)
else()
message(WARNING "Baloo packages not found. They are needed for the metadata features of Dolphin (including the information panel).")
2014-06-28 22:49:11 +00:00
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)
2014-06-28 22:49:11 +00:00
# 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})
2021-01-23 08:23:41 +00:00
ecm_qt_install_logging_categories(
EXPORT DOLPHIN
FILE dolphin.categories
DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR}
)
ki18n_install(po)
2023-02-06 21:42:39 +00:00
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)