Commit c3de4a96 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 f0299ad5
......@@ -5,41 +5,41 @@ include_directories(${libksysguard_SOURCE_DIR})
# Process unit test
ecm_qt_declare_logging_category(processtest_debug_SRCS HEADER processcore_debug.h IDENTIFIER LIBKSYSGUARD_PROCESSCORE CATEGORY_NAME org.kde.libksysguard.processcore)
ecm_add_test(processtest.cpp ${processtest_debug_SRCS} TEST_NAME processtest
LINK_LIBRARIES KSysGuard::ProcessUi Qt5::Test)
LINK_LIBRARIES KSysGuard::ProcessUi Qt::Test)
if (KF5Plasma_FOUND)
set(SIGNALPLOTTER_DEBUG_SRCS)
ecm_qt_declare_logging_category(SIGNALPLOTTER_DEBUG_SRCS HEADER ksignalplotter_debug.h IDENTIFIER LIBKSYSGUARD_KSIGNALPLOTTER CATEGORY_NAME org.kde.libksysguard.ksignalplotter)
ecm_add_test(signalplotterbenchmark.cpp ../signalplotter/ksignalplotter.cpp ${SIGNALPLOTTER_DEBUG_SRCS}
TEST_NAME signalplotterbenchmark
LINK_LIBRARIES KSysGuard::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes
LINK_LIBRARIES KSysGuard::SignalPlotter Qt::Test Qt::Widgets KF5::IconThemes
)
ecm_add_test(graphicssignalplotterbenchmark.cpp ../signalplotter/kgraphicssignalplotter.cpp ${SIGNALPLOTTER_DEBUG_SRCS}
TEST_NAME graphicssignalplotterbenchmark
LINK_LIBRARIES KSysGuard::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes KF5::Plasma
LINK_LIBRARIES KSysGuard::SignalPlotter Qt::Test Qt::Widgets KF5::IconThemes KF5::Plasma
)
ecm_add_test(signalplottertest.cpp ../signalplotter/ksignalplotter.cpp ${SIGNALPLOTTER_DEBUG_SRCS}
TEST_NAME signalplottertest
LINK_LIBRARIES KSysGuard::SignalPlotter Qt5::Test Qt5::Widgets KF5::IconThemes
LINK_LIBRARIES KSysGuard::SignalPlotter Qt::Test Qt::Widgets KF5::IconThemes
)
endif()
ecm_add_test(chronotest.cpp
TEST_NAME chronotest
LINK_LIBRARIES Qt5::Test KF5::I18n
LINK_LIBRARIES Qt::Test KF5::I18n
)
ecm_add_test(formattertest.cpp LINK_LIBRARIES Qt5::Test KSysGuard::Formatter)
ecm_add_test(sensortreemodeltest.cpp LINK_LIBRARIES Qt5::Test Qt5::DBus KSysGuard::Sensors)
ecm_add_test(sensordatamodeltest.cpp LINK_LIBRARIES Qt5::Test Qt5::DBus KSysGuard::Sensors KSysGuard::Formatter)
ecm_add_test(processdatamodeltest.cpp LINK_LIBRARIES Qt5::Test KSysGuard::ProcessCore)
ecm_add_test(cgrouptest.cpp LINK_LIBRARIES Qt5::Test KF5::Service KSysGuard::ProcessCore)
ecm_add_test(formattertest.cpp LINK_LIBRARIES Qt::Test KSysGuard::Formatter)
ecm_add_test(sensortreemodeltest.cpp LINK_LIBRARIES Qt::Test Qt::DBus KSysGuard::Sensors)
ecm_add_test(sensordatamodeltest.cpp LINK_LIBRARIES Qt::Test Qt::DBus KSysGuard::Sensors KSysGuard::Formatter)
ecm_add_test(processdatamodeltest.cpp LINK_LIBRARIES Qt::Test KSysGuard::ProcessCore)
ecm_add_test(cgrouptest.cpp LINK_LIBRARIES Qt::Test KF5::Service KSysGuard::ProcessCore)
include_directories(../faces)
ecm_add_test(sensorfacecontrollertest.cpp LINK_LIBRARIES
Qt5::Test
Qt::Test
KF5::ConfigCore
KF5::ConfigGui
KF5::I18n
......@@ -54,9 +54,9 @@ ecm_add_test(sensorfacecontrollertest.cpp LINK_LIBRARIES
# ecm_add_test(${ksysguarddtest_SRCS}
# TEST_NAME "ksysguard-ksysguarddtest"
# LINK_LIBRARIES
# Qt5::Test
# Qt5::Network
# Qt5::Widgets
# Qt::Test
# Qt::Network
# Qt::Widgets
# KF5::ConfigCore
# KF5::CoreAddons
# KF5::I18n
......
......@@ -38,15 +38,15 @@ generate_export_header(SensorFaces)
target_link_libraries(SensorFaces
PUBLIC
Qt5::Qml
Qt5::Quick
Qt::Qml
Qt::Quick
KF5::ConfigCore
KF5::ConfigGui
KSysGuard::Formatter
KSysGuard::Sensors
PRIVATE
Qt5::Core
Qt5::DBus
Qt::Core
Qt::DBus
KF5::I18n
KF5::Package
KF5::Declarative
......
......@@ -2,7 +2,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.
add_library(FacesPlugin SHARED FacesPlugin.cpp)
target_link_libraries(FacesPlugin Qt5::Qml KSysGuard::Sensors KSysGuard::SensorFaces KF5::Package KF5::ConfigCore KF5::ConfigGui KF5::Declarative)
target_link_libraries(FacesPlugin Qt::Qml KSysGuard::Sensors KSysGuard::SensorFaces KF5::Package KF5::ConfigCore KF5::ConfigGui KF5::Declarative)
install(TARGETS FacesPlugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/faces)
install(FILES qmldir ExtendedLegend.qml SensorFace.qml DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/faces)
......@@ -23,7 +23,7 @@ add_library(KSysGuard::Formatter ALIAS Formatter)
target_link_libraries(Formatter
PUBLIC
Qt5::Core
Qt::Core
PRIVATE
KF5::I18n
)
......
......@@ -2,7 +2,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.
add_library(FormatterPlugin SHARED FormatterPlugin.cpp FormatterWrapper.cpp)
target_link_libraries(FormatterPlugin Qt5::Qml KSysGuard::Formatter)
target_link_libraries(FormatterPlugin Qt::Qml KSysGuard::Formatter)
install(TARGETS FormatterPlugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/formatter)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/formatter)
......@@ -26,8 +26,8 @@ target_include_directories(ksgrd
target_link_libraries(ksgrd
PUBLIC
Qt5::Core
Qt5::Network # QTcpSocket in SensorSocketAgent.h
Qt::Core
Qt::Network # QTcpSocket in SensorSocketAgent.h
KF5::ConfigCore # KConfigGroup in SensorManager.h
PRIVATE
KF5::I18n
......
......@@ -14,7 +14,7 @@ add_library(KSysGuard::LsofUi ALIAS lsofui)
target_link_libraries(lsofui
PUBLIC
Qt5::Widgets
Qt::Widgets
PRIVATE
KF5::I18n
)
......
......@@ -28,7 +28,7 @@ add_library(KSysGuard::ProcessCore ALIAS processcore)
target_link_libraries(processcore
PUBLIC
Qt5::Core
Qt::Core
KSysGuard::Formatter
PRIVATE
KF5::I18n
......@@ -86,7 +86,7 @@ if(ENABLE_KAUTH_HELPER)
)
add_executable(ksysguardprocesslist_helper ${ksysguardprocesslist_helper_srcs})
target_link_libraries(ksysguardprocesslist_helper Qt5::Core KF5::AuthCore KF5::I18n)
target_link_libraries(ksysguardprocesslist_helper Qt::Core KF5::AuthCore KF5::I18n)
install(TARGETS ksysguardprocesslist_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_helper_files(ksysguardprocesslist_helper org.kde.ksysguard.processlisthelper root)
......
......@@ -2,7 +2,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.
add_library(ProcessPlugin SHARED ProcessPlugin.cpp ProcessEnums.cpp)
target_link_libraries(ProcessPlugin Qt5::Qml KSysGuard::ProcessCore)
target_link_libraries(ProcessPlugin Qt::Qml KSysGuard::ProcessCore)
install(TARGETS ProcessPlugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/process)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/process)
......@@ -34,10 +34,10 @@ endif()
target_link_libraries(processui
PUBLIC
KSysGuard::ProcessCore
Qt5::Widgets
Qt::Widgets
KF5::ConfigCore
PRIVATE
Qt5::DBus
Qt::DBus
KF5::I18n
KF5::WindowSystem
KF5::AuthCore
......@@ -57,11 +57,11 @@ target_include_directories(processui
)
if(X11_FOUND)
target_link_libraries(processui PRIVATE Qt5::X11Extras KF5::WindowSystem)
target_link_libraries(processui PRIVATE Qt::X11Extras KF5::WindowSystem)
endif()
if(WEBENGINE_SCRIPTING_ENABLED)
target_link_libraries(processui PRIVATE Qt5::WebEngineWidgets Qt5::WebChannel)
target_link_libraries(processui PRIVATE Qt::WebEngineWidgets Qt::WebChannel)
endif()
if(NOT HAVE_CLOCK_GETTIME_C)
......
......@@ -44,11 +44,11 @@ generate_export_header(Sensors)
target_link_libraries(Sensors
PUBLIC
Qt5::Qml
Qt::Qml
KSysGuard::Formatter
PRIVATE
Qt5::Core
Qt5::DBus
Qt::Core
Qt::DBus
KF5::I18n
)
......
......@@ -2,7 +2,7 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}/.. ${CMAKE_CURRENT_SOURCE_DIR}/.
add_library(SensorsPlugin SHARED SensorsPlugin.cpp)
target_link_libraries(SensorsPlugin Qt5::Qml KSysGuard::Sensors)
target_link_libraries(SensorsPlugin Qt::Qml KSysGuard::Sensors)
install(TARGETS SensorsPlugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/sensors)
install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/ksysguard/sensors)
......@@ -12,7 +12,7 @@ add_library(KSysGuard::SignalPlotter ALIAS ksignalplotter)
target_link_libraries(ksignalplotter
PUBLIC
Qt5::Widgets
Qt::Widgets
KF5::I18n # klocalizedstring.h
KF5::IconThemes
PRIVATE
......
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