2014-07-10 22:06:10 -05:00
|
|
|
include_directories(
|
|
|
|
.
|
|
|
|
../include
|
|
|
|
../include/compat
|
|
|
|
)
|
|
|
|
|
|
|
|
set(
|
|
|
|
TLS_SRC
|
|
|
|
tls.c
|
2016-06-28 03:29:54 +02:00
|
|
|
tls_bio_cb.c
|
2014-07-10 22:06:10 -05:00
|
|
|
tls_client.c
|
|
|
|
tls_config.c
|
2015-09-13 03:48:46 -05:00
|
|
|
tls_conninfo.c
|
2014-07-10 22:06:10 -05:00
|
|
|
tls_server.c
|
2015-09-13 03:48:46 -05:00
|
|
|
tls_peer.c
|
2014-07-10 22:06:10 -05:00
|
|
|
tls_util.c
|
|
|
|
tls_verify.c
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2016-04-04 11:28:46 +09:00
|
|
|
if(NOT HAVE_STRSEP)
|
2014-07-10 22:06:10 -05:00
|
|
|
set(TLS_SRC ${TLS_SRC} strsep.c)
|
|
|
|
endif()
|
|
|
|
|
2016-04-11 12:59:23 +09:00
|
|
|
if(NOT "${OPENSSLDIR}" STREQUAL "")
|
|
|
|
add_definitions(-D_PATH_SSL_CA_FILE=\"${OPENSSLDIR}/cert.pem\")
|
|
|
|
else()
|
|
|
|
add_definitions(-D_PATH_SSL_CA_FILE=\"${CMAKE_INSTALL_PREFIX}/etc/ssl/cert.pem\")
|
|
|
|
endif()
|
|
|
|
|
2015-09-07 01:05:33 -05:00
|
|
|
if (BUILD_SHARED)
|
2015-09-09 05:15:06 -05:00
|
|
|
add_library(tls-objects OBJECT ${TLS_SRC})
|
|
|
|
add_library(tls STATIC $<TARGET_OBJECTS:tls-objects>)
|
2015-09-07 01:05:33 -05:00
|
|
|
add_library(tls-shared SHARED $<TARGET_OBJECTS:tls-objects>)
|
2016-08-25 18:17:12 +09:00
|
|
|
if (WIN32)
|
2016-09-06 23:25:28 +09:00
|
|
|
target_sources(tls-shared PRIVATE
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/tls.def)
|
2016-07-31 17:11:19 -05:00
|
|
|
target_link_libraries(tls-shared ssl-shared crypto-shared Ws2_32.lib)
|
2016-08-25 18:17:27 +09:00
|
|
|
set(TLS_POSTFIX -${TLS_MAJOR_VERSION})
|
2016-07-31 17:11:19 -05:00
|
|
|
endif()
|
2016-08-25 18:17:27 +09:00
|
|
|
set_target_properties(tls-shared PROPERTIES
|
2016-09-06 23:25:28 +09:00
|
|
|
OUTPUT_NAME tls${TLS_POSTFIX}
|
|
|
|
ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX})
|
2015-09-09 05:15:06 -05:00
|
|
|
set_target_properties(tls-shared PROPERTIES VERSION ${TLS_VERSION}
|
|
|
|
SOVERSION ${TLS_MAJOR_VERSION})
|
|
|
|
install(TARGETS tls tls-shared DESTINATION lib)
|
|
|
|
else()
|
|
|
|
add_library(tls STATIC ${TLS_SRC})
|
|
|
|
install(TARGETS tls DESTINATION lib)
|
2015-09-07 01:05:33 -05:00
|
|
|
endif()
|
|
|
|
|