avoid installing internal header files
[project/ustream-ssl.git] / CMakeLists.txt
index bd8ce3f..f6009e7 100644 (file)
@@ -5,23 +5,32 @@ 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)
+  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)
+INSTALL(FILES ustream-ssl.h
+       DESTINATION include/libubox
+)
+INSTALL(TARGETS ustream-ssl
+       LIBRARY DESTINATION lib
+)