Hash :
0b8343ac
Author :
Date :
2018-10-05T22:59:44
Fix cmake to generate proper Libs.private in .pc files
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
set(
TLS_SRC
tls.c
tls_bio_cb.c
tls_client.c
tls_config.c
tls_conninfo.c
tls_keypair.c
tls_server.c
tls_ocsp.c
tls_peer.c
tls_util.c
tls_verify.c
)
if(WIN32)
set(
TLS_SRC
${TLS_SRC}
compat/ftruncate.c
compat/getuid.c
compat/pread.c
compat/pwrite.c
)
endif()
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()
add_library(tls ${TLS_SRC})
target_include_directories(tls
PRIVATE
.
../include/compat
PUBLIC
../include)
if (BUILD_SHARED_LIBS)
export_symbol(tls ${CMAKE_CURRENT_SOURCE_DIR}/tls.sym)
target_link_libraries(tls ssl crypto ${PLATFORM_LIBS})
if (WIN32)
set(TLS_POSTFIX -${TLS_MAJOR_VERSION})
endif()
set_target_properties(tls PROPERTIES
OUTPUT_NAME tls${TLS_POSTFIX}
ARCHIVE_OUTPUT_NAME tls${TLS_POSTFIX})
set_target_properties(tls PROPERTIES VERSION ${TLS_VERSION}
SOVERSION ${TLS_MAJOR_VERSION})
endif()
if(ENABLE_LIBRESSL_INSTALL)
install(
TARGETS tls
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif(ENABLE_LIBRESSL_INSTALL)