1project(lws-minimal-raw-adopt-udp 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-raw-adopt-udp) 9set(SRCS minimal-raw-adopt-udp.c) 10 11set(requirements 1) 12require_lws_config(LWS_WITH_SERVER 1 requirements) 13require_lws_config(LWS_WITH_CLIENT 1 requirements) 14require_lws_config(LWS_WITH_UDP 1 requirements) 15 16 17if (requirements) 18 add_executable(${SAMP} ${SRCS}) 19 20 if (websockets_shared) 21 target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) 22 add_dependencies(${SAMP} websockets_shared) 23 else() 24 target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS}) 25 endif() 26endif() 27