X-Git-Url: http://git.openwrt.org/?a=blobdiff_plain;f=CMakeLists.txt;h=c09fe51fcceb8b6677d3ef1e853842ed14b0c5fc;hb=16bf6f0f4b3bee60540af9b289d55faee2a3f86e;hp=bd8ce3fda7fd3dca2056492735fe22d15e2e680b;hpb=fdbedf748f4c2654fe85f613216a2dacc407c0a7;p=project%2Fustream-ssl.git diff --git a/CMakeLists.txt b/CMakeLists.txt index bd8ce3f..c09fe51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,27 +1,41 @@ 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 "") -#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/cyassl) -#LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib) -IF(APPLE) - INCLUDE_DIRECTORIES(/opt/local/include) - LINK_DIRECTORIES(/opt/local/lib) -ENDIF() - -IF (CYASSL) - SET(SSL_LIB 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) +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) -SET(CMAKE_INSTALL_PREFIX /usr) +INSTALL(FILES ustream-ssl.h + DESTINATION include/libubox +) +INSTALL(TARGETS ustream-ssl + LIBRARY DESTINATION lib +)