diff options
author | Mark Nunberg <mnunberg@users.noreply.github.com> | 2019-09-16 06:05:46 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-16 06:05:46 -0400 |
commit | bd2c8fedf75f4e60225dfd6c735068a88666839a (patch) | |
tree | ab4bd11eebd2b8f0bb1c4b905d81570f86b9f7ee /CMakeLists.txt | |
parent | 1ac8fca35de6d9ecc1b6b94cbd17aa7499cb8821 (diff) | |
parent | dd408e8e3f90ab9de61a1d7fac711d2b5d7e1592 (diff) |
Merge pull request #708 from yossigo/wip/ssl-reorganization
SSL Reorganization
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 30140bf..9e78894 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.4.0) INCLUDE(GNUInstallDirs) PROJECT(hiredis) -OPTION(HIREDIS_SSL "Link against OpenSSL" OFF) +OPTION(ENABLE_SSL "Build hiredis_ssl for SSL support" OFF) MACRO(getVersionBit name) SET(VERSION_REGEX "^#define ${name} (.+)$") @@ -29,8 +29,7 @@ ADD_LIBRARY(hiredis SHARED net.c read.c sds.c - sockcompat.c - sslio.c) + sockcompat.c) SET_TARGET_PROPERTIES(hiredis PROPERTIES @@ -54,16 +53,27 @@ INSTALL(DIRECTORY adapters INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) -IF(HIREDIS_SSL) +IF(ENABLE_SSL) IF (NOT OPENSSL_ROOT_DIR) IF (APPLE) SET(OPENSSL_ROOT_DIR "/usr/local/opt/openssl") ENDIF() ENDIF() FIND_PACKAGE(OpenSSL REQUIRED) - TARGET_COMPILE_DEFINITIONS(hiredis PRIVATE HIREDIS_SSL) - TARGET_INCLUDE_DIRECTORIES(hiredis PRIVATE "${OPENSSL_INCLUDE_DIR}") - TARGET_LINK_LIBRARIES(hiredis PRIVATE ${OPENSSL_LIBRARIES}) + ADD_LIBRARY(hiredis_ssl SHARED + ssl.c) + TARGET_INCLUDE_DIRECTORIES(hiredis_ssl PRIVATE "${OPENSSL_INCLUDE_DIR}") + TARGET_LINK_LIBRARIES(hiredis_ssl PRIVATE ${OPENSSL_LIBRARIES}) + CONFIGURE_FILE(hiredis_ssl.pc.in hiredis_ssl.pc @ONLY) + + INSTALL(TARGETS hiredis_ssl + DESTINATION "${CMAKE_INSTALL_LIBDIR}") + + INSTALL(FILES hiredis_ssl.h + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/hiredis) + + INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/hiredis_ssl.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) ENDIF() IF(NOT (WIN32 OR MINGW)) |