From 41ac48501b9070c6ca31fee324218dfd8e05466d Mon Sep 17 00:00:00 2001 From: Loïc Collignon Date: Tue, 17 Apr 2018 15:27:14 +0200 Subject: Added a Qt's websocket client to AFB into helpers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This add a single Qt class to serve as a client to Application Framework Binder. It's optional, not enabled by default. To enable you have to set AFB_HELPERS_QTWSCLIENT to ON. Change-Id: Ia0759a95688e48183e6661082693c410a575b14b Signed-off-by: Loïc Collignon --- CMakeLists.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index f031163..5e1eb90 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,9 +21,27 @@ # Add target to project dependency list PROJECT_TARGET_ADD(afb-helpers) +set(CMAKE_AUTOMOC ON) + + set(AFB_HELPERS_SRCS curl-wrap.c escape.c wrap-json.c filescan-utils.c) + + option(AFB_HELPERS_QTWSCLIENT "Enable the Qt's websocket client to Application Framework Binders" OFF) + + if (AFB_HELPERS_QTWSCLIENT) + message(STATUS "Qt's WebSocket AFB Client: Enabled!") + set(AFB_HELPERS_SRCS ${AFB_HELPERS_SRCS} qafbwebsocketclient.cpp qafbwebsocketclient.h) + find_package(Qt5WebSockets REQUIRED) + else() + message(STATUS "Qt's WebSocket AFB Client: Disabled!") + endif() # Define targets - ADD_LIBRARY(${TARGET_NAME} STATIC curl-wrap.c escape.c wrap-json.c filescan-utils.c) + ADD_LIBRARY(${TARGET_NAME} STATIC ${AFB_HELPERS_SRCS}) + + if (AFB_HELPERS_QTWSCLIENT) + target_link_libraries(${TARGET_NAME} Qt5::WebSockets) + qt5_use_modules(${TARGET_NAME} WebSockets) + endif() # Library properties SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES -- cgit 1.2.3-korg