Skip to content

Commit

Permalink
Merge pull request #387 from tguillem/cmake-libkrb5-option
Browse files Browse the repository at this point in the history
cmake: add ENABLE_LIBKRB5 and ENABLE_GSSAPI options
  • Loading branch information
sahlberg authored Dec 17, 2024
2 parents 79e2a7f + 3e0f794 commit aad9f7b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
19 changes: 14 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions cmake/ConfigureChecks.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit aad9f7b

Please sign in to comment.