2020-05-22 16:47:40 +01:00
|
|
|
project(lws-minimal-http-client C)
|
2018-03-04 09:39:45 +08:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
2020-05-22 16:47:40 +01:00
|
|
|
find_package(libwebsockets CONFIG REQUIRED)
|
|
|
|
list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR})
|
2018-03-20 13:28:25 +08:00
|
|
|
include(CheckCSourceCompiles)
|
2020-05-22 16:47:40 +01:00
|
|
|
include(LwsCheckRequirements)
|
2018-03-04 09:39:45 +08:00
|
|
|
|
|
|
|
set(SAMP lws-minimal-http-client)
|
|
|
|
set(SRCS minimal-http-client.c)
|
|
|
|
|
2018-03-17 06:43:12 +08:00
|
|
|
set(requirements 1)
|
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_CLIENT 1 requirements)
|
2020-06-23 13:19:30 +01:00
|
|
|
require_lws_config(LWS_WITH_SYS_STATE 1 requirements)
|
2018-03-17 06:43:12 +08:00
|
|
|
|
|
|
|
if (requirements)
|
|
|
|
add_executable(${SAMP} ${SRCS})
|
|
|
|
|
2020-04-14 19:04:13 +01:00
|
|
|
# if (LWS_CTEST_INTERNET_AVAILABLE)
|
|
|
|
# add_test(NAME http-client-warmcat COMMAND lws-minimal-http-client --ignore-sigterm)
|
|
|
|
# add_test(NAME http-client-warmcat-h1 COMMAND lws-minimal-http-client --ignore-sigterm --h1)
|
|
|
|
# set_tests_properties(http-client-warmcat
|
|
|
|
# http-client-warmcat-h1
|
|
|
|
# PROPERTIES
|
|
|
|
# WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client
|
|
|
|
# TIMEOUT 20)
|
|
|
|
#
|
|
|
|
#endif()
|
|
|
|
|
2018-03-17 06:43:12 +08:00
|
|
|
if (websockets_shared)
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS})
|
2018-03-17 06:43:12 +08:00
|
|
|
add_dependencies(${SAMP} websockets_shared)
|
|
|
|
else()
|
2020-06-15 19:49:35 +01:00
|
|
|
target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS})
|
2018-03-17 06:43:12 +08:00
|
|
|
endif()
|
2020-04-14 19:04:13 +01:00
|
|
|
endif()
|