allow to fully disable OpenSSL and microhttpd
- rename option `*_REQUIRED` to `*_ENABLE` - allow to disable the dependency OpenSSL and microhttpd
This commit is contained in:
parent
28b29179f4
commit
85f2b67df0
|
@ -56,36 +56,33 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||||
# Find microhttpd
|
# Find microhttpd
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
option(MICROHTTPD_REQUIRED "Enable or disable the requirement of microhttp (http deamon)" ON)
|
option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
|
||||||
find_library(MHTD NAMES microhttpd)
|
if(MICROHTTPD_ENABLE)
|
||||||
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
|
find_library(MHTD NAMES microhttpd)
|
||||||
if(MICROHTTPD_REQUIRED)
|
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
|
||||||
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_REQUIRED=OFF` to build without http deamon support")
|
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
|
||||||
else()
|
else()
|
||||||
message(STATUS "microhttpd NOT found: disable http server")
|
set(LIBS ${LIBS} ${MHTD})
|
||||||
add_definitions("-DCONF_NO_HTTPD")
|
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(LIBS ${LIBS} ${MHTD})
|
add_definitions("-DCONF_NO_HTTPD")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Find OpenSSL
|
# Find OpenSSL
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
option(OpenSSL_REQUIRED "Enable or disable the requirement of OpenSSL" ON)
|
option(OpenSSL_ENABLE "Enable or disable the requirement of OpenSSL" ON)
|
||||||
find_package(OpenSSL)
|
if(OpenSSL_ENABLE)
|
||||||
if(OPENSSL_FOUND)
|
find_package(OpenSSL)
|
||||||
include_directories(${OPENSSL_INCLUDE_DIR})
|
if(OPENSSL_FOUND)
|
||||||
set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
|
include_directories(${OPENSSL_INCLUDE_DIR})
|
||||||
else()
|
set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
|
||||||
if(OpenSSL_REQUIRED)
|
|
||||||
message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_REQUIRED=OFF` to build without SSL support")
|
|
||||||
else()
|
else()
|
||||||
if(NOT OPENSSL_FOUND)
|
message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_ENABLE=OFF` to build without SSL support")
|
||||||
add_definitions("-DCONF_NO_TLS")
|
|
||||||
endif()
|
|
||||||
endif()
|
endif()
|
||||||
|
else()
|
||||||
|
add_definitions("-DCONF_NO_TLS")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
Loading…
Reference in New Issue