From 8f2fed8d2a1b23a8f318047b6592ad64b6ecbd22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Mon, 30 Mar 2015 17:49:26 +0200 Subject: Async: initial support for native chaining of KJobs It is now possible use KJob-derived jobs with libasync without having to write lambda wrappers. auto job = Async::start(); job.exec(arg1, arg2, ...); The reason for this approach (instead of taking KJob* as an argument is that we usually want the KJob ctor arguments to depend on result of previous job. At least in case of Async::start() however it makes sense to support passing KJob* as an argument (not yet implemented). In future we should also support custom error handlers. The KJob integration is build-time optional, but enabled by default (pass -DWITH_KJOB=FALSE to CMake to disable). Adds KCoreAddons dependency. --- async/src/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'async/src/CMakeLists.txt') diff --git a/async/src/CMakeLists.txt b/async/src/CMakeLists.txt index 7d17f2b..6f8ab63 100644 --- a/async/src/CMakeLists.txt +++ b/async/src/CMakeLists.txt @@ -8,5 +8,9 @@ set(async_SRCS ) add_library(${PROJECT_NAME} SHARED ${async_SRCS}) -target_link_libraries(${PROJECT_NAME} Qt5::Core) +target_link_libraries(${PROJECT_NAME} PUBLIC Qt5::Core) +if (WITH_KJOB) + target_link_libraries(${PROJECT_NAME} PUBLIC KF5::CoreAddons) +endif () + install(TARGETS ${PROJECT_NAME} ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) -- cgit v1.2.3