1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

Master is qt6 only. Not necessary to use ${QT_MAJOR_VERSION} now.

Remove qt5 specific cmake code too
This commit is contained in:
Laurent Montel 2023-11-08 07:23:16 +01:00 committed by Méven Car
parent 3fde6cbeb0
commit 1cf56b2303
4 changed files with 31 additions and 39 deletions

View File

@ -37,14 +37,14 @@ ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHIN
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINVCS ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINVCS
VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h" VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/dolphinvcs_version.h"
PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/DolphinVcsConfigVersion.cmake"
SOVERSION ${QT_MAJOR_VERSION} SOVERSION 6
) )
ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE ecm_setup_version(${RELEASE_SERVICE_VERSION} VARIABLE_PREFIX DOLPHINPRIVATE
SOVERSION ${QT_MAJOR_VERSION} SOVERSION 6
) )
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS find_package(Qt6 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Core Core
Concurrent Concurrent
Widgets Widgets
@ -54,10 +54,6 @@ find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
if (UNIX AND NOT APPLE) if (UNIX AND NOT APPLE)
set(HAVE_X11 TRUE) set(HAVE_X11 TRUE)
if (QT_MAJOR_VERSION STREQUAL "5")
find_package(Qt5X11Extras REQUIRED)
endif()
endif() endif()
find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS find_package(KF6 ${KF6_MIN_VERSION} REQUIRED COMPONENTS
@ -102,15 +98,15 @@ set_package_properties(KF6Activities 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(Phonon4Qt${QT_MAJOR_VERSION} CONFIG REQUIRED) find_package(Phonon4Qt6 CONFIG REQUIRED)
find_package(PackageKitQt${QT_MAJOR_VERSION}) find_package(PackageKitQt6)
set_package_properties(PackageKitQt${QT_MAJOR_VERSION} set_package_properties(PackageKitQt6
PROPERTIES DESCRIPTION "Software Manager integration" PROPERTIES DESCRIPTION "Software Manager integration"
TYPE OPTIONAL TYPE OPTIONAL
PURPOSE "Used in the service menu installer" PURPOSE "Used in the service menu installer"
) )
if(PackageKitQt${QT_MAJOR_VERSION}_FOUND) if(PackageKitQt6_FOUND)
set(HAVE_PACKAGEKIT TRUE) set(HAVE_PACKAGEKIT TRUE)
endif() endif()

View File

@ -23,7 +23,7 @@ generate_export_header(dolphinvcs BASE_NAME dolphinvcs)
target_link_libraries( target_link_libraries(
dolphinvcs PUBLIC dolphinvcs PUBLIC
Qt${QT_MAJOR_VERSION}::Widgets Qt6::Widgets
) )
set_target_properties(dolphinvcs PROPERTIES set_target_properties(dolphinvcs PROPERTIES
@ -195,8 +195,8 @@ generate_export_header(dolphinprivate BASE_NAME dolphin)
target_link_libraries( target_link_libraries(
dolphinprivate PUBLIC dolphinprivate PUBLIC
dolphinvcs dolphinvcs
Qt${QT_MAJOR_VERSION}::Concurrent Qt6::Concurrent
Qt${QT_MAJOR_VERSION}::Gui Qt6::Gui
KF6::I18n KF6::I18n
KF6::IconThemes KF6::IconThemes
KF6::KIOCore KF6::KIOCore
@ -254,7 +254,7 @@ target_link_libraries(dolphinpart
dolphinprivate dolphinprivate
) )
install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf${QT_MAJOR_VERSION}/parts) install(TARGETS dolphinpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts)
install(FILES dolphinpartactions.desktop DESTINATION "${KDE_INSTALL_DATADIR}/dolphin/") install(FILES dolphinpartactions.desktop DESTINATION "${KDE_INSTALL_DATADIR}/dolphin/")
########################################## ##########################################
@ -435,7 +435,7 @@ target_link_libraries(dolphinstatic
KF6::DBusAddons KF6::DBusAddons
KF6::Notifications KF6::Notifications
KF6::BookmarksWidgets KF6::BookmarksWidgets
Phonon::phonon4qt${QT_MAJOR_VERSION} Phonon::phonon4qt6
) )
if (HAVE_KACTIVITIES) if (HAVE_KACTIVITIES)
@ -477,11 +477,7 @@ target_link_libraries(dolphin
) )
if (HAVE_X11) if (HAVE_X11)
if (QT_MAJOR_VERSION STREQUAL "5") target_link_libraries(dolphin PRIVATE Qt::GuiPrivate)
target_link_libraries(dolphin PRIVATE Qt{QT_MAJOR_VERSION}::X11Extras)
else()
target_link_libraries(dolphin PRIVATE Qt::GuiPrivate)
endif()
endif() endif()
include(DbusInterfaceMacros) include(DbusInterfaceMacros)

View File

@ -3,13 +3,13 @@ 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
Qt${QT_MAJOR_VERSION}::Core Qt6::Core
Qt${QT_MAJOR_VERSION}::Gui Qt6::Gui
KF6::I18n KF6::I18n
KF6::CoreAddons KF6::CoreAddons
) )
if(HAVE_PACKAGEKIT) if(HAVE_PACKAGEKIT)
target_link_libraries(servicemenuinstaller PRIVATE PK::packagekitqt${QT_MAJOR_VERSION}) target_link_libraries(servicemenuinstaller PRIVATE PK::packagekitqt6)
endif() endif()
install(TARGETS servicemenuinstaller ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS servicemenuinstaller ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})

