fix compile errors on linux
[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 #INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include/cyassl)
9 #LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib)
10 IF(APPLE)
11   INCLUDE_DIRECTORIES(/opt/local/include)
12   LINK_DIRECTORIES(/opt/local/lib)
13 ENDIF()
14
15 IF (CYASSL)
16   SET(SSL_LIB cyassl)
17 ELSE()
18   SET(SSL_LIB crypto ssl)
19 ENDIF()
20
21 ADD_LIBRARY(ustream-ssl SHARED ustream-ssl.c ustream-io.c)
22 TARGET_LINK_LIBRARIES(ustream-ssl ubox ${SSL_LIB})
23
24 ADD_EXECUTABLE(ustream-example ustream-example.c)
25 TARGET_LINK_LIBRARIES(ustream-example ustream-ssl)
26
27 SET(CMAKE_INSTALL_PREFIX /usr)
28
29 FILE(GLOB headers *.h)
30 INSTALL(FILES ${headers}
31         DESTINATION include/libubox
32 )
33 INSTALL(TARGETS ustream-ssl
34         LIBRARY DESTINATION lib
35 )