2016-12-06 13:42:53 +00:00
|
|
|
set (OPENSSL_USE_STATIC_LIBS ${USE_STATIC_LIBRARIES})
|
|
|
|
if (APPLE)
|
2017-04-01 07:20:54 +00:00
|
|
|
set (OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
|
2017-12-16 01:38:37 +00:00
|
|
|
# https://rt.openssl.org/Ticket/Display.html?user=guest&pass=guest&id=2232
|
|
|
|
if (USE_STATIC_LIBRARIES)
|
|
|
|
message(WARNING "Disable USE_STATIC_LIBRARIES if you have linking problems with OpenSSL on MacOS")
|
|
|
|
endif ()
|
2016-12-06 13:42:53 +00:00
|
|
|
endif ()
|
|
|
|
find_package (OpenSSL)
|
|
|
|
if (NOT OPENSSL_FOUND)
|
2017-04-01 07:20:54 +00:00
|
|
|
# Try to find manually.
|
2017-11-04 17:58:11 +00:00
|
|
|
set (OPENSSL_INCLUDE_PATHS "/usr/local/opt/openssl/include")
|
2017-04-01 07:20:54 +00:00
|
|
|
set (OPENSSL_PATHS "/usr/local/opt/openssl/lib")
|
2017-11-04 17:58:11 +00:00
|
|
|
find_path (OPENSSL_INCLUDE_DIR NAMES openssl/ssl.h PATHS ${OPENSSL_INCLUDE_PATHS})
|
2017-04-01 07:20:54 +00:00
|
|
|
find_library (OPENSSL_SSL_LIBRARY ssl PATHS ${OPENSSL_PATHS})
|
|
|
|
find_library (OPENSSL_CRYPTO_LIBRARY crypto PATHS ${OPENSSL_PATHS})
|
2017-11-04 17:58:11 +00:00
|
|
|
if (OPENSSL_SSL_LIBRARY AND OPENSSL_CRYPTO_LIBRARY AND OPENSSL_INCLUDE_DIR)
|
2017-04-19 00:21:16 +00:00
|
|
|
set (OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY})
|
|
|
|
set (OPENSSL_FOUND 1)
|
|
|
|
endif ()
|
2016-12-06 13:42:53 +00:00
|
|
|
endif ()
|
2017-01-27 20:00:02 +00:00
|
|
|
|
2017-04-19 00:21:16 +00:00
|
|
|
if (OPENSSL_FOUND)
|
|
|
|
include_directories (${OPENSSL_INCLUDE_DIR})
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
message (STATUS "Using openssl=${OPENSSL_FOUND}: ${OPENSSL_INCLUDE_DIR} : ${OPENSSL_LIBRARIES}")
|