1project(lws-api-test-lws_smd 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(requirements 1) 9require_pthreads(requirements) 10require_lws_config(LWS_WITH_SYS_SMD 1 requirements) 11require_lws_config(LWS_WITH_SYS_STATE 1 requirements) 12 13if (requirements) 14 add_executable(${PROJECT_NAME} main.c) 15 add_test(NAME api-test-lws_smd COMMAND lws-api-test-lws_smd -d1151) 16 set_tests_properties(api-test-lws_smd 17 PROPERTIES 18 RUN_SERIAL TRUE 19 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/minimal-examples/api-tests/api-test-lws_smd 20 TIMEOUT 60) 21 22 if (websockets_shared) 23 target_link_libraries(${PROJECT_NAME} websockets_shared ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS}) 24 add_dependencies(${PROJECT_NAME} websockets_shared) 25 else() 26 target_link_libraries(${PROJECT_NAME} websockets ${PTHREAD_LIB} ${LIBWEBSOCKETS_DEP_LIBS}) 27 endif() 28endif() 29