blob: c1c2b32d72eb0267dbe354a588baf05bfb5281fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
cmake_minimum_required(VERSION 2.6)
INCLUDE(CheckIncludeFiles)
PROJECT(ustream-ssl C)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
IF(MBEDTLS)
ADD_DEFINITIONS(-DHAVE_MBEDTLS)
SET(SSL_SRC ustream-mbedtls.c)
SET(SSL_LIB mbedtls mbedcrypto mbedx509 m)
ELSEIF(POLARSSL)
ADD_DEFINITIONS(-DHAVE_POLARSSL)
SET(SSL_SRC ustream-polarssl.c)
SET(SSL_LIB polarssl m)
ELSEIF(CYASSL)
CHECK_INCLUDE_FILES (cyassl/version.h HAVE_CYASSL_VERSION_H)
SET(CMAKE_EXTRA_INCLUDE_FILES cyassl/ssl.h)
IF (HAVE_CYASSL_VERSION_H)
ADD_DEFINITIONS(-DHAVE_CYASSL_VERSION_H)
ENDIF()
SET(SSL_SRC ustream-io-cyassl.c ustream-openssl.c)
SET(SSL_LIB cyassl m)
ELSE()
SET(SSL_SRC ustream-io-openssl.c ustream-openssl.c)
SET(SSL_LIB crypto ssl)
ENDIF()
ADD_LIBRARY(ustream-ssl SHARED ustream-ssl.c ${SSL_SRC})
TARGET_LINK_LIBRARIES(ustream-ssl ubox ${SSL_LIB})
ADD_EXECUTABLE(ustream-example-server ustream-example-server.c)
TARGET_LINK_LIBRARIES(ustream-example-server ustream-ssl)
ADD_EXECUTABLE(ustream-example-client ustream-example-client.c)
TARGET_LINK_LIBRARIES(ustream-example-client ustream-ssl)
INSTALL(FILES ustream-ssl.h
DESTINATION include/libubox
)
INSTALL(TARGETS ustream-ssl
LIBRARY DESTINATION lib
)
|