mirror of
https://github.com/libgit2/libgit2.git
synced 2026-01-25 02:56:17 +00:00
It's hard to remember whether it's `-DUSE_HTTPS=mbedTLS` or `-DUSE_HTTPS=mbedtls`. Even worse for things like `builtin` which we may have been inconsistent about. Allow for case insensitive options.
23 lines
625 B
CMake
23 lines
625 B
CMake
function(SanitizeInput 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)
|
|
else()
|
|
set(${VAR} "${VALUE}" PARENT_SCOPE)
|
|
endif()
|
|
endfunction()
|