polarssl: init certificate storage
[project/ustream-ssl.git] / CMakeLists.txt
index 7e2ddf56b64476f3372fc5842648ab3fa3d9e983..c1c2b32d72eb0267dbe354a588baf05bfb5281fa 100644 (file)
@@ -7,12 +7,11 @@ ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
 
 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
 
-IF(APPLE)
-  INCLUDE_DIRECTORIES(/opt/local/include)
-  LINK_DIRECTORIES(/opt/local/lib)
-ENDIF()
-
-IF(POLARSSL)
+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)
@@ -35,6 +34,9 @@ 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
 )