Commit c93d0eed 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 a5c014df
......@@ -35,8 +35,8 @@ target_link_libraries(plasma-discover PUBLIC
KF5::ItemModels
KF5::KIOWidgets
KF5::QuickAddons
Qt5::Quick
Qt5::X11Extras
Qt::Quick
Qt::X11Extras
Discover::Common
)
......
set(plasma_discover_autotest_SRCS)
ecm_qt_declare_logging_category(plasma_discover_autotest_SRCS HEADER discover_debug.h IDENTIFIER DISCOVER_LOG CATEGORY_NAME org.kde.plasma.discover)
ecm_add_test(PaginateModelTest.cpp ../PaginateModel.cpp ${plasma_discover_autotest_SRCS} TEST_NAME PaginateModelTest LINK_LIBRARIES Qt5::Test)
ecm_add_test(PaginateModelTest.cpp ../PaginateModel.cpp ${plasma_discover_autotest_SRCS} TEST_NAME PaginateModelTest LINK_LIBRARIES Qt::Test)
target_include_directories(PaginateModelTest PUBLIC ${CMAKE_SOURCE_DIR}/libdiscover/)
if(BUILD_DummyBackend)
......
......@@ -64,13 +64,13 @@ endif()
target_link_libraries(DiscoverCommon
PUBLIC
Qt5::Core
Qt5::Qml
Qt5::Widgets
Qt::Core
Qt::Qml
Qt::Widgets
KF5::I18n
KF5::ItemModels
PRIVATE
Qt5::Xml
Qt::Xml
KF5::CoreAddons
KF5::KIOWidgets # KIO/AccessManager
)
......
......@@ -5,7 +5,7 @@ function(add_unit_test name)
target_link_libraries(${name}
Discover::Common
Qt5::Test Qt5::Core ${EXTRA_LIBS})
Qt::Test Qt::Core ${EXTRA_LIBS})
endfunction()
if(KF5Attica_FOUND AND KF5NewStuff_FOUND)
......
......@@ -9,7 +9,7 @@ set(dummy-backend_SRCS
)
add_library(dummy-backend MODULE ${dummy-backend_SRCS})
target_link_libraries(dummy-backend Qt5::Core Qt5::Widgets KF5::CoreAddons KF5::ConfigCore Discover::Common)
target_link_libraries(dummy-backend Qt::Core Qt::Widgets KF5::CoreAddons KF5::ConfigCore Discover::Common)
install(TARGETS dummy-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
install(FILES dummy-backend-categories.xml DESTINATION ${DATA_INSTALL_DIR}/libdiscover/categories)
......
......@@ -10,7 +10,7 @@ set(flatpak-backend_SRCS
)
add_library(flatpak-backend MODULE ${flatpak-backend_SRCS})
target_link_libraries(flatpak-backend Qt5::Core Qt5::Widgets Qt5::Concurrent KF5::CoreAddons KF5::ConfigCore Discover::Common AppStreamQt PkgConfig::Flatpak)
target_link_libraries(flatpak-backend Qt::Core Qt::Widgets Qt::Concurrent KF5::CoreAddons KF5::ConfigCore Discover::Common AppStreamQt PkgConfig::Flatpak)
if (NOT Flatpak_VERSION VERSION_LESS 1.1.2)
target_compile_definitions(flatpak-backend PRIVATE -DFLATPAK_VERBOSE_PROGRESS -DFLATPAK_LIST_UNUSED_REFS)
......@@ -20,7 +20,7 @@ install(TARGETS flatpak-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
install(FILES flatpak-backend-categories.xml DESTINATION ${DATA_INSTALL_DIR}/libdiscover/categories)
add_library(FlatpakNotifier MODULE FlatpakNotifier.cpp)
target_link_libraries(FlatpakNotifier Discover::Notifiers Qt5::Concurrent PkgConfig::Flatpak)
target_link_libraries(FlatpakNotifier Discover::Notifiers Qt::Concurrent PkgConfig::Flatpak)
set_target_properties(FlatpakNotifier PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}/plasma-discover)
install(TARGETS FlatpakNotifier DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover-notifier)
......
......@@ -8,7 +8,7 @@ set(fwupd-backend_SRCS
)
add_library(fwupd-backend MODULE ${fwupd-backend_SRCS})
target_link_libraries(fwupd-backend Qt5::Core KF5::CoreAddons KF5::ConfigCore Discover::Common PkgConfig::Fwupd)
target_link_libraries(fwupd-backend Qt::Core KF5::CoreAddons KF5::ConfigCore Discover::Common PkgConfig::Fwupd)
install(TARGETS fwupd-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
......@@ -5,7 +5,7 @@ add_library(kns-backend MODULE
KNSResource.cpp
KNSReviews.cpp)
target_link_libraries(kns-backend Discover::Common KF5::ConfigCore KF5::Attica KF5::NewStuffCore KF5::WidgetsAddons Qt5::Xml)
target_link_libraries(kns-backend Discover::Common KF5::ConfigCore KF5::Attica KF5::NewStuffCore KF5::WidgetsAddons Qt::Xml)
install(TARGETS kns-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
install(FILES custom/discover_ktexteditor_codesnippets_core.knsrc DESTINATION ${KDE_INSTALL_KNSRCDIR})
include_directories(..)
ecm_add_test(KNSBackendTest.cpp TEST_NAME knsbackendtest LINK_LIBRARIES Discover::Common Qt5::Core Qt5::Test KF5::Attica KF5::NewStuff)
ecm_add_test(KNSBackendTest.cpp TEST_NAME knsbackendtest LINK_LIBRARIES Discover::Common Qt::Core Qt::Test KF5::Attica KF5::NewStuff)
......@@ -19,7 +19,7 @@ ecm_qt_declare_logging_category(packagekit-backend_SRCS HEADER libdiscover_backe
add_library(packagekit-backend MODULE ${packagekit-backend_SRCS})
target_link_libraries(packagekit-backend PRIVATE Discover::Common Qt5::Core PK::packagekitqt5 KF5::ConfigGui KF5::KIOCore KF5::Archive AppStreamQt)
target_link_libraries(packagekit-backend PRIVATE Discover::Common Qt::Core PK::packagekitqt5 KF5::ConfigGui KF5::KIOCore KF5::Archive AppStreamQt)
install(TARGETS packagekit-backend DESTINATION ${KDE_INSTALL_PLUGINDIR}/discover)
if(TARGET PkgConfig::Markdown)
......
add_subdirectory(libsnapclient)
add_library(snap-backend MODULE SnapResource.cpp SnapBackend.cpp SnapTransaction.cpp snapui.qrc)
target_link_libraries(snap-backend Qt5::Core Qt5::Concurrent KF5::CoreAddons KF5::ConfigCore Discover::Common Snapd::Core)
target_link_libraries(snap-backend Qt::Core Qt::Concurrent KF5::CoreAddons KF5::ConfigCore Discover::Common Snapd::Core)
if ("${Snapd_VERSION}" VERSION_GREATER 1.40)
target_compile_definitions(snap-backend PRIVATE -DSNAP_COMMON_IDS -DSNAP_CHANNELS)
......
......@@ -2,11 +2,11 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-paths.h.cmake ${CMAKE_CURRENT_
ki18n_wrap_ui(SnapMacaroonDialog_SRCS SnapMacaroonDialog.ui)
add_executable(SnapMacaroonDialog SnapMacaroonDialog.cpp ${SnapMacaroonDialog_SRCS})
target_link_libraries(SnapMacaroonDialog Qt5::Network Qt5::Widgets KF5::AuthCore KF5::I18n)
target_link_libraries(SnapMacaroonDialog Qt::Network Qt::Widgets KF5::AuthCore KF5::I18n)
install(TARGETS SnapMacaroonDialog DESTINATION ${KDE_INSTALL_LIBEXECDIR}/discover)
add_executable(libsnap_helper SnapAuthHelper.cpp)
target_link_libraries(libsnap_helper Qt5::Network KF5::AuthCore Snapd::Core)
target_link_libraries(libsnap_helper Qt::Network KF5::AuthCore Snapd::Core)
install(TARGETS libsnap_helper DESTINATION ${KAUTH_HELPER_INSTALL_DIR})
kauth_install_actions(org.kde.discover.libsnapclient org.kde.discover.libsnapclient.actions)
......
add_library(DiscoverNotifiers BackendNotifierModule.cpp)
target_link_libraries(DiscoverNotifiers
PUBLIC
Qt5::Core
Qt::Core
)
generate_export_header(DiscoverNotifiers)
......
ecm_add_test(CategoriesTest.cpp TEST_NAME CategoriesTest LINK_LIBRARIES Qt5::Test Qt5::Gui Discover::Common)
ecm_add_test(CategoriesTest.cpp TEST_NAME CategoriesTest LINK_LIBRARIES Qt::Test Qt::Gui Discover::Common)
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