1project(lws-api-test-cose 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-api-test-cose) 9set(SRCS main.c keys.c sign.c) 10 11set(requirements 1) 12require_lws_config(LWS_WITH_COSE 1 requirements) 13require_lws_config(LWS_WITH_CBOR 1 requirements) 14 15if (requirements) 16 17 add_executable(${SAMP} ${SRCS}) 18 19 if (NOT (LWS_WITH_MBEDTLS AND NOT LWS_HAVE_mbedtls_internal_aes_encrypt)) 20 add_test(NAME api-test-cose COMMAND lws-api-test-cose) 21 endif() 22 23 if (websockets_shared) 24 target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) 25 add_dependencies(${SAMP} websockets_shared) 26 else() 27 target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS}) 28 endif() 29endif() 30