mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-03 23:29:06 +00:00
Adapt build system for building against qt6
This commit is contained in:
parent
8bc7f72a73
commit
c21a02bcab
|
@ -42,7 +42,7 @@ ecm_setup_version("5.0.0" VARIABLE_PREFIX DOLPHINPRIVATE
|
||||||
SOVERSION 5
|
SOVERSION 5
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
|
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
|
||||||
Core
|
Core
|
||||||
Concurrent
|
Concurrent
|
||||||
Widgets
|
Widgets
|
||||||
|
@ -89,7 +89,7 @@ set_package_properties(KF5Activities PROPERTIES DESCRIPTION "KActivities librari
|
||||||
PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
|
PURPOSE "For tracking which folders are frequently accessed on a Plasma desktop"
|
||||||
)
|
)
|
||||||
|
|
||||||
find_package(Phonon4Qt5 CONFIG REQUIRED)
|
find_package(Phonon4Qt${QT_MAJOR_VERSION} CONFIG REQUIRED)
|
||||||
|
|
||||||
find_package(PackageKitQt5)
|
find_package(PackageKitQt5)
|
||||||
set_package_properties(PackageKitQt5
|
set_package_properties(PackageKitQt5
|
||||||
|
@ -192,7 +192,7 @@ else()
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${SYSTEMD_USER_UNIT_INSTALL_DIR})
|
ecm_install_configured_files(INPUT plasma-dolphin.service.in DESTINATION ${KDE_INSTALL_SYSTEMDUSERUNITDIR})
|
||||||
|
|
||||||
ecm_qt_install_logging_categories(
|
ecm_qt_install_logging_categories(
|
||||||
EXPORT DOLPHIN
|
EXPORT DOLPHIN
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
include(CMakeFindDependencyMacro)
|
include(CMakeFindDependencyMacro)
|
||||||
|
|
||||||
find_dependency(Qt5Widgets)
|
find_dependency(Qt@QT_MAJOR_VERSION@Widgets)
|
||||||
find_dependency(KF5KIO)
|
find_dependency(KF5KIO)
|
||||||
|
|
||||||
include("${CMAKE_CURRENT_LIST_DIR}/DolphinVcsTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/DolphinVcsTargets.cmake")
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
macro (generate_and_install_dbus_interface main_project_target header_file output_xml_file)
|
macro (generate_and_install_dbus_interface main_project_target header_file output_xml_file)
|
||||||
qt5_generate_dbus_interface(
|
qt_generate_dbus_interface(
|
||||||
${header_file}
|
${header_file}
|
||||||
${output_xml_file}
|
${output_xml_file}
|
||||||
)
|
)
|
||||||
|
|
|
@ -31,7 +31,7 @@ generate_export_header(dolphinvcs BASE_NAME dolphinvcs)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
dolphinvcs PUBLIC
|
dolphinvcs PUBLIC
|
||||||
Qt5::Widgets
|
Qt${QT_MAJOR_VERSION}::Widgets
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(dolphinvcs PROPERTIES
|
set_target_properties(dolphinvcs PROPERTIES
|
||||||
|
@ -50,7 +50,7 @@ ecm_generate_headers(dolphinvcs_LIB_HEADERS
|
||||||
|
|
||||||
install(TARGETS dolphinvcs EXPORT DolphinVcsTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS dolphinvcs EXPORT DolphinVcsTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
||||||
install(FILES views/versioncontrol/fileviewversioncontrolplugin.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
|
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 ${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)
|
install(FILES ${dolphinvcs_LIB_HEADERS} DESTINATION "${KDE_INSTALL_INCLUDEDIR}/Dolphin" COMPONENT Devel)
|
||||||
|
|
||||||
|
@ -145,8 +145,8 @@ generate_export_header(dolphinprivate BASE_NAME dolphin)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
dolphinprivate PUBLIC
|
dolphinprivate PUBLIC
|
||||||
dolphinvcs
|
dolphinvcs
|
||||||
Qt5::Concurrent
|
Qt${QT_MAJOR_VERSION}::Concurrent
|
||||||
Qt5::Gui
|
Qt${QT_MAJOR_VERSION}::Gui
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::IconThemes
|
KF5::IconThemes
|
||||||
KF5::KIOCore
|
KF5::KIOCore
|
||||||
|
@ -198,7 +198,7 @@ target_link_libraries(dolphinpart
|
||||||
|
|
||||||
install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/parts)
|
install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/parts)
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
|
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolphinpart.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
|
||||||
|
|
||||||
##########################################
|
##########################################
|
||||||
|
|
||||||
|
@ -291,10 +291,10 @@ kconfig_add_kcfg_files(dolphinstatic GENERATE_MOC
|
||||||
settings/dolphin_generalsettings.kcfgc
|
settings/dolphin_generalsettings.kcfgc
|
||||||
)
|
)
|
||||||
|
|
||||||
qt5_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dolphinmainwindow.h org.kde.DolphinMainWindow.xml)
|
qt_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/dolphinmainwindow.h org.kde.DolphinMainWindow.xml)
|
||||||
qt5_add_dbus_adaptor(dolphin_dbus_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindow.h DolphinMainWindow)
|
qt_add_dbus_adaptor(dolphin_dbus_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindow.h DolphinMainWindow)
|
||||||
qt5_add_dbus_interface(dolphin_dbus_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindowinterface)
|
qt_add_dbus_interface(dolphin_dbus_SRCS ${CMAKE_CURRENT_BINARY_DIR}/org.kde.DolphinMainWindow.xml dolphinmainwindowinterface)
|
||||||
qt5_add_dbus_interface(dolphin_dbus_SRCS panels/terminal/org.kde.KIOFuse.VFS.xml kiofuse_interface)
|
qt_add_dbus_interface(dolphin_dbus_SRCS panels/terminal/org.kde.KIOFuse.VFS.xml kiofuse_interface)
|
||||||
|
|
||||||
target_sources(dolphinstatic PRIVATE
|
target_sources(dolphinstatic PRIVATE
|
||||||
${dolphin_dbus_SRCS}
|
${dolphin_dbus_SRCS}
|
||||||
|
@ -415,9 +415,9 @@ if(NOT WIN32)
|
||||||
target_link_libraries(kcm_dolphingeneral dolphinprivate)
|
target_link_libraries(kcm_dolphingeneral dolphinprivate)
|
||||||
|
|
||||||
install( FILES org.kde.dolphin.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
|
install( FILES org.kde.dolphin.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )
|
||||||
install( FILES settings/kcm/kcmdolphinviewmodes.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
|
install( FILES settings/kcm/kcmdolphinviewmodes.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR} )
|
||||||
install( FILES settings/kcm/kcmdolphinnavigation.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
|
install( FILES settings/kcm/kcmdolphinnavigation.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR} )
|
||||||
install( FILES settings/kcm/kcmdolphingeneral.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
|
install( FILES settings/kcm/kcmdolphingeneral.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR} )
|
||||||
|
|
||||||
install(TARGETS kcm_dolphinviewmodes DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
|
install(TARGETS kcm_dolphinviewmodes DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
|
||||||
install(TARGETS kcm_dolphinnavigation DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
|
install(TARGETS kcm_dolphinnavigation DESTINATION ${KDE_INSTALL_PLUGINDIR}/dolphin/kcms )
|
||||||
|
@ -449,6 +449,5 @@ install( FILES settings/dolphin_directoryviewpropertysettings.kcfg
|
||||||
DESTINATION ${KDE_INSTALL_KCFGDIR} )
|
DESTINATION ${KDE_INSTALL_KCFGDIR} )
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
|
|
||||||
add_subdirectory(tests)
|
add_subdirectory(tests)
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -3,8 +3,8 @@ add_definitions(-DTRANSLATION_DOMAIN=\"dolphin_servicemenuinstaller\")
|
||||||
|
|
||||||
add_executable(servicemenuinstaller servicemenuinstaller.cpp)
|
add_executable(servicemenuinstaller servicemenuinstaller.cpp)
|
||||||
target_link_libraries(servicemenuinstaller PRIVATE
|
target_link_libraries(servicemenuinstaller PRIVATE
|
||||||
Qt5::Core
|
Qt${QT_MAJOR_VERSION}::Core
|
||||||
Qt5::Gui
|
Qt${QT_MAJOR_VERSION}::Gui
|
||||||
KF5::I18n
|
KF5::I18n
|
||||||
KF5::CoreAddons
|
KF5::CoreAddons
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,68 +1,68 @@
|
||||||
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
|
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
|
||||||
|
|
||||||
find_package(Qt5Test CONFIG REQUIRED)
|
find_package(Qt${QT_MAJOR_VERSION}Test CONFIG REQUIRED)
|
||||||
include(ECMAddTests)
|
include(ECMAddTests)
|
||||||
|
|
||||||
include(FindGem) # For servicemenutest, see bottom of this file
|
include(FindGem) # For servicemenutest, see bottom of this file
|
||||||
|
|
||||||
# KItemSetTest
|
# KItemSetTest
|
||||||
ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
|
ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# KItemRangeTest
|
# KItemRangeTest
|
||||||
ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
|
ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
|
|
||||||
# KItemListSelectionManagerTest
|
# KItemListSelectionManagerTest
|
||||||
ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
|
ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# KItemListControllerTest
|
# KItemListControllerTest
|
||||||
ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp
|
ecm_add_test(kitemlistcontrollertest.cpp testdir.cpp
|
||||||
TEST_NAME kitemlistcontrollertest
|
TEST_NAME kitemlistcontrollertest
|
||||||
LINK_LIBRARIES dolphinprivate Qt5::Test)
|
LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# KFileItemListViewTest
|
# KFileItemListViewTest
|
||||||
ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp
|
ecm_add_test(kfileitemlistviewtest.cpp testdir.cpp
|
||||||
TEST_NAME kfileitemlistviewtest
|
TEST_NAME kfileitemlistviewtest
|
||||||
LINK_LIBRARIES dolphinprivate Qt5::Test)
|
LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# KFileItemModelTest
|
# KFileItemModelTest
|
||||||
ecm_add_test(kfileitemmodeltest.cpp testdir.cpp
|
ecm_add_test(kfileitemmodeltest.cpp testdir.cpp
|
||||||
TEST_NAME kfileitemmodeltest
|
TEST_NAME kfileitemmodeltest
|
||||||
LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
|
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# KFileItemModelBenchmark, not run automatically with `ctest` or `make test`
|
# KFileItemModelBenchmark, not run automatically with `ctest` or `make test`
|
||||||
add_executable(kfileitemmodelbenchmark kfileitemmodelbenchmark.cpp testdir.cpp)
|
add_executable(kfileitemmodelbenchmark kfileitemmodelbenchmark.cpp testdir.cpp)
|
||||||
target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt5::Test)
|
target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# KItemListKeyboardSearchManagerTest
|
# KItemListKeyboardSearchManagerTest
|
||||||
ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
|
ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# DolphinSearchBox
|
# DolphinSearchBox
|
||||||
if (KF5Baloo_FOUND)
|
if (KF5Baloo_FOUND)
|
||||||
ecm_add_test(dolphinsearchboxtest.cpp
|
ecm_add_test(dolphinsearchboxtest.cpp
|
||||||
TEST_NAME dolphinsearchboxtest
|
TEST_NAME dolphinsearchboxtest
|
||||||
LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
|
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# DolphinQuery
|
# DolphinQuery
|
||||||
if (KF5Baloo_FOUND)
|
if (KF5Baloo_FOUND)
|
||||||
ecm_add_test(dolphinquerytest.cpp
|
ecm_add_test(dolphinquerytest.cpp
|
||||||
TEST_NAME dolphinquerytest
|
TEST_NAME dolphinquerytest
|
||||||
LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
|
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# ViewPropertiesTest
|
# ViewPropertiesTest
|
||||||
ecm_add_test(viewpropertiestest.cpp testdir.cpp
|
ecm_add_test(viewpropertiestest.cpp testdir.cpp
|
||||||
TEST_NAME viewpropertiestest
|
TEST_NAME viewpropertiestest
|
||||||
LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
|
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# DolphinMainWindowTest
|
# DolphinMainWindowTest
|
||||||
ecm_add_test(dolphinmainwindowtest.cpp ${CMAKE_SOURCE_DIR}/src/dolphin.qrc
|
ecm_add_test(dolphinmainwindowtest.cpp ${CMAKE_SOURCE_DIR}/src/dolphin.qrc
|
||||||
TEST_NAME dolphinmainwindowtest
|
TEST_NAME dolphinmainwindowtest
|
||||||
LINK_LIBRARIES dolphinprivate dolphinstatic Qt5::Test)
|
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
# DragAndDropHelperTest
|
# DragAndDropHelperTest
|
||||||
ecm_add_test(draganddrophelpertest.cpp LINK_LIBRARIES dolphinprivate Qt5::Test)
|
ecm_add_test(draganddrophelpertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test)
|
||||||
|
|
||||||
find_gem(test-unit)
|
find_gem(test-unit)
|
||||||
set_package_properties(Gem:test-unit PROPERTIES
|
set_package_properties(Gem:test-unit PROPERTIES
|
||||||
|
|
Loading…
Reference in a new issue