Fix build with qcoro 0.4

Cmake targets and config files have been renamed. Check for the 0.4 name first and fall back to the old one
This commit is contained in:
Antonio Rojas
2022-01-06 21:37:07 +00:00
committed by Nicolas Fella
parent ee59006c08
commit 9300e65239
2 changed files with 10 additions and 2 deletions

View File

@@ -108,7 +108,10 @@ set_package_properties(KQuickImageEditor PROPERTIES
PURPOSE "Add image editing capability to image attachments"
)
find_package(QCoro REQUIRED)
find_package(QCoro5 COMPONENTS Coro QUIET)
if(NOT QCoro5_FOUND)
find_package(QCoro REQUIRED)
endif()
qcoro_enable_coroutines()

View File

@@ -62,7 +62,12 @@ if(NOT ANDROID)
endif()
target_include_directories(neochat PRIVATE ${CMAKE_BINARY_DIR})
target_link_libraries(neochat PRIVATE Qt::Quick Qt::Qml Qt::Gui Qt::Network Qt::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark ${QTKEYCHAIN_LIBRARIES} QCoro::QCoro)
target_link_libraries(neochat PRIVATE Qt::Quick Qt::Qml Qt::Gui Qt::Network Qt::QuickControls2 KF5::I18n KF5::Kirigami2 KF5::Notifications KF5::ConfigCore KF5::ConfigGui KF5::CoreAddons Quotient cmark::cmark ${QTKEYCHAIN_LIBRARIES})
if(TARGET QCoro5::Coro)
target_link_libraries(neochat PRIVATE QCoro5::Coro)
else()
target_link_libraries(neochat PRIVATE QCoro::QCoro)
endif()
kconfig_add_kcfg_files(neochat GENERATE_MOC neochatconfig.kcfgc)
if(NEOCHAT_FLATPAK)