Commit 62071a05 authored by Nicolas Fella's avatar Nicolas Fella
Browse files

Use versionless Qt cmake target

This makes it easier to build against both Qt5 and Qt6

GIT_SILENT
parent 10ef0d4d
......@@ -7,7 +7,7 @@ macro(KSCREEN_ADD_TEST)
set(test_SRCS ${_testname}.cpp ${KSCREEN_WAYLAND_SRCS})
qt5_add_dbus_interface(test_SRCS ${CMAKE_SOURCE_DIR}/interfaces/org.kde.KScreen.FakeBackend.xml fakebackendinterface)
add_executable(${_testname} ${test_SRCS})
target_link_libraries(${_testname} Qt5::Core Qt5::Gui Qt5::Test Qt5::DBus KF5::Screen ${KSCREEN_WAYLAND_LIBS})
target_link_libraries(${_testname} Qt::Core Qt::Gui Qt::Test Qt::DBus KF5::Screen ${KSCREEN_WAYLAND_LIBS})
add_test(NAME kscreen-${_testname}
COMMAND dbus-launch $<TARGET_FILE:${_testname}>
)
......
......@@ -17,8 +17,8 @@ add_library(KSC_Fake MODULE ${fake_SRCS})
set_target_properties(KSC_Fake PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kscreen")
set_target_properties(KSC_Fake PROPERTIES PREFIX "")
target_link_libraries(KSC_Fake
Qt5::Core
Qt5::DBus
Qt::Core
Qt::DBus
KF5::Screen
)
......
......@@ -12,9 +12,9 @@ add_library(KSC_KWayland MODULE ${wayland_SRCS})
set_target_properties(KSC_KWayland PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kscreen")
set_target_properties(KSC_KWayland PROPERTIES PREFIX "")
target_link_libraries(KSC_KWayland Qt5::Core
Qt5::DBus
Qt5::Gui
target_link_libraries(KSC_KWayland Qt::Core
Qt::DBus
Qt::Gui
KF5::Screen
KF5::WaylandClient
)
......
......@@ -13,9 +13,9 @@ add_library(KSC_QScreen MODULE ${qscreen_SRCS})
set_target_properties(KSC_QScreen PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kscreen")
set_target_properties(KSC_QScreen PROPERTIES PREFIX "")
target_link_libraries(KSC_QScreen Qt5::Core
Qt5::Gui
Qt5::X11Extras
target_link_libraries(KSC_QScreen Qt::Core
Qt::Gui
Qt::X11Extras
KF5::Screen
)
......
......@@ -18,9 +18,9 @@ add_library(KSC_XRandR MODULE ${xrandr_SRCS})
set_target_properties(KSC_XRandR PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kscreen")
set_target_properties(KSC_XRandR PROPERTIES PREFIX "")
target_link_libraries(KSC_XRandR Qt5::Core
Qt5::Gui
Qt5::X11Extras
target_link_libraries(KSC_XRandR Qt::Core
Qt::Gui
Qt::X11Extras
${XCB_LIBRARIES}
KF5::Screen
)
......
......@@ -16,9 +16,9 @@ add_library(KSC_XRandR11 MODULE ${xrandr11_SRCS})
set_target_properties(KSC_XRandR11 PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/kf5/kscreen")
set_target_properties(KSC_XRandR11 PROPERTIES PREFIX "")
target_link_libraries(KSC_XRandR11 Qt5::Core
Qt5::Gui
Qt5::X11Extras
target_link_libraries(KSC_XRandR11 Qt::Core
Qt::Gui
Qt::X11Extras
${XCB_LIBRARIES}
KF5::Screen
)
......
......@@ -38,11 +38,11 @@ generate_export_header(KF5Screen BASE_NAME KScreen)
target_link_libraries(KF5Screen
PUBLIC
Qt5::Core
Qt5::Gui
Qt::Core
Qt::Gui
PRIVATE
Qt5::DBus
Qt5::X11Extras
Qt::DBus
Qt::X11Extras
)
set_target_properties(KF5Screen PROPERTIES
......
......@@ -24,10 +24,10 @@ add_executable(kscreen_backend_launcher ${backendlauncher_SRCS})
target_link_libraries(kscreen_backend_launcher
KF5Screen
Qt5::Core
Qt5::Gui
Qt5::X11Extras
Qt5::DBus
Qt::Core
Qt::Gui
Qt::X11Extras
Qt::DBus
)
install(TARGETS kscreen_backend_launcher
......
add_executable(kscreen-doctor main.cpp doctor.cpp dpmsclient.cpp)
target_link_libraries(kscreen-doctor Qt5::DBus KF5::Screen KF5::WaylandClient)
target_link_libraries(kscreen-doctor Qt::DBus KF5::Screen KF5::WaylandClient)
install(TARGETS kscreen-doctor ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
add_executable(printconfig testplugandplay.cpp testpnp.cpp)
target_link_libraries(printconfig Qt5::Gui KF5::Screen)
target_link_libraries(printconfig Qt::Gui KF5::Screen)
add_subdirectory(kwayland)
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