2020-08-19 17:37:42 +01:00
|
|
|
project(lws-minimal-http-server-sse-ring C)
|
2023-12-08 07:48:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2020-06-15 19:49:35 +01:00
|
|
|
find_package(libwebsockets CONFIG REQUIRED)
|
2018-04-20 07:15:42 +08:00
|
|
|
include(CheckIncludeFile)
|
|
|
|
include(CheckCSourceCompiles)
|
|
|
|
|
|
|
|
set(SAMP lws-minimal-http-server-sse-ring)
|
|
|
|
set(SRCS minimal-http-server-sse-ring.c)
|
|
|
|
|
|
|
|
set(requirements 1)
|
|
|
|
require_pthreads(requirements)
|
2018-04-27 19:16:50 +08:00
|
|
|
require_lws_config(LWS_ROLE_H1 1 requirements)
|
2019-08-18 05:04:15 +01:00
|
|
|
require_lws_config(LWS_WITH_SERVER 1 requirements)
|
2018-04-20 07:15:42 +08:00
|
|
|
|
|
|
|
if (requirements)
|
|
|
|
add_executable(${SAMP} ${SRCS})
|
|
|
|
|
|
|
|
if (websockets_shared)
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets_shared ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS})
|
2018-04-20 07:15:42 +08:00
|
|
|
add_dependencies(${SAMP} websockets_shared)
|
|
|
|
else()
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS})
|
2018-04-20 07:15:42 +08:00
|
|
|
endif()
|
|
|
|
endif()
|