| 1 |
project(lws-crypto-cose-key C) |
| 2 |
cmake_minimum_required(VERSION 2.8.12) |
| 3 |
find_package(libwebsockets CONFIG REQUIRED) |
| 4 |
list(APPEND CMAKE_MODULE_PATH ${LWS_CMAKE_DIR}) |
| 5 |
include(CheckCSourceCompiles) |
| 6 |
include(LwsCheckRequirements) |
| 7 |
|
| 8 |
set(SAMP lws-crypto-cose-key) |
| 9 |
set(SRCS main.c) |
| 10 |
|
| 11 |
set(requirements 1) |
| 12 |
require_lws_config(LWS_WITH_COSE 1 requirements) |
| 13 |
|
| 14 |
if (requirements) |
| 15 |
|
| 16 |
add_executable(${SAMP} ${SRCS}) |
| 17 |
|
| 18 |
add_test(NAME crypto-cose-key-1 |
| 19 |
COMMAND lws-crypto-cose-key --stdin set1.cks ) |
| 20 |
add_test(NAME crypto-cose-key-2 |
| 21 |
COMMAND lws-crypto-cose-key --kty EC2 --curve P-256 --kid ctest-256 --stdout ctest-ec-256.key) |
| 22 |
add_test(NAME crypto-cose-key-3 |
| 23 |
COMMAND lws-crypto-cose-key --kty EC2 --curve P-384 --kid ctest-384 --stdout ctest-ec-384.key) |
| 24 |
add_test(NAME crypto-cose-key-4 |
| 25 |
COMMAND lws-crypto-cose-key --kty EC2 --curve P-521 --kid ctest-512 --stdout ctest-ec-512.key) |
| 26 |
add_test(NAME crypto-cose-key-5 |
| 27 |
COMMAND lws-crypto-cose-key --kty SYMMETRIC --bits 256 --stdout ctest-sym-256.key) |
| 28 |
add_test(NAME crypto-cose-key-6 |
| 29 |
COMMAND lws-crypto-cose-key --kty RSA --bits 2048 --stdout ctest-rsa-2048.key) |
| 30 |
add_test(NAME crypto-cose-key-7 |
| 31 |
COMMAND lws-crypto-cose-key --stdin ctest-rsa-2048.key) |
| 32 |
|
| 33 |
set_tests_properties(crypto-cose-key-1 |
| 34 |
crypto-cose-key-2 |
| 35 |
crypto-cose-key-3 |
| 36 |
crypto-cose-key-4 |
| 37 |
crypto-cose-key-5 |
| 38 |
crypto-cose-key-6 |
| 39 |
crypto-cose-key-7 |
| 40 |
PROPERTIES |
| 41 |
WORKING_DIRECTORY |
| 42 |
${CMAKE_SOURCE_DIR}/minimal-examples/crypto/minimal-crypto-cose-key |
| 43 |
TIMEOUT 5) |
| 44 |
|
| 45 |
set_tests_properties(crypto-cose-key-7 |
| 46 |
PROPERTIES |
| 47 |
DEPENDS crypto-cose-key-6) |
| 48 |
|
| 49 |
if (websockets_shared) |
| 50 |
target_link_libraries(${SAMP} websockets_shared ${LIBWEBSOCKETS_DEP_LIBS}) |
| 51 |
add_dependencies(${SAMP} websockets_shared) |
| 52 |
else() |
| 53 |
target_link_libraries(${SAMP} websockets ${LIBWEBSOCKETS_DEP_LIBS}) |
| 54 |
endif() |
| 55 |
endif() |