summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2018-04-17 15:27:14 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 14:12:02 +0100
commitc4adbcb905dc37e4d8773cea6a77cbec3e1a02f8 (patch)
treedfb8543e9e6d5eca20bb4a5341a15217f61ed016 /CMakeLists.txt
parentb5f3b51d749c821f8776b1437faed5277c410c63 (diff)
Added a Qt's websocket client to AFB into helpers
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 <loic.collignon@iot.bzh>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt20
1 files changed, 19 insertions, 1 deletions
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