Merge pull request #25 from psychocrypt/topic-cmakeAlwaysFeaturecomplete

always build feature complete
This commit is contained in:
fireice-uk 2017-05-02 17:28:40 +01:00 committed by GitHub
commit 91d6b36419
1 changed files with 19 additions and 9 deletions

View File

@ -59,22 +59,32 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
# Find microhttpd # Find microhttpd
################################################################################ ################################################################################
find_library(MHTD NAMES microhttpd) option(MICROHTTPD_ENABLE "Enable or disable the requirement of microhttp (http deamon)" ON)
if("${MHTD}" STREQUAL "MHTD-NOTFOUND") if(MICROHTTPD_ENABLE)
message(STATUS "microhttpd NOT found: disable http server") find_library(MHTD NAMES microhttpd)
add_definitions("-DCONF_NO_HTTPD") if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support")
else()
set(LIBS ${LIBS} ${MHTD})
endif()
else() else()
set(LIBS ${LIBS} ${MHTD}) add_definitions("-DCONF_NO_HTTPD")
endif() endif()
############################################################################### ###############################################################################
# Find OpenSSL # Find OpenSSL
############################################################################### ###############################################################################
find_package(OpenSSL) option(OpenSSL_ENABLE "Enable or disable the requirement of OpenSSL" ON)
include_directories(${OPENSSL_INCLUDE_DIR}) if(OpenSSL_ENABLE)
set(LIBS ${LIBS} ${OPENSSL_LIBRARIES}) find_package(OpenSSL)
if(NOT OPENSSL_FOUND) if(OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
else()
message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_ENABLE=OFF` to build without SSL support")
endif()
else()
add_definitions("-DCONF_NO_TLS") add_definitions("-DCONF_NO_TLS")
endif() endif()