summaryrefslogtreecommitdiff
blob: 846737ede079fe24d8c6af076335b0f6c7a4e4e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff -aurN a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake
--- a/plugin/auth_gssapi/cmake/FindGSSAPI.cmake	2017-05-14 19:13:17.000000000 -0400
+++ b/plugin/auth_gssapi/cmake/FindGSSAPI.cmake	2017-06-28 14:42:30.307704810 -0400
@@ -39,6 +39,29 @@
 
 else(GSSAPI_LIBS AND GSSAPI_FLAVOR)
 
+  find_package(PkgConfig)
+  IF(PKG_CONFIG_FOUND)
+    pkg_check_modules(GSSAPI mit-krb5-gssapi mit-krb5)
+    IF(GSSAPI_FOUND)
+      set(GSSAPI_FLAVOR "MIT")
+    ELSE()
+      pkg_check_modules(GSSAPI heimdal-gssapi heimdal-krb5)
+      IF(GSSAPI_FOUND)
+        set(GSSAPI_FLAVOR "HEIMDAL")
+      ENDIF()
+    ENDIF()
+    IF(GSSAPI_FOUND)
+      message(STATUS "Found GSSAPI: ${GSSAPI_LIBRARIES}")
+
+      set(GSSAPI_INCS ${GSSAPI_INCLUDE_DIRS} CACHE STRING "" FORCE)
+      set(GSSAPI_LIBS ${GSSAPI_LIBRARIES} CACHE STRING "" FORCE)
+      set(GSSAPI_FLAVOR ${GSSAPI_FLAVOR} CACHE STRING "" FORCE)
+
+      mark_as_advanced(GSSAPI_INCS GSSAPI_LIBS GSSAPI_FLAVOR)
+      RETURN()
+    ENDIF()
+  ENDIF(PKG_CONFIG_FOUND)
+
   find_program(KRB5_CONFIG NAMES krb5-config heimdal-krb5-config PATHS
      /opt/local/bin
      ONLY_CMAKE_FIND_ROOT_PATH               # this is required when cross compiling with cmake 2.6 and ignored with cmake 2.4, Alex