• source navigation  • diff markup  • identifier search  • freetext search  • 

Sources/ustream-ssl/CMakeLists.txt

  1 cmake_minimum_required(VERSION 2.6)
  2 
  3 INCLUDE(CheckSymbolExists)
  4 
  5 PROJECT(ustream-ssl C)
  6 ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
  7 
  8 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
  9 
 10 IF(MBEDTLS)
 11   ADD_DEFINITIONS(-DHAVE_MBEDTLS)
 12   SET(SSL_SRC ustream-mbedtls.c)
 13   SET(SSL_LIB mbedtls mbedcrypto mbedx509 m)
 14 ELSEIF(WOLFSSL)
 15   ADD_DEFINITIONS(-DHAVE_WOLFSSL)
 16   SET(SSL_SRC ustream-io-wolfssl.c ustream-openssl.c)
 17   SET(SSL_LIB wolfssl m)
 18   SET(CMAKE_REQUIRED_LIBRARIES "-lwolfssl -lm")
 19   CHECK_SYMBOL_EXISTS (wolfSSL_SSLSetIORecv "wolfssl/ssl.h"
 20                        HAVE_WOLFSSL_SSLSETIORECV)
 21   IF (NOT HAVE_WOLFSSL_SSLSETIORECV)
 22     ADD_DEFINITIONS(-DNO_WOLFSSL_SSLSETIO_SEND_RECV)
 23   ENDIF()
 24   CHECK_SYMBOL_EXISTS (wolfSSL_X509_check_host
 25                        "wolfssl/options.h;wolfssl/ssl.h"
 26                        HAVE_WOLFSSL_X509_CHECK_HOST)
 27   IF (NOT HAVE_WOLFSSL_X509_CHECK_HOST)
 28     ADD_DEFINITIONS(-DNO_X509_CHECK_HOST)
 29   ENDIF()
 30 ELSE()
 31   SET(SSL_SRC ustream-io-openssl.c ustream-openssl.c)
 32   SET(SSL_LIB crypto ssl)
 33 ENDIF()
 34 
 35 FIND_PATH(ubox_include_dir libubox/ustream.h)
 36 INCLUDE_DIRECTORIES(${ubox_include_dir})
 37 
 38 ADD_LIBRARY(ustream-ssl SHARED ustream-ssl.c ${SSL_SRC})
 39 TARGET_LINK_LIBRARIES(ustream-ssl ubox ${SSL_LIB})
 40 
 41 ADD_EXECUTABLE(ustream-example-server ustream-example-server.c)
 42 TARGET_LINK_LIBRARIES(ustream-example-server ustream-ssl)
 43 
 44 ADD_EXECUTABLE(ustream-example-client ustream-example-client.c)
 45 TARGET_LINK_LIBRARIES(ustream-example-client ustream-ssl)
 46 
 47 INSTALL(FILES ustream-ssl.h
 48         DESTINATION include/libubox
 49 )
 50 INSTALL(TARGETS ustream-ssl
 51         LIBRARY DESTINATION lib
 52 )

This page was automatically generated by LXR 0.3.1.  •  OpenWrt