View File

@ -1,73 +1,73 @@
set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} ) set( EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR} )
find_package(Qt${QT_MAJOR_VERSION}Test CONFIG REQUIRED) find_package(Qt6Test 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 Qt${QT_MAJOR_VERSION}::Test) ecm_add_test(kitemsettest.cpp LINK_LIBRARIES dolphinprivate Qt6::Test)
# KItemRangeTest # KItemRangeTest
ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test) ecm_add_test(kitemrangetest.cpp LINK_LIBRARIES dolphinprivate Qt6::Test)
# KItemListSelectionManagerTest # KItemListSelectionManagerTest
ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test) ecm_add_test(kitemlistselectionmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt6::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 Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate Qt6::Test)
# KItemListControllerExpandTest # KItemListControllerExpandTest
ecm_add_test(kitemlistcontrollerexpandtest.cpp testdir.cpp ecm_add_test(kitemlistcontrollerexpandtest.cpp testdir.cpp
TEST_NAME kitemlistcontrollerexpandtest TEST_NAME kitemlistcontrollerexpandtest
LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate Qt6::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 Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate Qt6::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 Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt6::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 Qt${QT_MAJOR_VERSION}::Test) target_link_libraries(kfileitemmodelbenchmark dolphinprivate Qt6::Test)
# KItemListKeyboardSearchManagerTest # KItemListKeyboardSearchManagerTest
ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test) ecm_add_test(kitemlistkeyboardsearchmanagertest.cpp LINK_LIBRARIES dolphinprivate Qt6::Test)
# DolphinSearchBox # DolphinSearchBox
if (KF6Baloo_FOUND) if (KF6Baloo_FOUND)
ecm_add_test(dolphinsearchboxtest.cpp ecm_add_test(dolphinsearchboxtest.cpp
TEST_NAME dolphinsearchboxtest TEST_NAME dolphinsearchboxtest
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt6::Test)
endif() endif()
# DolphinQuery # DolphinQuery
if (KF6Baloo_FOUND) if (KF6Baloo_FOUND)
ecm_add_test(dolphinquerytest.cpp ecm_add_test(dolphinquerytest.cpp
TEST_NAME dolphinquerytest TEST_NAME dolphinquerytest
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt6::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 Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt6::Test)
# DolphinMainWindowTest # DolphinMainWindowTest
ecm_add_test(dolphinmainwindowtest.cpp testdir.cpp ${CMAKE_SOURCE_DIR}/src/dolphin.qrc ecm_add_test(dolphinmainwindowtest.cpp testdir.cpp ${CMAKE_SOURCE_DIR}/src/dolphin.qrc
TEST_NAME dolphinmainwindowtest TEST_NAME dolphinmainwindowtest
LINK_LIBRARIES dolphinprivate dolphinstatic Qt${QT_MAJOR_VERSION}::Test) LINK_LIBRARIES dolphinprivate dolphinstatic Qt6::Test)
# DragAndDropHelperTest # DragAndDropHelperTest
ecm_add_test(draganddrophelpertest.cpp LINK_LIBRARIES dolphinprivate Qt${QT_MAJOR_VERSION}::Test) ecm_add_test(draganddrophelpertest.cpp LINK_LIBRARIES dolphinprivate Qt6::Test)
find_gem(test-unit) find_gem(test-unit)
set_package_properties(Gem:test-unit PROPERTIES set_package_properties(Gem:test-unit PROPERTIES