Add option to build without OpenSSL

This commit is contained in:
Fabian Sandoval Saldias 2019-07-09 15:26:46 +02:00
commit c466ed82d5

View file

@ -4,6 +4,7 @@ project (Simple-Web-Server)
option(USE_STANDALONE_ASIO "set ON to use standalone Asio instead of Boost.Asio" OFF)
option(BUILD_TESTING "set ON to build library tests" OFF)
option(USE_OPENSSL "set OFF to build without OpenSSL" ON)
if(NOT MSVC)
add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion)
@ -49,7 +50,9 @@ endif()
if(APPLE)
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
endif()
if(USE_OPENSSL)
find_package(OpenSSL)
endif()
if(OPENSSL_FOUND)
target_compile_definitions(simple-web-server INTERFACE HAVE_OPENSSL)
target_link_libraries(simple-web-server INTERFACE ${OPENSSL_LIBRARIES})