summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorpsychocrypt <psychocrypt@users.noreply.github.com>2017-04-19 21:42:29 +0200
committerpsychocrypt <psychocrypt@users.noreply.github.com>2017-04-19 21:42:29 +0200
commit91fd7e20b18895818719419276c155a440cf51db (patch)
tree80eff8c8926780cee3322208e39071b8562a07f3 /CMakeLists.txt
parentc3650df13dea6ea27ee2c8016597e229fbdaf122 (diff)
downloadxmr-stak-91fd7e20b18895818719419276c155a440cf51db.zip
xmr-stak-91fd7e20b18895818719419276c155a440cf51db.tar.gz
always build feature complete
- throw an error if a compile dependancy is not fullfilled - add options to disable hard compile dependancies
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt25
1 files changed, 19 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49b7065..5aa8b16 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -45,10 +45,15 @@ set(LIBS ${LIBS} ${CMAKE_THREAD_LIBS_INIT})
# Find microhttpd
################################################################################
+option(MICROHTTPD_REQUIRED "Enable or disable the requirement of microhttp (http deamon)" ON)
find_library(MHTD NAMES microhttpd)
if("${MHTD}" STREQUAL "MHTD-NOTFOUND")
- message(STATUS "microhttpd NOT found: disable http server")
- add_definitions("-DCONF_NO_HTTPD")
+ if(MICROHTTPD_REQUIRED)
+ message(FATAL_ERROR "microhttpd NOT found: use `-DMICROHTTPD_REQUIRED=OFF` to build without http deamon support")
+ else()
+ message(STATUS "microhttpd NOT found: disable http server")
+ add_definitions("-DCONF_NO_HTTPD")
+ endif()
else()
set(LIBS ${LIBS} ${MHTD})
endif()
@@ -57,11 +62,19 @@ endif()
# Find OpenSSL
###############################################################################
+option(OpenSSL_REQUIRED "Enable or disable the requirement of OpenSSL" ON)
find_package(OpenSSL)
-include_directories(${OPENSSL_INCLUDE_DIR})
-set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
-if(NOT OPENSSL_FOUND)
- add_definitions("-DCONF_NO_TLS")
+if(OPENSSL_FOUND)
+ include_directories(${OPENSSL_INCLUDE_DIR})
+ set(LIBS ${LIBS} ${OPENSSL_LIBRARIES})
+else()
+ if(OpenSSL_REQUIRED)
+ message(FATAL_ERROR "OpenSSL NOT found: use `-DOpenSSL_REQUIRED=OFF` to build without SSL support")
+ else()
+ if(NOT OPENSSL_FOUND)
+ add_definitions("-DCONF_NO_TLS")
+ endif()
+ endif()
endif()
################################################################################
OpenPOWER on IntegriCloud