Unverified Commit e23b8b44 by Edward Thomson Committed by GitHub

Merge pull request #5422 from pks-t/pks/cmake-booleans

CMake booleans
parents 8eb1fc36 d8e71cb2
FUNCTION(SanitizeBool VAR)
STRING(TOLOWER "${${VAR}}" VALUE)
IF(VALUE STREQUAL "on")
SET(${VAR} "ON" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "yes")
SET(${VAR} "ON" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "true")
SET(${VAR} "ON" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "1")
SET(${VAR} "ON" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "off")
SET(${VAR} "OFF" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "no")
SET(${VAR} "OFF" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "false")
SET(${VAR} "OFF" PARENT_SCOPE)
ELSEIF(VALUE STREQUAL "0")
SET(${VAR} "OFF" PARENT_SCOPE)
ENDIF()
ENDFUNCTION()
......@@ -2,12 +2,15 @@
# We try to find any packages our backends might use
INCLUDE(SanitizeBool)
FIND_PACKAGE(GSSAPI)
IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
INCLUDE(FindGSSFramework)
ENDIF()
# Auto-select GSS backend
SanitizeBool(USE_GSSAPI)
IF (USE_GSSAPI STREQUAL ON)
IF (GSSFRAMEWORK_FOUND)
SET(GSS_BACKEND "GSS.framework")
......
# Select the backend to use
INCLUDE(SanitizeBool)
# We try to find any packages our backends might use
FIND_PACKAGE(OpenSSL)
FIND_PACKAGE(mbedTLS)
......@@ -9,6 +11,7 @@ IF (CMAKE_SYSTEM_NAME MATCHES "Darwin")
ENDIF()
# Auto-select TLS backend
SanitizeBool(USE_HTTPS)
IF (USE_HTTPS STREQUAL ON)
IF (SECURITY_FOUND)
IF (SECURITY_HAS_SSLCREATECONTEXT)
......
# Select a hash backend
INCLUDE(SanitizeBool)
# USE_SHA1=CollisionDetection(ON)/HTTPS/Generic/OFF
SanitizeBool(USE_SHA1)
IF(USE_SHA1 STREQUAL ON OR USE_SHA1 STREQUAL "CollisionDetection")
SET(SHA1_BACKEND "CollisionDetection")
ELSEIF(USE_SHA1 STREQUAL "HTTPS")
......
......@@ -28,7 +28,7 @@ SET(LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to.")
SET(INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to.")
# Enable tracing
IF (ENABLE_TRACE STREQUAL "ON")
IF(ENABLE_TRACE)
SET(GIT_TRACE 1)
ENDIF()
ADD_FEATURE_INFO(tracing GIT_TRACE "tracing support")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment