From: Shuanglei Tao Date: Wed, 30 Dec 2020 13:06:53 +0000 (+0800) Subject: cmake: add openssl check back X-Git-Url: http://git.prime8.dev/?a=commitdiff_plain;h=d96492a0580afc02eca5fc8e0550833f63c655ea;p=ttyd.git cmake: add openssl check back --- 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)