2020-05-22 16:47:40 +01:00
|
|
|
project(lws-minimal-http-server-proxy C)
|
2023-12-08 07:48:09 +00:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2020-05-22 16:47:40 +01:00
|
|
|
find_package(libwebsockets CONFIG REQUIRED)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR})
|
2019-03-16 16:19:00 +08:00
|
|
|
include(CheckCSourceCompiles)
|
2020-05-22 16:47:40 +01:00
|
|
|
include(LwsCheckRequirements)
|
2019-03-16 16:19:00 +08:00
|
|
|
|
|
|
|
set(SAMP lws-minimal-http-server-proxy)
|
|
|
|
set(SRCS minimal-http-server-proxy.c)
|
|
|
|
|
|
|
|
set(requirements 1)
|
|
|
|
require_lws_config(LWS_ROLE_H1 1 requirements)
|
2019-08-18 05:04:15 +01:00
|
|
|
require_lws_config(LWS_WITH_SERVER 1 requirements)
|
2019-03-16 16:19:00 +08:00
|
|
|
require_lws_config(LWS_WITH_HTTP_PROXY 1 requirements)
|
2020-05-22 16:47:40 +01:00
|
|
|
require_lws_config(LWS_WITH_TLS 1 requirements)
|
2019-03-16 16:19:00 +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 ${LIBWEBSOCKETS_DEP_LIBS})
|
2019-03-16 16:19:00 +08:00
|
|
|
add_dependencies(${SAMP} websockets_shared)
|
|
|
|
else()
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS})
|
2019-03-16 16:19:00 +08:00
|
|
|
endif()
|
|
|
|
endif()
|