From d96492a0580afc02eca5fc8e0550833f63c655ea Mon Sep 17 00:00:00 2001 From: Shuanglei Tao Date: Wed, 30 Dec 2020 21:06:53 +0800 Subject: [PATCH] cmake: add openssl check back --- CMakeLists.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e41c629..4e27924 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,15 @@ endif() set(INCLUDE_DIRS ${ZLIB_INCLUDE_DIR} ${LIBWEBSOCKETS_INCLUDE_DIRS} ${JSON-C_INCLUDE_DIRS} ${LIBUV_INCLUDE_DIRS}) set(LINK_LIBS ${ZLIB_LIBRARIES} ${LIBWEBSOCKETS_LIBRARIES} ${JSON-C_LIBRARIES} ${LIBUV_LIBRARIES}) +set (CMAKE_REQUIRED_INCLUDES ${INCLUDE_DIRS}) +include(CheckSymbolExists) +check_symbol_exists(LWS_OPENSSL_SUPPORT "lws_config.h" LWS_OPENSSL_ENABLED) +if(LWS_OPENSSL_ENABLED) + find_package(OpenSSL REQUIRED) + list(APPEND INCLUDE_DIRS ${OPENSSL_INCLUDE_DIR}) + list(APPEND LINK_LIBS ${OPENSSL_LIBRARIES}) +endif() + if(WIN32) list(APPEND LINK_LIBS shell32) elseif(NOT APPLE) -- 2.43.4