Remove CyaSSL, WolfSSL < 3.10.4 support
[project/ustream-ssl.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 PROJECT(ustream-ssl C)
4 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
5
6 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
7
8 IF(MBEDTLS)
9 ADD_DEFINITIONS(-DHAVE_MBEDTLS)
10 SET(SSL_SRC ustream-mbedtls.c)
11 SET(SSL_LIB mbedtls mbedcrypto mbedx509 m)
12 ELSEIF(WOLFSSL)
13 ADD_DEFINITIONS(-DHAVE_WOLFSSL)
14 SET(SSL_SRC ustream-io-wolfssl.c ustream-openssl.c)
15 SET(SSL_LIB wolfssl m)
16 ELSE()
17 SET(SSL_SRC ustream-io-openssl.c ustream-openssl.c)
18 SET(SSL_LIB crypto ssl)
19 ENDIF()
20
21 FIND_PATH(ubox_include_dir libubox/ustream.h)
22 INCLUDE_DIRECTORIES(${ubox_include_dir})
23
24 ADD_LIBRARY(ustream-ssl SHARED ustream-ssl.c ${SSL_SRC})
25 TARGET_LINK_LIBRARIES(ustream-ssl ubox ${SSL_LIB})
26
27 ADD_EXECUTABLE(ustream-example-server ustream-example-server.c)
28 TARGET_LINK_LIBRARIES(ustream-example-server ustream-ssl)
29
30 ADD_EXECUTABLE(ustream-example-client ustream-example-client.c)
31 TARGET_LINK_LIBRARIES(ustream-example-client ustream-ssl)
32
33 INSTALL(FILES ustream-ssl.h
34 DESTINATION include/libubox
35 )
36 INSTALL(TARGETS ustream-ssl
37 LIBRARY DESTINATION lib
38 )