dolphin/src/CMakeLists.txt

416 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-terminal.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-terminal.h)
add_definitions(
-DTRANSLATION_DOMAIN=\"dolphin\"
)
remove_definitions(
-DQT_NO_CAST_FROM_BYTEARRAY
-DQT_NO_SIGNALS_SLOTS_KEYWORDS
-DQT_NO_CAST_FROM_ASCII
-DQT_NO_CAST_TO_ASCII
)
##########################################
set(dolphinvcs_LIB_SRCS
views/versioncontrol/kversioncontrolplugin.cpp
)
add_library(dolphinvcs ${dolphinvcs_LIB_SRCS})
generate_export_header(dolphinvcs BASE_NAME dolphinvcs)
target_link_libraries(
dolphinvcs PUBLIC
Qt5::Widgets
)
set_target_properties(dolphinvcs PROPERTIES
VERSION ${DOLPHINVCS_VERSION_STRING}
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_KSERVICETYPES5DIR})
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 ###############
set(dolphinprivate_LIB_SRCS
kitemviews/kfileitemlistview.cpp
kitemviews/kfileitemlistwidget.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/kstandarditem.cpp
kitemviews/kstandarditemlistgroupheader.cpp
kitemviews/kstandarditemlistwidget.cpp
kitemviews/kstandarditemlistview.cpp
kitemviews/kstandarditemmodel.cpp
kitemviews/private/kdirectorycontentscounter.cpp
kitemviews/private/kdirectorycontentscounterworker.cpp
kitemviews/private/kfileitemclipboard.cpp
kitemviews/private/kfileitemmodeldirlister.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/renamedialog.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_LIB_SRCS HEADER dolphindebug.h IDENTIFIER DolphinDebug CATEGORY_NAME org.kde.dolphin)
if(HAVE_BALOO)
set(dolphinprivate_LIB_SRCS
${dolphinprivate_LIB_SRCS}
views/tooltips/dolphinfilemetadatawidget.cpp
views/tooltips/tooltipmanager.cpp
kitemviews/private/kbaloorolesprovider.cpp
)
endif()
kconfig_add_kcfg_files(dolphinprivate_LIB_SRCS GENERATE_MOC
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
2014-06-28 22:49:11 +00:00
add_library(dolphinprivate ${dolphinprivate_LIB_SRCS})
generate_export_header(dolphinprivate BASE_NAME dolphin)
target_link_libraries(
dolphinprivate PUBLIC
dolphinvcs
Qt5::Concurrent
Qt5::Gui
KF5::I18n
KF5::IconThemes
KF5::KIOCore
KF5::KIOWidgets
KF5::KIOFileWidgets
KF5::Completion
KF5::TextWidgets
KF5::ConfigCore
KF5::NewStuff
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
)
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_STRING}
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)
##########################################
set(dolphinpart_SRCS
dolphinpart.cpp
dolphinpart_ext.cpp
dolphindebug.cpp
)
qt5_add_resources(dolphinpart_SRCS dolphinpart.qrc)
2014-06-28 22:49:11 +00:00
add_library(dolphinpart MODULE ${dolphinpart_SRCS})
2014-06-28 22:49:11 +00:00
target_link_libraries(dolphinpart
dolphinprivate
)
2015-03-08 17:57:23 +00:00
install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR})
2015-03-08 17:57:23 +00:00
install(FILES dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
##########################################
set(dolphinstatic_SRCS
dolphinbookmarkhandler.cpp
dolphindockwidget.cpp
dolphinmainwindow.cpp
dolphinviewcontainer.cpp
dolphincontextmenu.cpp
dolphintabbar.cpp
dolphinplacesmodelsingleton.cpp
dolphinrecenttabsmenu.cpp
dolphintabpage.cpp
dolphintabwidget.cpp
trash/dolphintrash.cpp
filterbar/filterbar.cpp
panels/places/placespanel.cpp
panels/places/placesitem.cpp
panels/places/placesitemlistgroupheader.cpp
panels/places/placesitemlistwidget.cpp
panels/places/placesitemmodel.cpp
panels/places/placesitemsignalhandler.cpp
panels/places/placesview.cpp
panels/panel.cpp
panels/folders/foldersitemlistwidget.cpp
panels/folders/treeviewcontextmenu.cpp
panels/folders/folderspanel.cpp
panels/terminal/terminalpanel.cpp
search/dolphinfacetswidget.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/services/servicessettingspage.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
)
if(HAVE_BALOO)
set(dolphinstatic_SRCS
${dolphinstatic_SRCS}
panels/information/informationpanel.cpp
panels/information/informationpanelcontent.cpp
panels/information/pixmapviewer.cpp
panels/information/phononwidget.cpp
)
endif()
kconfig_add_kcfg_files(dolphinstatic_SRCS GENERATE_MOC
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_generalsettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
search/dolphin_searchsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
qt5_add_resources(dolphinstatic_SRCS dolphin.qrc)
add_library(dolphinstatic STATIC ${dolphinstatic_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
Phonon::phonon4qt5
)
if (HAVE_KACTIVITIES)
target_link_libraries(
dolphinstatic
KF5::Activities
)
endif()
set(dolphin_SRCS
dbusinterface.cpp
main.cpp
)
# Sets the icon on Windows and OSX
file(GLOB ICONS_SRCS "${CMAKE_CURRENT_SOURCE_DIR}/icons/*system-file-manager.png")
ecm_add_app_icon(dolphin_SRCS ICONS ${ICONS_SRCS})
kf5_add_kdeinit_executable(dolphin ${dolphin_SRCS})
target_link_libraries(kdeinit_dolphin PRIVATE
dolphinstatic
dolphinprivate
KF5::Crash
)
include(DbusInterfaceMacros)
generate_and_install_dbus_interface(
kdeinit_dolphin
dbusinterface.h
org.freedesktop.FileManager1.xml
OPTIONS -a
)
install(TARGETS kdeinit_dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(TARGETS dolphin ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
##########################################
set(kcm_dolphinviewmodes_PART_SRCS
settings/kcm/kcmdolphinviewmodes.cpp
settings/viewmodes/dolphinfontrequester.cpp
settings/viewmodes/viewmodesettings.cpp
settings/viewmodes/viewsettingstab.cpp
views/zoomlevelinfo.cpp)
set(kcm_dolphinnavigation_PART_SRCS
settings/kcm/kcmdolphinnavigation.cpp
settings/navigation/navigationsettingspage.cpp
settings/settingspagebase.cpp)
set(kcm_dolphinservices_PART_SRCS
settings/kcm/kcmdolphinservices.cpp
settings/services/servicessettingspage.cpp
settings/settingspagebase.cpp
settings/serviceitemdelegate.cpp
settings/servicemodel.cpp)
set(kcm_dolphingeneral_PART_SRCS
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)
2014-06-28 22:49:11 +00:00
kconfig_add_kcfg_files(kcm_dolphinviewmodes_PART_SRCS
settings/dolphin_compactmodesettings.kcfgc
settings/dolphin_directoryviewpropertysettings.kcfgc
settings/dolphin_detailsmodesettings.kcfgc
settings/dolphin_iconsmodesettings.kcfgc
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc
)
2014-06-28 22:49:11 +00:00
kconfig_add_kcfg_files(kcm_dolphinnavigation_PART_SRCS
settings/dolphin_generalsettings.kcfgc)
2014-06-28 22:49:11 +00:00
kconfig_add_kcfg_files(kcm_dolphinservices_PART_SRCS
settings/dolphin_generalsettings.kcfgc
settings/dolphin_versioncontrolsettings.kcfgc)
2014-06-28 22:49:11 +00:00
kconfig_add_kcfg_files(kcm_dolphingeneral_PART_SRCS
settings/dolphin_generalsettings.kcfgc)
2014-06-28 22:49:11 +00:00
add_library(kcm_dolphinviewmodes MODULE ${kcm_dolphinviewmodes_PART_SRCS})
add_library(kcm_dolphinnavigation MODULE ${kcm_dolphinnavigation_PART_SRCS})
add_library(kcm_dolphinservices MODULE ${kcm_dolphinservices_PART_SRCS})
add_library(kcm_dolphingeneral MODULE ${kcm_dolphingeneral_PART_SRCS})
target_link_libraries(kcm_dolphinviewmodes dolphinprivate)
target_link_libraries(kcm_dolphinnavigation dolphinprivate)
target_link_libraries(kcm_dolphinservices dolphinprivate)
target_link_libraries(kcm_dolphingeneral dolphinprivate)
2015-03-08 17:57:23 +00:00
install(TARGETS kcm_dolphinviewmodes DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphinnavigation DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphinservices DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install(TARGETS kcm_dolphingeneral DESTINATION ${KDE_INSTALL_PLUGINDIR} )
add_subdirectory(settings/services/servicemenuinstaller)
########### 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_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} )
install( FILES org.kde.dolphin.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
install( FILES settings/kcm/kcmdolphinviewmodes.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
2015-03-08 17:57:23 +00:00
install( FILES settings/kcm/kcmdolphinnavigation.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/kcm/kcmdolphinservices.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/kcm/kcmdolphingeneral.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
install( FILES settings/services/servicemenu.knsrc DESTINATION ${KDE_INSTALL_CONFDIR} )
2014-06-29 00:07:41 +00:00
2015-01-22 21:16:07 +00:00
if(BUILD_TESTING)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
add_subdirectory(tests)
endif()