X-Git-Url: http://git.archive.openwrt.org/?a=blobdiff_plain;f=CMakeLists.txt;h=7e2ddf56b64476f3372fc5842648ab3fa3d9e983;hb=84c7f315bccabaa9853264a4e640f58cdb6b4ed4;hp=20f10d5cf9823f9b044370ccc38443b6d61ee814;hpb=4b9b0031cce397ab2945b664d6df9f3ac4ddb3f6;p=project%2Fustream-ssl.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 20f10d5..7e2ddf5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,7 @@ cmake_minimum_required(VERSION 2.6) +INCLUDE(CheckIncludeFiles) + PROJECT(ustream-ssl C) ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations) @@ -10,22 +12,30 @@ IF(APPLE) LINK_DIRECTORIES(/opt/local/lib) ENDIF() -IF (CYASSL) +IF(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 ustream-io.c) +ADD_LIBRARY(ustream-ssl SHARED ustream-ssl.c ${SSL_SRC}) TARGET_LINK_LIBRARIES(ustream-ssl ubox ${SSL_LIB}) -ADD_EXECUTABLE(ustream-example ustream-example.c) -TARGET_LINK_LIBRARIES(ustream-example ustream-ssl) - -SET(CMAKE_INSTALL_PREFIX /usr) +ADD_EXECUTABLE(ustream-example-server ustream-example-server.c) +TARGET_LINK_LIBRARIES(ustream-example-server ustream-ssl) -FILE(GLOB headers *.h) -INSTALL(FILES ${headers} +INSTALL(FILES ustream-ssl.h DESTINATION include/libubox ) INSTALL(TARGETS ustream-ssl