dolphin/src/CMakeLists.txt

444 lines
14 KiB
CMake
Raw Normal View History

include(ECMAddAppIcon)
2014-06-28 22:49:11 +00:00
configure_file(config-baloo.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-baloo.h)
configure_file(config-kactivities.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kactivities.h)
configure_file(config-packagekit.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-packagekit.h)
configure_file(config-terminal.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-terminal.h)
configure_file(config-kuserfeedback.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kuserfeedback.h)
add_definitions(
-DTRANSLATION_DOMAIN=\"dolphin\"
)
remove_definitions(
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
)
##########################################
add_library(dolphinvcs SHARED)
target_sources(dolphinvcs PRIVATE
views/versioncontrol/kversioncontrolplugin.cpp
)
generate_export_header(dolphinvcs BASE_NAME dolphinvcs)
target_link_libraries(
dolphinvcs PUBLIC
Qt${QT_MAJOR_VERSION}::Widgets
)
set_target_properties(dolphinvcs PROPERTIES
VERSION ${DOLPHINVCS_VERSION}
SOVERSION ${DOLPHINVCS_SOVERSION}
EXPORT_NAME DolphinVcs
)
ecm_generate_headers(dolphinvcs_LIB_HEADERS
HEADER_NAMES
KVersionControlPlugin
RELATIVE "views/versioncontrol"
REQUIRED_HEADERS dolphinvcs_LIB_HEADERS
)
install(TARGETS dolphinvcs EXPORT DolphinVcsTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPESDIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)
install(FILES ${dolphinvcs_LIB_HEADERS} DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin" COMPONENT Devel)
########### next target ###############
add_library(dolphinprivate SHARED)
target_sources(dolphinprivate PRIVATE
kitemviews/kfileitemlistview.cpp
kitemviews/kfileitemlistwidget.cpp
kitemviews/kfileitemlisttostring.cpp
kitemviews/kfileitemmodel.cpp
kitemviews/kfileitemmodelrolesupdater.cpp
kitemviews/kitemlistcontainer.cpp
kitemviews/kitemlistcontroller.cpp
kitemviews/kitemlistgroupheader.cpp
kitemviews/kitemlistheader.cpp
kitemviews/kitemlistselectionmanager.cpp
kitemviews/kitemliststyleoption.cpp
kitemviews/kitemlistview.cpp
kitemviews/kitemlistviewaccessible.cpp
kitemviews/kitemlistwidget.cpp
kitemviews/kitemmodelbase.cpp
kitemviews/kitemset.cpp
kitemviews/kstandarditemlistgroupheader.cpp
kitemviews/kstandarditemlistwidget.cpp
kitemviews/kstandarditemlistview.cpp
kitemviews/private/kdirectorycontentscounter.cpp
kitemviews/private/kdirectorycontentscounterworker.cpp
kitemviews/private/kfileitemclipboard.cpp
kitemviews/private/kfileitemmodelfilter.cpp
kitemviews/private/kitemlistheaderwidget.cpp
kitemviews/private/kitemlistkeyboardsearchmanager.cpp
kitemviews/private/kitemlistroleeditor.cpp
kitemviews/private/kitemlistrubberband.cpp
kitemviews/private/kitemlistselectiontoggle.cpp
kitemviews/private/kitemlistsizehintresolver.cpp
kitemviews/private/kitemlistsmoothscroller.cpp
kitemviews/private/kitemlistviewanimation.cpp
kitemviews/private/kitemlistviewlayouter.cpp
kitemviews/private/kpixmapmodifier.cpp
settings/applyviewpropsjob.cpp
settings/viewmodes/viewmodesettings.cpp
settings/viewpropertiesdialog.cpp
settings/viewpropsprogressinfo.cpp
views/dolphinfileitemlistwidget.cpp
views/dolphinitemlistview.cpp
views/dolphinnewfilemenuobserver.cpp
views/dolphinremoteencoding.cpp
2011-11-06 10:58:48 +00:00
views/dolphinview.cpp
views/dolphinviewactionhandler.cpp
2011-09-04 15:40:44 +00:00
views/draganddrophelper.cpp
views/versioncontrol/updateitemstatesthread.cpp
views/versioncontrol/versioncontrolobserver.cpp
views/viewmodecontroller.cpp
views/viewproperties.cpp
views/zoomlevelinfo.cpp
dolphinremoveaction.cpp
middleclickactioneventfilter.cpp
dolphinnewfilemenu.cpp
)
ecm_qt_declare_logging_category(dolphinprivate
HEADER dolphindebug.h
IDENTIFIER DolphinDebug
CATEGORY_NAME org.kde.dolphin
DESCRIPTION "dolphin"
EXPORT DOLPHIN
)
if(HAVE_BALOO)
target_sources(dolphinprivate PRIVATE
views/tooltips/dolphinfilemetadatawidget.cpp
views/tooltips/tooltipmanager.cpp
kitemviews/private/kbaloorolesprovider.cpp
)
endif()
kconfig_add_kcfg_files(dolphinprivate
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc
settings/dolphin_contextmenusettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
generate_export_header(dolphinprivate BASE_NAME dolphin)
target_link_libraries(
dolphinprivate PUBLIC
dolphinvcs
Qt${QT_MAJOR_VERSION}::Concurrent
Qt${QT_MAJOR_VERSION}::Gui
KF5::I18n
KF5::IconThemes
KF5::KIOCore
KF5::KIOWidgets
KF5::KIOFileWidgets
KF5::Completion
KF5::TextWidgets
KF5::ConfigCore
KF5::NewStuff
KF5::NewStuffWidgets # KNSWidgets::Button
KF5::Parts
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
KF5::WindowSystem
KF5::WidgetsAddons
)
if(HAVE_BALOO)
target_link_libraries(
dolphinprivate PUBLIC
KF5::FileMetaData
KF5::Baloo
2014-06-27 08:34:57 +00:00
KF5::BalooWidgets
)
endif()
2014-06-28 22:49:11 +00:00
set_target_properties(dolphinprivate PROPERTIES
VERSION ${DOLPHINPRIVATE_VERSION}
2014-06-28 22:49:11 +00:00
SOVERSION ${DOLPHINPRIVATE_SOVERSION}
)
install(TARGETS dolphinprivate ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolphin_export.h DESTINATION ${KDE_INSTALL_INCLUDEDIR} COMPONENT Devel)
##########################################
configure_file(dolphinpart.json.in ${CMAKE_CURRENT_BINARY_DIR}/dolphinpart.json @ONLY)
add_library(dolphinpart MODULE)
target_sources(dolphinpart PRIVATE
dolphinpart.cpp
dolphinpart_ext.cpp
dolphindebug.cpp
dolphinpart.qrc
)
2014-06-28 22:49:11 +00:00
target_link_libraries(dolphinpart
dolphinprivate
)
install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/parts)
##########################################
add_library(dolphinstatic STATIC)
target_sources(dolphinstatic PRIVATE
dolphinbookmarkhandler.cpp
dolphindockwidget.cpp
dolphinmainwindow.cpp
dolphinviewcontainer.cpp
dolphincontextmenu.cpp
dolphinnavigatorswidgetaction.cpp
dolphintabbar.cpp
dolphinplacesmodelsingleton.cpp
dolphinrecenttabsmenu.cpp
dolphintabpage.cpp
dolphintabwidget.cpp
dolphinurlnavigator.cpp
dolphinurlnavigatorscontroller.cpp
trash/dolphintrash.cpp
filterbar/filterbar.cpp
panels/places/placespanel.cpp
panels/panel.cpp
panels/folders/foldersitemlistwidget.cpp
panels/folders/treeviewcontextmenu.cpp
panels/folders/folderspanel.cpp
panels/terminal/terminalpanel.cpp
search/dolphinfacetswidget.cpp
search/dolphinquery.cpp
search/dolphinsearchbox.cpp
settings/general/behaviorsettingspage.cpp
settings/general/configurepreviewplugindialog.cpp
settings/general/confirmationssettingspage.cpp
settings/general/generalsettingspage.cpp
settings/general/previewssettingspage.cpp
settings/general/statusbarsettingspage.cpp
settings/dolphinsettingsdialog.cpp
settings/navigation/navigationsettingspage.cpp
settings/contextmenu/contextmenusettingspage.cpp
settings/settingspagebase.cpp
settings/serviceitemdelegate.cpp
settings/servicemodel.cpp
settings/startup/startupsettingspage.cpp
settings/trash/trashsettingspage.cpp
settings/viewmodes/dolphinfontrequester.cpp
settings/viewmodes/viewsettingspage.cpp
settings/viewmodes/viewmodesettings.cpp
settings/viewmodes/viewsettingstab.cpp
statusbar/dolphinstatusbar.cpp
statusbar/mountpointobserver.cpp
statusbar/mountpointobservercache.cpp
statusbar/spaceinfoobserver.cpp
statusbar/statusbarspaceinfo.cpp
views/zoomlevelinfo.cpp
dolphindebug.cpp
global.cpp
2021-05-19 20:10:14 +00:00
dolphin.qrc
)
if(HAVE_BALOO)
target_sources(dolphinstatic PRIVATE
panels/information/informationpanel.cpp
panels/information/informationpanelcontent.cpp
panels/information/pixmapviewer.cpp
panels/information/phononwidget.cpp
)
endif()
if(HAVE_KUSERFEEDBACK)
target_sources(dolphinstatic PRIVATE
userfeedback/dolphinfeedbackprovider.cpp
userfeedback/settingsdatasource.cpp
userfeedback/placesdatasource.cpp
settings/userfeedback/userfeedbacksettingspage.cpp
)
endif()
kconfig_add_kcfg_files(dolphinstatic
panels/folders/dolphin_folderspanelsettings.kcfgc
panels/information/dolphin_informationpanelsettings.kcfgc
panels/places/dolphin_placespanelsettings.kcfgc
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_contextmenusettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
search/dolphin_searchsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
kconfig_add_kcfg_files(dolphinstatic GENERATE_MOC
settings/dolphin_generalsettings.kcfgc
)
qt_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dolphinmainwindow.h org.kde.DolphinMainWindow.xml)
qt_add_dbus_adaptor(dolphin_dbus_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindow.h DolphinMainWindow)
qt_add_dbus_interface(dolphin_dbus_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindowinterface)
qt_add_dbus_interface(dolphin_dbus_SRCS panels/terminal/org.kde.KIOFuse.VFS.xml kiofuse_interface)
target_sources(dolphinstatic PRIVATE
${dolphin_dbus_SRCS}
)
target_include_directories(dolphinstatic SYSTEM PRIVATE ${PHONON_INCLUDES})
target_link_libraries(dolphinstatic
dolphinprivate
KF5::CoreAddons
KF5::KCMUtils
2015-02-04 09:29:33 +00:00
KF5::DBusAddons
KF5::Notifications
2022-03-15 12:30:13 +00:00
Phonon::phonon4qt${QT_MAJOR_VERSION}
)
if (HAVE_KACTIVITIES)
target_link_libraries(
dolphinstatic
KF5::Activities
)
endif()
if (HAVE_KUSERFEEDBACK)
target_link_libraries(
dolphinstatic
KUserFeedbackCore
KUserFeedbackWidgets
)
endif()
add_executable(dolphin)
target_sources(dolphin PRIVATE
dbusinterface.cpp
main.cpp
)
if(FLATPAK)
target_compile_definitions(dolphin PRIVATE FLATPAK)
endif()
# Sets the icon on Windows and OSX
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
2022-03-20 19:16:04 +00:00
ecm_add_app_icon(dolphin ICONS ${ICONS_SRCS})
target_link_libraries(dolphin
PRIVATE
dolphinprivate
dolphinstatic
KF5::Crash
)
include(DbusInterfaceMacros)
generate_and_install_dbus_interface(
dolphin
dbusinterface.h
org.freedesktop.FileManager1.xml
OPTIONS -a
)
install(TARGETS dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
##########################################
2020-09-09 08:39:52 +00:00
if(NOT WIN32)
# The settings are still accessible from the hamburger menu
add_library(kcm_dolphinviewmodes MODULE)
add_library(kcm_dolphinnavigation MODULE)
add_library(kcm_dolphingeneral MODULE)
target_sources(kcm_dolphinviewmodes PRIVATE
settings/kcm/kcmdolphinviewmodes.cpp
settings/viewmodes/dolphinfontrequester.cpp
settings/viewmodes/viewmodesettings.cpp
settings/viewmodes/viewsettingstab.cpp
views/zoomlevelinfo.cpp)
target_sources(kcm_dolphinnavigation PRIVATE
settings/kcm/kcmdolphinnavigation.cpp
settings/navigation/navigationsettingspage.cpp
settings/settingspagebase.cpp)
target_sources(kcm_dolphingeneral PRIVATE
settings/kcm/kcmdolphingeneral.cpp
settings/general/behaviorsettingspage.cpp
settings/general/previewssettingspage.cpp
settings/general/configurepreviewplugindialog.cpp
settings/general/confirmationssettingspage.cpp
settings/settingspagebase.cpp
settings/serviceitemdelegate.cpp
settings/servicemodel.cpp)
kconfig_add_kcfg_files(kcm_dolphinviewmodes
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
kconfig_add_kcfg_files(kcm_dolphinnavigation
settings/dolphin_generalsettings.kcfgc)
kconfig_add_kcfg_files(kcm_dolphingeneral
settings/dolphin_generalsettings.kcfgc)
2020-09-09 08:39:52 +00:00
target_link_libraries(kcm_dolphinviewmodes dolphinprivate)
target_link_libraries(kcm_dolphinnavigation dolphinprivate)
target_link_libraries(kcm_dolphingeneral dolphinprivate)
install( FILES org.kde.dolphin.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
install(TARGETS kcm_dolphinviewmodes DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
install(TARGETS kcm_dolphinnavigation DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
install(TARGETS kcm_dolphingeneral DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
2020-09-09 08:39:52 +00:00
endif()
if(NOT WIN32)
add_subdirectory(settings/contextmenu/servicemenuinstaller)
install( FILES settings/contextmenu/servicemenu.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR} )
endif()
########### install files ###############
2015-03-08 17:57:23 +00:00
install( PROGRAMS org.kde.dolphin.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
install( DIRECTORY DESTINATION "${KDE_INSTALL_FULL_DATAROOTDIR}/kglobalaccel" )
install(
CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink \"${KDE_INSTALL_FULL_APPDIR}/org.kde.dolphin.desktop\" \"\$ENV{DESTDIR}${KDE_INSTALL_FULL_DATAROOTDIR}/kglobalaccel/org.kde.dolphin.desktop\")"
)
install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
settings/dolphin_generalsettings.kcfg
settings/dolphin_contextmenusettings.kcfg
settings/dolphin_compactmodesettings.kcfg
settings/dolphin_iconsmodesettings.kcfg
settings/dolphin_detailsmodesettings.kcfg
settings/dolphin_versioncontrolsettings.kcfg
2015-03-08 17:57:23 +00:00
DESTINATION ${KDE_INSTALL_KCFGDIR} )
2014-06-29 00:07:41 +00:00
install( FILES settings/dolphin_detailsmodesettings.upd
DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR} )
2015-01-22 21:16:07 +00:00
if(BUILD_TESTING)
add_subdirectory(tests)
endif()