Skip to content

Commit

Permalink
build with fetchcontent: add libwebsockets dependency (#955)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Halim <[email protected]>
  • Loading branch information
andrewz90 authored Jan 29, 2025
1 parent 73cf4e5 commit 9db4783
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions doc/common/build-with-fetchcontent/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ macro(find_nlohmann_json_schema_validator)
FetchContent_MakeAvailable(${EXTERNAL_JSON_SCHEMA_NAME})
endmacro()

macro(find_libwebsockets)
message(STATUS "Using FetchContent for libwebsockets library")
set(EXTERNAL_LIBWEBSOCKET_NAME libwebsockets)
set(EXTERNAL_LIBWEBSOCKET_URL https://github.com/warmcat/libwebsockets.git)
set(EXTERNAL_LIBWEBSOCKET_TAG v4.3.3)

FetchContent_Declare(
${EXTERNAL_LIBWEBSOCKET_NAME}
GIT_REPOSITORY ${EXTERNAL_LIBWEBSOCKET_URL}
GIT_TAG ${EXTERNAL_LIBWEBSOCKET_TAG}
)

FetchContent_MakeAvailable(${EXTERNAL_LIBWEBSOCKET_NAME})
endmacro()

macro(find_websocketpp)
message(STATUS "Using FetchContent for websocketpp library")
set(EXTERNAL_WEBSOCKET_NAME websocketpp)
Expand Down Expand Up @@ -158,6 +173,8 @@ macro(find_package PACKAGE_NAME)
find_nlohmann_json()
elseif("${PACKAGE_NAME}" STREQUAL "nlohmann_json_schema_validator")
find_nlohmann_json_schema_validator()
elseif("${PACKAGE_NAME}" STREQUAL "libwebsockets")
find_libwebsockets()
elseif("${PACKAGE_NAME}" STREQUAL "websocketpp")
find_websocketpp()
elseif("${PACKAGE_NAME}" STREQUAL "fsm")
Expand Down

0 comments on commit 9db4783

Please sign in to comment.