Files
libgit2/cmake/SelectI18n.cmake
Edward Thomson 4546929e00 cmake: case insensitive options
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.
2025-01-02 12:36:46 +00:00

41 lines
1018 B
CMake

include(SanitizeInput)
find_package(IntlIconv)
if(USE_I18N STREQUAL "" AND NOT USE_ICONV STREQUAL "")
sanitizeinput(USE_ICONV)
set(USE_I18N "${USE_ICONV}")
endif()
if(USE_I18N STREQUAL "")
set(USE_I18N ON)
endif()
sanitizeinput(USE_I18N)
if(USE_I18N)
if(USE_I18N STREQUAL ON)
if(ICONV_FOUND)
set(USE_I18N "iconv")
else()
message(FATAL_ERROR "Unable to detect internationalization support")
endif()
endif()
if(USE_I18N STREQUAL "iconv")
else()
message(FATAL_ERROR "unknown internationalization backend: ${USE_I18N}")
endif()
list(APPEND LIBGIT2_SYSTEM_INCLUDES ${ICONV_INCLUDE_DIR})
list(APPEND LIBGIT2_SYSTEM_LIBS ${ICONV_LIBRARIES})
list(APPEND LIBGIT2_PC_LIBS ${ICONV_LIBRARIES})
set(GIT_I18N 1)
set(GIT_I18N_ICONV 1)
add_feature_info("Internationalization" ON "using ${USE_I18N}")
else()
set(GIT_I18N 0)
add_feature_info("Internationalization" OFF "internationalization support is disabled")
endif()