From b3b08fc684ed74a5a77e320846ed1d411bb4f884 Mon Sep 17 00:00:00 2001 From: pipeacosta Date: Fri, 25 Aug 2023 07:17:10 +0000 Subject: [PATCH] Added the api-client node type to CMakeLists Signed-off-by: pipeacosta --- CMakeLists.txt | 2 ++ lib/nodes/CMakeLists.txt | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c0e4e2f48..78b0b52e2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -188,6 +188,7 @@ cmake_dependent_option(WITH_TOOLS "Build auxilary tools" cmake_dependent_option(WITH_WEB "Build with internal webserver" "${WITH_DEFAULTS}" "LIBWEBSOCKETS_FOUND" OFF) cmake_dependent_option(WITH_NODE_AMQP "Build with amqp node-type" "${WITH_DEFAULTS}" "RABBITMQ_C_FOUND" OFF) +cmake_dependent_option(WITH_NODE_API_CLIENT "Build with api-client node-type" "${WITH_DEFAULTS}" "" OFF) cmake_dependent_option(WITH_NODE_CAN "Build with can node-type" "${WITH_DEFAULTS}" "" OFF) cmake_dependent_option(WITH_NODE_COMEDI "Build with comedi node-type" "${WITH_DEFAULTS}" "COMEDILIB_FOUND" OFF) cmake_dependent_option(WITH_NODE_ETHERCAT "Build with ethercat node-type" "${WITH_DEFAULTS}" "ETHERLAB_FOUND; NOT WITHOUT_GPL" OFF) @@ -298,6 +299,7 @@ add_feature_info(TOOLS WITH_TOOLS "Build auxil add_feature_info(WEB WITH_WEB "Build with internal webserver") add_feature_info(NODE_AMQP WITH_NODE_AMQP "Build with amqp node-type") +add_feature_info(NODE_API_CLIENT WITH_NODE_API_CLIENT "Build with api-client node-type") add_feature_info(NODE_CAN WITH_NODE_CAN "Build with can node-type") add_feature_info(NODE_COMEDI WITH_NODE_COMEDI "Build with comedi node-type") add_feature_info(NODE_ETHERCAT WITH_NODE_ETHERCAT "Build with ethercat node-type") diff --git a/lib/nodes/CMakeLists.txt b/lib/nodes/CMakeLists.txt index 064bb6ded..96ab4cc3c 100644 --- a/lib/nodes/CMakeLists.txt +++ b/lib/nodes/CMakeLists.txt @@ -186,6 +186,13 @@ if(WITH_NODE_WEBRTC) list(APPEND LIBRARIES LibDataChannel::LibDataChannel) endif() +# Enable REST API client support +if(WITH_NODE_API_CLIENT) + list(APPEND NODE_SRC api_client.cpp) + list(APPEND INCLUDE_DIRECTORIES ${CURL_INCLUDE_DIRS}) + list(APPEND LIBRARIES ${CURL_LIBRARIES}) +endif() + add_library(nodes STATIC ${NODE_SRC}) target_include_directories(nodes PUBLIC ${INCLUDE_DIRS}) target_link_libraries(nodes PUBLIC ${LIBRARIES})