diff --git a/CMakeLists.txt b/CMakeLists.txt index 0252451e..562b8e26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,14 +57,19 @@ endif() option(BUILD_SHARED_LIBS "Build shared libraries" ON) endif() option(ENABLE_EXAMPLES "Build example programs" OFF) - + option(ENABLE_LIBKRB5 "Enable libkrb5 support" ON) + option(ENABLE_GSSAPI "Enable gssapi support" ON) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules) endif() if(CMAKE_SYSTEM_NAME MATCHES Linux) - find_package(LibKrb5) + if (ENABLE_LIBKRB5) + find_package(LibKrb5) + endif() elseif(IOS) - find_package(GSSAPI) + if (ENABLE_GSSAPI) + find_package(GSSAPI) + endif() endif() if(NOT ESP_PLATFORM) @@ -95,9 +100,13 @@ endif() endif() if(CMAKE_SYSTEM_NAME MATCHES Linux) - set(core_DEPENDS ${LIBKRB5_LIBRARY} CACHE STRING "" FORCE) + if (ENABLE_LIBKRB5) + set(core_DEPENDS ${LIBKRB5_LIBRARY} CACHE STRING "" FORCE) + endif() elseif(IOS) - set(core_DEPENDS ${GSSAPI_LIBRARIES} CACHE STRING "" FORCE) + if (ENABLE_GSSAPI) + set(core_DEPENDS ${GSSAPI_LIBRARIES} CACHE STRING "" FORCE) + endif() endif() if(MSVC AND BUILD_SHARED_LIBS) diff --git a/cmake/ConfigureChecks.cmake b/cmake/ConfigureChecks.cmake index a28846ad..d59d8905 100644 --- a/cmake/ConfigureChecks.cmake +++ b/cmake/ConfigureChecks.cmake @@ -6,8 +6,12 @@ endif() check_include_file("arpa/inet.h" HAVE_ARPA_INET_H) check_include_file("dlfcn.h" HAVE_DLFCN_H) check_include_file("fcntl.h" HAVE_FCNTL_H) +if (ENABLE_GSSAPI) check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) +endif() +if (ENABLE_LIBKRB5) check_include_file("krb5/krb5.h" HAVE_LIBKRB5) +endif() check_include_file("inttypes.h" HAVE_INTTYPES_H) check_include_file("netdb.h" HAVE_NETDB_H) check_include_file("netinet/in.h" HAVE_NETINET_IN_H)