1project(lws-minimal-http-client-hugeurl C) 2cmake_minimum_required(VERSION 2.8.12) 3find_package(libwebsockets CONFIG REQUIRED) 4list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) 5include(CheckCSourceCompiles) 6include(LwsCheckRequirements) 7 8set(SAMP lws-minimal-http-client-hugeurl) 9set(SRCS minimal-http-client-hugeurl.c) 10 11set(requirements 1) 12require_lws_config(LWS_ROLE_H1 1 requirements) 13require_lws_config(LWS_WITH_CLIENT 1 requirements) 14require_lws_config(LWS_WITH_TLS 1 requirements) 15 16if (requirements) 17 add_executable(${SAMP} ${SRCS}) 18 19 if (LWS_CTEST_INTERNET_AVAILABLE) 20 21 # 22 # creates a fixture res_hchugeurlw to get a lease on the 23 # server resources 24 # 25 sai_resource(warmcat_conns 1 40 hchugeurlw) 26 27 add_test(NAME http-client-hugeurl-warmcat COMMAND lws-minimal-http-client-hugeurl ) 28 add_test(NAME http-client-hugeurl-warmcat-h1 COMMAND lws-minimal-http-client-hugeurl --h1) 29 set_tests_properties(http-client-hugeurl-warmcat 30 http-client-hugeurl-warmcat-h1 31 PROPERTIES 32 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/http-client/minimal-http-client-hugeurl 33 TIMEOUT 20) 34 if (DEFINED ENV{SAI_OVN}) 35 set_tests_properties(http-client-hugeurl-warmcat 36 http-client-hugeurl-warmcat-h1 37 PROPERTIES 38 FIXTURES_REQUIRED "res_hchugeurlw") 39 endif() 40 41 endif() 42 43 if (websockets_shared) 44 target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) 45 add_dependencies(${SAMP} websockets_shared) 46 else() 47 target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS}) 48 endif() 49endif() 50