Commit d6c232f1 authored by Volker Krause's avatar Volker Krause
Browse files

Initial build system changes to allow compilation against Qt6

With commenting out the three remaining KDELibs4Support references this is
good enough to pass CMake, which helps with identifying possible issues in
here.
parent 744a872d
Pipeline #155685 passed with stage
in 4 minutes and 16 seconds
......@@ -6,7 +6,7 @@ set(PROJECT_VERSION "5.24.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.15.0")
set(KF5_MIN_VERSION "5.89")
set(KF5_MIN_VERSION "5.90")
set(KDE_COMPILERSETTINGS_LEVEL "5.82")
set(ACCOUNTSQT_DEP_VERSION "1.13")
......@@ -31,15 +31,17 @@ include(CheckIncludeFiles)
include(KDEClangFormat)
include(KDEGitCommitHooks)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS
Quick
QuickWidgets
DBus
Widgets
X11Extras
Svg
Concurrent
)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras)
endif()
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
Auth
......@@ -70,11 +72,11 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
KDELibs4Support # kcms/dateandtime
)
find_package(AccountsQt5 ${ACCOUNTSQT_DEP_VERSION} CONFIG)
find_package(AccountsQt${QT_MAJOR_VERSION} ${ACCOUNTSQT_DEP_VERSION} CONFIG)
find_package(KUserFeedback)
set_package_properties(AccountsQt5 PROPERTIES
set_package_properties(AccountsQt${QT_MAJOR_VERSION} PROPERTIES
DESCRIPTION "Accounts management library for Qt applications"
URL "https://gitlab.com/accounts-sso/libaccounts-qt"
PURPOSE "Required for building the OpenDesktop integration plugin"
......@@ -91,7 +93,7 @@ set_package_properties(KAccounts PROPERTIES
find_package(PkgConfig REQUIRED)
pkg_check_modules(SignOnOAuth2 IMPORTED_TARGET signon-oauth2plugin)
set_package_properties(signon-oauth2plugin PROPERTIES
DESCRIPTION "Plugin for SignOnQt5 which handles OAuth and OAuth2 logins"
DESCRIPTION "Plugin for SignOnQt${QT_MAJOR_VERSION} which handles OAuth and OAuth2 logins"
URL "https://gitlab.com/accounts-sso/signon-plugin-oauth2"
PURPOSE "Required for running the OpenDesktop integration plugin"
TYPE RUNTIME
......@@ -185,14 +187,14 @@ endif()
include(ConfigureChecks.cmake)
find_package(PackageKitQt5)
set_package_properties(PackageKitQt5 PROPERTIES
find_package(PackageKitQt${QT_MAJOR_VERSION})
set_package_properties(PackageKitQt${QT_MAJOR_VERSION} PROPERTIES
DESCRIPTION "Software Manager integration"
PURPOSE "Used in the KRunner plugin installer"
TYPE OPTIONAL
)
if(PackageKitQt5_FOUND)
if(PackageKitQt${QT_MAJOR_VERSION}_FOUND)
set(HAVE_PACKAGEKIT TRUE)
endif()
......@@ -229,7 +231,7 @@ add_subdirectory(toolboxes)
add_subdirectory(applets)
add_subdirectory(kcms)
add_subdirectory(knetattach)
if(KAccounts_FOUND AND AccountsQt5_FOUND)
if(KAccounts_FOUND AND AccountsQt${QT_MAJOR_VERSION}_FOUND)
add_subdirectory(attica-kde)
endif()
add_subdirectory(imports/activitymanager/)
......
......@@ -2,7 +2,9 @@ if(IBUS_FOUND AND GLIB2_FOUND AND GOBJECT_FOUND)
add_subdirectory(emojier)
configure_file(config-kimpanel.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kimpanel.h)
find_package(Qt5X11Extras)
if (QT_MAJOR_VERSION EQUAL "5")
find_package(Qt5X11Extras)
endif()
find_package(XCB COMPONENTS XCB KEYSYMS)
if (Qt5X11Extras_FOUND AND XCB_XCB_FOUND AND XCB_KEYSYMS_FOUND)
......
kconfig_add_kcfg_files(emojier_KCFG emojiersettings.kcfgc GENERATE_MOC)
add_library(EmojierDeclarativePlugin SHARED emojierplugin.cpp ${emojier_KCFG})
target_link_libraries(EmojierDeclarativePlugin PRIVATE GLIB2::GLIB2 PkgConfig::IBUS Qt5::Qml Qt5::Gui KF5::ConfigGui)
target_link_libraries(EmojierDeclarativePlugin PRIVATE GLIB2::GLIB2 PkgConfig::IBUS Qt::Qml Qt::Gui KF5::ConfigGui)
install (TARGETS EmojierDeclarativePlugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/emoji)
install (FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/emoji)
......
add_executable(ibus-ui-emojier-plasma emojier.cpp resources.qrc)
target_link_libraries(ibus-ui-emojier-plasma Qt::Widgets Qt::Quick Qt::X11Extras KF5::ConfigGui KF5::I18n KF5::CoreAddons KF5::Crash KF5::DBusAddons KF5::WindowSystem)
target_link_libraries(ibus-ui-emojier-plasma Qt::Widgets Qt::Quick KF5::ConfigGui KF5::I18n KF5::CoreAddons KF5::Crash KF5::DBusAddons KF5::WindowSystem)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(ibus-ui-emojier-plasma Qt::X11Extras)
endif()
install(TARGETS ibus-ui-emojier-plasma ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES org.kde.plasma.emojier.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kglobalaccel)
......
......@@ -4,7 +4,7 @@ set(kimpanelplugin_SRCS
kimpanelplugin.cpp
kimpanelagent.cpp
)
QT5_ADD_DBUS_ADAPTOR(kimpanelplugin_SRCS
QT_ADD_DBUS_ADAPTOR(kimpanelplugin_SRCS
org.kde.impanel.xml
kimpanelagent.h
PanelAgent)
......
......@@ -20,7 +20,9 @@ target_link_libraries(pagerplugin
Qt::Quick)
if (X11_FOUND)
target_link_libraries(pagerplugin Qt::X11Extras)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(pagerplugin Qt::X11Extras)
endif()
endif()
install(TARGETS pagerplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/pager)
......
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Test)
find_package(Qt${QT_MAJOR_VERSION} ${QT_MIN_VERSION} CONFIG REQUIRED Test)
include(ECMAddTests)
......
# KI18N Translation Domain for this application
add_definitions(-DTRANSLATION_DOMAIN=\"kaccess\")
find_package(Phonon4Qt5 REQUIRED NO_MODULE)
find_package(Phonon4Qt${QT_MAJOR_VERSION} REQUIRED NO_MODULE)
set(kaccess_SRCS kaccess.cpp main.cpp )
......@@ -9,7 +9,6 @@ add_executable(kaccess ${kaccess_SRCS})
target_link_libraries(kaccess
Qt::Widgets
Qt::X11Extras
KF5::CoreAddons
KF5::ConfigCore
KF5::Completion
......@@ -19,13 +18,16 @@ target_link_libraries(kaccess
KF5::WidgetsAddons
KF5::WindowSystem
KF5::DBusAddons
Phonon::phonon4qt5
Phonon::phonon4qt${QT_MAJOR_VERSION}
X11::X11
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(kaccess Qt::X11Extras)
endif()
install(TARGETS kaccess ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
########### install files ###############
install( FILES kaccess.desktop DESTINATION ${KDE_INSTALL_AUTOSTARTDIR} )
install( FILES kaccess.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFY5RCDIR} )
install( FILES kaccess.notifyrc DESTINATION ${KDE_INSTALL_KNOTIFYRCDIR} )
......@@ -32,9 +32,11 @@ target_link_libraries(kcm_access
KF5::QuickAddons
KF5::WindowSystem
KF5::NotifyConfig
Qt::X11Extras
X11::X11
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(kcm_access Qt::X11Extras)
endif()
install(FILES kcm_access.desktop DESTINATION ${KDE_INSTALL_APPDIR})
install(
......
......@@ -2,7 +2,7 @@
project (KCMActivities)
add_definitions(-DTRANSLATION_DOMAIN=\"kcm_activities5\")
find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Core Quick Sql Qml DBus)
find_package (Qt${QT_MAJOR_VERSION} REQUIRED NO_MODULE COMPONENTS Core Quick Sql Qml DBus)
find_package (KF5KCMUtils ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5Declarative ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5XmlGui ${KF5_DEP_VERSION} CONFIG REQUIRED)
......
# vim:set softtabstop=3 shiftwidth=3 tabstop=3 expandtab:
project (kactivities-settings)
find_package (Qt5 REQUIRED NO_MODULE COMPONENTS Sql Gui Widgets Qml Quick Sql QuickWidgets)
find_package (Qt${QT_MAJOR_VERSION} REQUIRED NO_MODULE COMPONENTS Sql Gui Widgets Qml Quick Sql QuickWidgets)
find_package (KF5GlobalAccel ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5I18n ${KF5_DEP_VERSION} CONFIG REQUIRED)
find_package (KF5WidgetsAddons ${KF5_DEP_VERSION} CONFIG REQUIRED)
......
......@@ -42,7 +42,6 @@ set_target_properties(kded_keyboard PROPERTIES OUTPUT_NAME keyboard)
target_link_libraries(kded_keyboard
Qt::Concurrent
Qt::Widgets
Qt::X11Extras
Qt::Xml
KF5::ConfigCore
KF5::CoreAddons
......@@ -60,6 +59,9 @@ target_link_libraries(kded_keyboard
X11::X11
X11::xkbfile
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(kded_keyboard Qt5::X11Extras)
endif()
if (HAVE_XINPUT)
target_link_libraries(kded_keyboard X11::Xi)
......@@ -117,7 +119,6 @@ add_library(kcm_keyboard_static STATIC ${kcm_keyboard_PART_SRCS})
target_link_libraries(kcm_keyboard_static
Qt::Concurrent
Qt::Widgets
Qt::X11Extras
Qt::Xml
KF5::KCMUtils
KF5::GlobalAccel
......@@ -131,6 +132,9 @@ target_link_libraries(kcm_keyboard_static
X11::X11
X11::xkbfile
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(kcm_keyboard_static Qt5::X11Extras)
endif()
kcoreaddons_add_plugin(kcm_keyboard SOURCES kcmmain.cpp INSTALL_NAMESPACE "plasma/kcms/systemsettings")
target_link_libraries(kcm_keyboard kcm_keyboard_static)
......@@ -143,7 +147,7 @@ configure_file(config-keyboard.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-keyboa
# Unit tests
if(BUILD_TESTING)
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED)
find_package(Qt${QT_MAJOR_VERSION}Test ${QT_MIN_VERSION} CONFIG REQUIRED)
add_subdirectory( tests )
endif()
......
......@@ -24,7 +24,6 @@ target_link_libraries(tastenbrett
Qt::Core
Qt::Quick
Qt::Gui
Qt::X11Extras
KF5::CoreAddons
KF5::I18n
XCB::XCB
......@@ -32,5 +31,8 @@ target_link_libraries(tastenbrett
X11::xkbfile
X11::X11
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(tastenbrett PRIVATE Qt5::X11Extras)
endif()
install(TARGETS tastenbrett DESTINATION ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -6,14 +6,16 @@ macro(KEYBOARD_DAEMON_UNIT_TESTS _testname)
target_link_libraries(${_testname}_test
Qt::Concurrent
Qt::Widgets
Qt::X11Extras
Qt::Xml
Qt::Test
KF5::I18n
KF5::WindowSystem
X11::xkbfile
X11::X11
)
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(${_testname}_test Qt5::X11Extras)
endif()
endmacro(KEYBOARD_DAEMON_UNIT_TESTS)
keyboard_daemon_unit_tests(xkb_rules)
......@@ -52,7 +54,6 @@ if( X11_XTest_FOUND )
target_link_libraries(keyboard_daemon_test
kcm_keyboard_static
Qt::Concurrent
Qt::X11Extras
Qt::Xml
Qt::Test
KF5::ConfigCore
......@@ -71,7 +72,11 @@ if( X11_XTest_FOUND )
X11::xkbfile
${X11_XTest_LIB}
X11::X11
)
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(keyboard_daemon_test Qt5::X11Extras)
endif()
if (HAVE_XINPUT)
target_link_libraries(keyboard_daemon_test X11::Xi)
endif()
......
......@@ -40,11 +40,14 @@ target_link_libraries(kcm_landingpage
PW::KWorkspace
KF5::ActivitiesStats
Qt5::DBus
Qt::DBus
)
if(X11_FOUND)
target_link_libraries(kcm_landingpage X11::X11 Qt5::X11Extras)
target_link_libraries(kcm_landingpage X11::X11)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(kcm_landingpage Qt5::X11Extras)
endif()
endif()
if (KUserFeedback_FOUND)
......
......@@ -68,7 +68,7 @@ set(common_SRCS
ki18n_wrap_ui(common_SRCS kcm/xlib/kcmmouse.ui)
qt5_add_resources( common_SRCS kcm/resources.qrc )
qt_add_resources( common_SRCS kcm/resources.qrc )
add_library(kcm_mouse MODULE
${common_SRCS}
......
......@@ -13,10 +13,12 @@ set(backend_SRCS
set(backend_LIBS
${backend_LIBS}
KF5::WindowSystem
Qt::X11Extras
PkgConfig::XORGLIBINPUT
PkgConfig::EVDEV
X11::X11
X11::Xi
X11::Xcursor
)
if (QT_MAJOR_VERSION EQUAL "5")
list(APPEND backend_LIBS Qt::X11Extras)
endif()
......@@ -34,4 +34,4 @@ install( TARGETS kcm_solid_actions DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/k
install( TARGETS solid-action-desktop-gen ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
install( FILES kcm_solid_actions.desktop DESTINATION ${KDE_INSTALL_APPDIR} )
install( FILES solid-action-template.desktop DESTINATION ${KDE_INSTALL_DATADIR}/kcmsolidactions )
install( FILES solid-device-type.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR} )
install( FILES solid-device-type.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPESDIR} )
......@@ -17,7 +17,7 @@ qt_add_dbus_interfaces(TOUCHPAD_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.touchpad.xml
)
qt5_generate_dbus_interface(kded/kded.h org.kde.touchpad.xml)
qt_generate_dbus_interface(kded/kded.h org.kde.touchpad.xml)
kconfig_add_kcfg_files(TOUCHPAD_SRCS kdedsettings.kcfgc)
kconfig_add_kcfg_files(TOUCHPAD_SRCS touchpadparameters.kcfgc)
......@@ -30,7 +30,6 @@ target_link_libraries(touchpad
KF5::XmlGui
PRIVATE
${backend_LIBS}
Qt::X11Extras
Qt::DBus
KF5::ConfigCore
KF5::ConfigGui
......@@ -38,6 +37,9 @@ target_link_libraries(touchpad
KF5::I18n
KF5::GlobalAccel
)
if (QT_MAJOR_VERSION EQUAL "5")
target_link_libraries(touchpad PRIVATE Qt5::X11Extras)
endif()
add_subdirectory(kcm)
add_subdirectory(kded)
......
......@@ -8,7 +8,7 @@ set(Applet_SRCS
touchpadservice.cpp
)
qt5_generate_dbus_interface(../kded/kded.h org.kde.touchpad.xml)
qt_generate_dbus_interface(../kded/kded.h org.kde.touchpad.xml)
qt_add_dbus_interfaces(Applet_SRCS
${CMAKE_CURRENT_BINARY_DIR}/org.kde.touchpad.xml
)
......
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