Commit 7f921f1c authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Adapt build system for building against qt6

parent 081d0d86
......@@ -11,7 +11,7 @@ project(gwenview VERSION ${RELEASE_SERVICE_VERSION})
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )
set (QT_MIN_VERSION "5.15.0")
set (KF5_MIN_VERSION "5.84.0")
set (KF5_MIN_VERSION "5.90.0")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
......@@ -53,11 +53,15 @@ else()
set(GWENVIEW_SEMANTICINFO_BACKEND_BALOO ON)
endif()
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Concurrent Svg PrintSupport)
find_package(Qt5DBus ${QT_MIN_VERSION} CONFIG QUIET)
set(HAVE_QTDBUS ${Qt5DBus_FOUND})
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Concurrent Svg PrintSupport)
find_package(Qt${QT_MAJOR_VERSION}DBus ${QT_MIN_VERSION} CONFIG QUIET)
if (QT_MAJOR_VERSION STREQUAL "6")
find_package(Qt6SvgWidgets)
endif()
set(HAVE_QTDBUS ${Qt${QT_MAJOR_VERSION}DBus_FOUND})
find_package(Phonon4Qt5 4.6.60 NO_MODULE REQUIRED)
find_package(Phonon4Qt${QT_MAJOR_VERSION} 4.6.60 NO_MODULE REQUIRED)
include_directories(BEFORE SYSTEM ${PHONON_INCLUDES})
add_definitions(-DPHONON_LIB_SONAME=\"${PHONON_LIB_SONAME}\")
......
......@@ -83,7 +83,7 @@ if (KF5Purpose_FOUND)
target_link_libraries(gwenview KF5::PurposeWidgets)
endif()
target_link_libraries(gwenview LINK_INTERFACE_LIBRARIES KF5::KIOCore Qt5::Core)
target_link_libraries(gwenview LINK_INTERFACE_LIBRARIES KF5::KIOCore Qt::Core)
if (HAVE_TIFF)
target_link_libraries(gwenview TIFF::TIFF)
......
......@@ -42,7 +42,7 @@ target_link_libraries(gwenview_importer
KF5::KIOCore
KF5::ItemModels
KF5::WidgetsAddons
Qt5::Core
Qt::Core
)
target_link_libraries(gwenview_importer
......@@ -50,7 +50,7 @@ target_link_libraries(gwenview_importer
KF5::KIOCore
KF5::ItemModels
KF5::WidgetsAddons
Qt5::Core
Qt::Core
)
install(TARGETS gwenview_importer
......
......@@ -168,7 +168,7 @@ if(HAVE_QTDBUS)
mpris2/mprismediaplayer2.cpp
mpris2/mprismediaplayer2player.cpp
)
qt5_add_dbus_interface(gwenviewlib_SRCS mpris2/org.freedesktop.ScreenSaver.xml screensaverdbusinterface)
qt_add_dbus_interface(gwenviewlib_SRCS mpris2/org.freedesktop.ScreenSaver.xml screensaverdbusinterface)
endif()
if(HAVE_FITS)
......@@ -236,9 +236,9 @@ if (WIN32)
endif()
target_link_libraries(gwenviewlib
Qt5::Concurrent
Qt5::Svg
Qt5::PrintSupport
Qt::Concurrent
Qt::Svg
Qt::PrintSupport
KF5::GuiAddons
KF5::KIOCore
KF5::KIOWidgets
......@@ -254,7 +254,7 @@ target_link_libraries(gwenviewlib
)
if(HAVE_QTDBUS)
target_link_libraries(gwenviewlib Qt5::DBus)
target_link_libraries(gwenviewlib Qt::DBus)
endif()
if(HAVE_FITS)
target_link_libraries(gwenviewlib ${CFITSIO_LIBRARIES})
......@@ -269,7 +269,11 @@ if (KF5KDcraw_FOUND)
endif()
if (HAVE_X11)
target_link_libraries(gwenviewlib Qt5::X11Extras X11::X11)
target_link_libraries(gwenviewlib Qt::X11Extras X11::X11)
endif()
if (QT_MAJOR_VERSION STREQUAL "6")
target_link_libraries(gwenviewlib Qt6::SvgWidgets)
endif()
if (GWENVIEW_SEMANTICINFO_BACKEND_BALOO)
......
......@@ -18,4 +18,4 @@ configure_file(gvpart.desktop.cmake ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop)
kcoreaddons_desktop_to_json(gvpart ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop)
install(TARGETS gvpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/parts)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/gvpart.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
find_package(Qt5Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
find_package(Qt${QT_MAJOR_VERSION}Test ${REQUIRED_QT_VERSION} CONFIG QUIET)
if(NOT Qt5Test_FOUND)
message(STATUS "Qt5Test not found, tests will not be built.")
if(NOT Qt${QT_MAJOR_VERSION}Test_FOUND)
message(STATUS "Qt${QT_MAJOR_VERSION}Test not found, tests will not be built.")
return()
endif()
......
......@@ -4,7 +4,7 @@ macro(gv_add_unit_test _test)
ecm_add_test(
${_test}.cpp ${ARGN}
TEST_NAME ${_test}
LINK_LIBRARIES Qt5::Test gwenviewlib
LINK_LIBRARIES Qt::Test gwenviewlib
)
add_dependencies(buildtests ${_test})
endmacro(gv_add_unit_test)
......
......@@ -12,7 +12,7 @@ add_dependencies(buildtests slidecontainertest)
ecm_mark_as_test(slidecontainertest)
target_link_libraries(slidecontainertest
Qt5::Test
Qt::Test
gwenviewlib)
# imageloadbench
......@@ -25,7 +25,7 @@ add_dependencies(buildtests imageloadbench)
ecm_mark_as_test(imageloadbench)
target_link_libraries(imageloadbench
Qt5::Test
Qt::Test
gwenviewlib)
# thumbnailgen
......@@ -39,5 +39,5 @@ add_dependencies(buildtests thumbnailgen)
ecm_mark_as_test(thumbnailgen)
target_link_libraries(thumbnailgen
Qt5::Test
Qt::Test
gwenviewlib)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment