1project(lws-minimal-http-client-captive-portal C) 2cmake_minimum_required(VERSION 2.8.12) 3find_package(libwebsockets CONFIG REQUIRED) 4list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) 5include(CheckIncludeFile) 6include(CheckCSourceCompiles) 7include(LwsCheckRequirements) 8 9set(SAMP lws-minimal-http-client-captive-portal) 10set(SRCS minimal-http-client-captive-portal.c) 11 12set(requirements 1) 13require_pthreads(requirements) 14require_lws_config(LWS_ROLE_H1 1 requirements) 15require_lws_config(LWS_WITH_TLS 1 requirements) 16require_lws_config(LWS_WITH_CLIENT 1 requirements) 17require_lws_config(LWS_WITH_SYS_STATE 1 requirements) 18 19if (NOT WIN32 AND requirements) 20 add_executable(${SAMP} ${SRCS}) 21 22 if (websockets_shared) 23 target_link_libraries(${SAMP} websockets_shared ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS}) 24 add_dependencies(${SAMP} websockets_shared) 25 else() 26 target_link_libraries(${SAMP} websockets ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS}) 27 endif() 28endif() 29