Add option to build without OpenSSL
This commit is contained in:
parent
7c44f73ec5
commit
c466ed82d5
1 changed files with 6 additions and 3 deletions
|
|
@ -4,6 +4,7 @@ project (Simple-Web-Server)
|
||||||
|
|
||||||
option(USE_STANDALONE_ASIO "set ON to use standalone Asio instead of Boost.Asio" OFF)
|
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(BUILD_TESTING "set ON to build library tests" OFF)
|
||||||
|
option(USE_OPENSSL "set OFF to build without OpenSSL" ON)
|
||||||
|
|
||||||
if(NOT MSVC)
|
if(NOT MSVC)
|
||||||
add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion)
|
add_compile_options(-std=c++11 -Wall -Wextra -Wsign-conversion)
|
||||||
|
|
@ -49,7 +50,9 @@ endif()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
|
set(OPENSSL_ROOT_DIR "/usr/local/opt/openssl")
|
||||||
endif()
|
endif()
|
||||||
find_package(OpenSSL)
|
if(USE_OPENSSL)
|
||||||
|
find_package(OpenSSL)
|
||||||
|
endif()
|
||||||
if(OPENSSL_FOUND)
|
if(OPENSSL_FOUND)
|
||||||
target_compile_definitions(simple-web-server INTERFACE HAVE_OPENSSL)
|
target_compile_definitions(simple-web-server INTERFACE HAVE_OPENSSL)
|
||||||
target_link_libraries(simple-web-server INTERFACE ${OPENSSL_LIBRARIES})
|
target_link_libraries(simple-web-server INTERFACE ${OPENSSL_LIBRARIES})
|
||||||
|
|
@ -70,9 +73,9 @@ if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
target_link_libraries(https_examples ${Boost_LIBRARIES})
|
target_link_libraries(https_examples ${Boost_LIBRARIES})
|
||||||
target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR})
|
target_include_directories(https_examples PRIVATE ${Boost_INCLUDE_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(BUILD_TESTING ON)
|
set(BUILD_TESTING ON)
|
||||||
|
|
||||||
install(FILES asio_compatibility.hpp server_http.hpp client_http.hpp server_https.hpp client_https.hpp crypto.hpp utility.hpp status_code.hpp mutex.hpp DESTINATION include/simple-web-server)
|
install(FILES asio_compatibility.hpp server_http.hpp client_http.hpp server_https.hpp client_https.hpp crypto.hpp utility.hpp status_code.hpp mutex.hpp DESTINATION include/simple-web-server)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue