summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2018-04-17 15:27:14 +0200
committerLoïc Collignon <loic.collignon@iot.bzh>2018-04-18 10:49:33 +0200
commit41ac48501b9070c6ca31fee324218dfd8e05466d (patch)
tree90702362d6fcb2dd3cfa3eed834c3b4000aad971 /CMakeLists.txt
parent523bcf9c0b44214130ef619bda4bd1be50abfbcf (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