1project(lws-api-test-lejp 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_lws_config(LWS_WITH_LEJP 1 requirements) 10 11if (requirements) 12 13 add_executable(${PROJECT_NAME} main.c) 14 add_test(NAME api-test-lejp COMMAND lws-api-test-lejp) 15 16 if (websockets_shared) 17 target_link_libraries(${PROJECT_NAME} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) 18 add_dependencies(${PROJECT_NAME} websockets_shared) 19 else() 20 target_link_libraries(${PROJECT_NAME} websockets ${LIBWEBSOCKETS_DEP_LIBS}) 21 endif() 22endif() 23