Commit 002848ef authored by Volker Krause's avatar Volker Krause
Browse files

Adapt build system to also support Qt 6

This is complicated by the Qt 5.6 requirement of SailfishOS, hopefully
that didn't get broken by this.
parent aa843266
Pipeline #257489 passed with stage
in 8 minutes and 20 seconds
......@@ -62,8 +62,8 @@ if (SAILFISHOS)
add_definitions(-DSAILFISHOS)
else()
find_package(Qca-qt5 ${QCA_MIN_VERSION} REQUIRED)
set(Qca_LIBRARY qca-qt5)
find_package(Qca-qt${QT_MAJOR_VERSION} ${QCA_MIN_VERSION} REQUIRED)
set(Qca_LIBRARY qca-qt${QT_MAJOR_VERSION})
set(KF5_REQUIRED_COMPONENTS I18n ConfigWidgets DBusAddons IconThemes Notifications KIO KCMUtils Service Solid Kirigami2 People WindowSystem GuiAddons)
set(KF5_OPTIONAL_COMPONENTS DocTools Wayland)
......@@ -78,9 +78,11 @@ else()
if(UNIX AND NOT APPLE)
find_package(KF5Package REQUIRED)
find_package(KF5PulseAudioQt)
find_package(QtWaylandScanner REQUIRED)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(QtWaylandScanner REQUIRED)
endif()
find_package(Wayland 1.9 REQUIRED Client)
find_package(Qt5 REQUIRED COMPONENTS WaylandClient)
find_package(Qt${QT_MAJOR_VERSION} REQUIRED COMPONENTS WaylandClient)
find_package(PlasmaWaylandProtocols REQUIRED)
endif()
......@@ -100,8 +102,8 @@ endif()
add_definitions(-DQT_NO_URL_CAST_FROM_STRING -DQT_NO_KEYWORDS -DQT_NO_CAST_FROM_ASCII)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
if (UNIX AND NOT APPLE)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} REQUIRED COMPONENTS DBus Quick QuickControls2 Network Multimedia)
if (UNIX AND NOT APPLE AND QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS ${KF5_REQUIRED_COMPONENTS})
......
......@@ -22,7 +22,7 @@ add_executable(kdeconnect-app
${kdeconnect_SRCS}
${kdeconnect_custom_icons_SRCS}
)
target_link_libraries(kdeconnect-app Qt5::Quick Qt5::QuickControls2 Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::KCMUtils)
target_link_libraries(kdeconnect-app Qt::Quick Qt::QuickControls2 Qt::Widgets KF5::CoreAddons KF5::I18n KF5::KCMUtils)
install(TARGETS kdeconnect-app ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(PROGRAMS org.kde.kdeconnect.app.desktop DESTINATION ${KDE_INSTALL_APPDIR})
......@@ -57,11 +57,11 @@ target_include_directories(kdeconnectcore PUBLIC ${PROJECT_SOURCE_DIR})
target_link_libraries(kdeconnectcore
PUBLIC
Qt5::Network
Qt${QT_MAJOR_VERSION}::Network
KF5::CoreAddons
${Qca_LIBRARY}
PRIVATE
Qt5::DBus
Qt${QT_MAJOR_VERSION}::DBus
KF5::I18n
KF5::ConfigCore
)
......
......@@ -17,7 +17,7 @@ target_link_libraries(kdeconnectd
KF5::Notifications
KF5::I18n
KF5::WindowSystem
Qt5::Widgets)
Qt::Widgets)
ecm_mark_nongui_executable(kdeconnectd)
......
......@@ -43,7 +43,7 @@ add_executable(kdeconnect-indicator ${indicator_SRCS} ${debug_file_SRCS})
target_include_directories(kdeconnect-indicator PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/systray_actions)
target_link_libraries(kdeconnect-indicator Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::DBusAddons KF5::KCMUtils kdeconnectinterfaces kdeconnectcore kdeconnectversion)
target_link_libraries(kdeconnect-indicator Qt::Widgets KF5::CoreAddons KF5::I18n KF5::Notifications KF5::DBusAddons KF5::KCMUtils kdeconnectinterfaces kdeconnectcore kdeconnectversion)
if (WIN32)
add_compile_definitions(QSYSTRAY)
......
......@@ -2,11 +2,11 @@ add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-interfaces\")
function(geninterface source_h output_h)
set(xml_file ${CMAKE_CURRENT_BINARY_DIR}/${output_h}.xml)
qt5_generate_dbus_interface( ${source_h} ${xml_file})
qt_generate_dbus_interface( ${source_h} ${xml_file})
set_source_files_properties(${xml_file} PROPERTIES NO_NAMESPACE true)
qt5_add_dbus_interface(libkdeconnect_SRC ${xml_file} ${output_h})
qt_add_dbus_interface(libkdeconnect_SRC ${xml_file} ${output_h})
set(libkdeconnect_SRC ${libkdeconnect_SRC} PARENT_SCOPE)
endfunction()
......@@ -69,8 +69,8 @@ generate_export_header(kdeconnectinterfaces EXPORT_FILE_NAME ${CMAKE_CURRENT_BIN
target_link_libraries(kdeconnectinterfaces
LINK_PUBLIC
Qt5::Gui
Qt5::DBus
Qt${QT_MAJOR_VERSION}::Gui
Qt${QT_MAJOR_VERSION}::DBus
KF5::ConfigCore
LINK_PRIVATE
kdeconnectcore
......
......@@ -7,8 +7,8 @@ ki18n_wrap_ui(kcm_kdeconnect kcm.ui)
kcoreaddons_desktop_to_json(kcm_kdeconnect "kcm_kdeconnect.desktop")
target_link_libraries(kcm_kdeconnect
Qt5::Core
Qt5::Gui
Qt::Core
Qt::Gui
KF5::I18n
KF5::KCMUtils
kdeconnectinterfaces
......@@ -16,4 +16,4 @@ target_link_libraries(kcm_kdeconnect
)
install(TARGETS kcm_kdeconnect DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES kcm_kdeconnect.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
install(FILES kcm_kdeconnect.desktop DESTINATION ${KDE_INSTALL_KSERVICESDIR})
......@@ -5,8 +5,8 @@ target_link_libraries(kdeconnectpluginkcm
PUBLIC
kdeconnectcore
PRIVATE
Qt5::DBus
Qt5::Gui
Qt::DBus
Qt::Gui
KF5::I18n
KF5::ConfigCore
KF5::KCMUtils
......
......@@ -16,8 +16,8 @@ add_library(kio_kdeconnect MODULE ${kio_kdeconnect_PART_SRCS})
target_link_libraries(kio_kdeconnect
kdeconnectinterfaces
Qt5::Core
Qt5::Network
Qt::Core
Qt::Network
KF5::KIOCore
KF5::I18n
)
......
kpackage_install_package(package org.kde.kdeconnect plasmoids plasma NO_DEPRECATED_WARNING)
install(FILES package/metadata.desktop
DESTINATION ${KDE_INSTALL_KSERVICES5DIR}
DESTINATION ${KDE_INSTALL_KSERVICESDIR}
RENAME plasma-kdeconnect.desktop)
......@@ -62,4 +62,4 @@ endif()
# If we split notifications per plugin, in several notifyrc files, they won't
# appear in the same group in the Notifications KCM
install(FILES kdeconnect.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR})
install(FILES kdeconnect.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR})
......@@ -14,7 +14,7 @@ kdeconnect_add_plugin(kdeconnect_battery SOURCES ${kdeconnect_battery_SRCS})
target_link_libraries(kdeconnect_battery
kdeconnectcore
Qt5::DBus
Qt${QT_MAJOR_VERSION}::DBus
KF5::Solid
KF5::I18n
)
......@@ -4,4 +4,4 @@ set(kdeconnect_bigscreen_SRCS
kdeconnect_add_plugin(kdeconnect_bigscreen SOURCES ${kdeconnect_bigscreen_SRCS})
target_link_libraries(kdeconnect_bigscreen kdeconnectcore Qt5::DBus KF5::I18n)
target_link_libraries(kdeconnect_bigscreen kdeconnectcore Qt${QT_MAJOR_VERSION}::DBus KF5::I18n)
......@@ -14,7 +14,7 @@ kdeconnect_add_plugin(kdeconnect_connectivity_report SOURCES ${kdeconnect_connec
target_link_libraries(kdeconnect_connectivity_report
kdeconnectcore
Qt5::DBus
Qt${QT_MAJOR_VERSION}::DBus
KF5::Solid
KF5::I18n
)
......@@ -14,5 +14,5 @@ kdeconnect_add_plugin(kdeconnect_contacts SOURCES ${kdeconnect_contacts_SRCS})
target_link_libraries(kdeconnect_contacts
kdeconnectcore
Qt5::DBus
Qt::DBus
)
......@@ -4,6 +4,6 @@ set(kdeconnect_findmyphone_SRCS
kdeconnect_add_plugin(kdeconnect_findmyphone SOURCES ${kdeconnect_findmyphone_SRCS})
target_link_libraries(kdeconnect_findmyphone kdeconnectcore Qt5::Core Qt5::DBus)
target_link_libraries(kdeconnect_findmyphone kdeconnectcore Qt::Core Qt::DBus)
......@@ -15,9 +15,9 @@ kdeconnect_add_plugin(kdeconnect_findthisdevice
target_link_libraries(kdeconnect_findthisdevice
kdeconnectcore
Qt5::Core
Qt5::Multimedia
Qt5::DBus
Qt::Core
Qt::Multimedia
Qt::DBus
)
if (NOT WIN32)
......@@ -32,7 +32,7 @@ ki18n_wrap_ui(kdeconnect_findthisdevice_config findthisdevice_config.ui)
target_sources(kdeconnect_findthisdevice_config PRIVATE findthisdevice_config.cpp ${debug_file_SRCS})
target_link_libraries(kdeconnect_findthisdevice_config
kdeconnectpluginkcm
Qt5::Multimedia
Qt::Multimedia
KF5::I18n
KF5::CoreAddons
KF5::ConfigWidgets
......
qt5_add_dbus_interface(lockdevice_SRCS org.freedesktop.login1.xml login1dbusinterface)
qt5_add_dbus_interface(lockdevice_SRCS org.freedesktop.DBus.Properties.xml propertiesdbusinterface)
qt_add_dbus_interface(lockdevice_SRCS org.freedesktop.login1.xml login1dbusinterface)
qt_add_dbus_interface(lockdevice_SRCS org.freedesktop.DBus.Properties.xml propertiesdbusinterface)
set(debug_file_SRCS)
ecm_qt_declare_logging_category(
......@@ -18,6 +18,6 @@ kdeconnect_add_plugin(kdeconnect_lockdevice SOURCES ${lockdevice_SRCS} ${debug_f
target_link_libraries(kdeconnect_lockdevice
kdeconnectcore
Qt5::DBus
Qt::DBus
KF5::I18n
)
......@@ -9,18 +9,25 @@ if(UNIX AND NOT APPLE)
PURPOSE "Needed for the remote mousepad plugin"
)
ecm_add_qtwayland_client_protocol(wayland_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/fake-input.xml
BASENAME fake-input
)
if (QT_MAJOR_VERSION EQUAL "5")
ecm_add_qtwayland_client_protocol(wayland_SRCS
PROTOCOL ${PLASMA_WAYLAND_PROTOCOLS_DIR}/fake-input.xml
BASENAME fake-input
)
else()
qt6_generate_wayland_protocol_client_sources(kdeconnect_mousepad FILES
${PLASMA_WAYLAND_PROTOCOLS_DIR}/fake-input.xml)
endif()
target_sources(kdeconnect_mousepad PRIVATE ${wayland_SRCS})
target_link_libraries(kdeconnect_mousepad Wayland::Client Qt5::WaylandClient)
target_link_libraries(kdeconnect_mousepad Wayland::Client Qt::WaylandClient)
target_sources(kdeconnect_mousepad PUBLIC waylandremoteinput.cpp)
set(HAVE_WAYLAND TRUE)
if (LibFakeKey_FOUND)
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5 ${QT_MIN_VERSION} REQUIRED COMPONENTS X11Extras)
endif()
find_package(XTest REQUIRED)
find_package(X11 REQUIRED)
target_include_directories(kdeconnect_mousepad PRIVATE ${XTEST_INCLUDE_DIRS} ${X11_INCLUDE_DIR} ${LibFakeKey_INCLUDE_DIRS})
......@@ -32,7 +39,7 @@ set(HAVE_X11 ${LibFakeKey_FOUND})
set(HAVE_MACOS ${APPLE})
configure_file(config-mousepad.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-mousepad.h )
target_link_libraries(kdeconnect_mousepad kdeconnectcore Qt5::Gui KF5::I18n)
target_link_libraries(kdeconnect_mousepad kdeconnectcore Qt::Gui KF5::I18n)
if (HAVE_WINDOWS)
target_sources(kdeconnect_mousepad PUBLIC windowsremoteinput.cpp)
......@@ -40,7 +47,10 @@ endif()
if(HAVE_X11)
target_sources(kdeconnect_mousepad PUBLIC x11remoteinput.cpp)
target_link_libraries(kdeconnect_mousepad Qt5::X11Extras ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES})
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(kdeconnect_mousepad Qt5::X11Extras)
endif()
target_link_libraries(kdeconnect_mousepad ${X11_LIBRARIES} ${XTEST_LIBRARIES} ${LibFakeKey_LIBRARIES})
endif()
if (HAVE_MACOS)
......
......@@ -14,9 +14,9 @@ set_source_files_properties(
PROPERTIES
NO_NAMESPACE ON)
qt5_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.freedesktop.DBus.Properties.xml dbusproperties)
qt5_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.mpris.MediaPlayer2.Player.xml mprisplayer)
qt5_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.mpris.MediaPlayer2.xml mprisroot)
qt_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.freedesktop.DBus.Properties.xml dbusproperties)
qt_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.mpris.MediaPlayer2.Player.xml mprisplayer)
qt_add_dbus_interface(kdeconnect_mpriscontrol_SRCS org.mpris.MediaPlayer2.xml mprisroot)
endif()
......@@ -33,5 +33,5 @@ if(WIN32)
target_link_libraries(kdeconnect_mpriscontrol kdeconnectcore windowsapp)
target_compile_features(kdeconnect_mpriscontrol PUBLIC cxx_std_17)
else()
target_link_libraries(kdeconnect_mpriscontrol Qt5::DBus kdeconnectcore)
target_link_libraries(kdeconnect_mpriscontrol Qt::DBus kdeconnectcore)
endif()
Supports Markdown
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