aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindKERBEROS.cmake
diff options
context:
space:
mode:
authorJörg Mayer <jmayer@loplof.de>2009-09-10 07:04:54 +0000
committerJörg Mayer <jmayer@loplof.de>2009-09-10 07:04:54 +0000
commit9250a69a9976617c735679aa5383e53802e5b43e (patch)
tree99eb52cccfc2a1672730ac456218933c25d614a1 /cmake/modules/FindKERBEROS.cmake
parent159904bdc49b8d3c35503d057d16bff7336767e1 (diff)
Update to add the last missing detection stuff.
Some of it is untested, kerberos is currently a hack. Apart from that, package detection should be complete. svn path=/trunk/; revision=29838
Diffstat (limited to 'cmake/modules/FindKERBEROS.cmake')
-rw-r--r--cmake/modules/FindKERBEROS.cmake38
1 files changed, 38 insertions, 0 deletions
diff --git a/cmake/modules/FindKERBEROS.cmake b/cmake/modules/FindKERBEROS.cmake
new file mode 100644
index 0000000000..4fb8002494
--- /dev/null
+++ b/cmake/modules/FindKERBEROS.cmake
@@ -0,0 +1,38 @@
+# - Find kerberos
+# Find the native KERBEROS includes and library
+#
+# KERBEROS_INCLUDE_DIRS - where to find krb5.h, etc.
+# KERBEROS_LIBRARIES - List of libraries when using krb5.
+# KERBEROS_FOUND - True if krb5 found.
+
+
+IF (KERBEROS_INCLUDE_DIRS)
+ # Already in cache, be silent
+ SET(KERBEROS_FIND_QUIETLY TRUE)
+ENDIF (KERBEROS_INCLUDE_DIRS)
+
+FIND_PATH(KERBEROS_INCLUDE_DIR krb5.h)
+
+SET(KERBEROS_NAMES krb5)
+FIND_LIBRARY(KERBEROS_LIBRARY NAMES ${KERBEROS_NAMES} )
+
+# handle the QUIETLY and REQUIRED arguments and set KERBEROS_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(KERBEROS DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR)
+
+# todo
+# add all kerberos libs
+# autodetect HAVE_HEIMDAL_KERBEROS
+# autodetect HAVE_MIT_KERBEROS
+# autodetect(?) HAVE_KEYTYPE_ARCFOUR_56
+
+IF(KERBEROS_FOUND)
+ SET( KERBEROS_LIBRARIES ${KERBEROS_LIBRARY} )
+ SET( KERBEROS_INCLUDE_DIRS ${KERBEROS_INCLUDE_DIR} )
+ELSE(KERBEROS_FOUND)
+ SET( KERBEROS_LIBRARIES )
+ SET( KERBEROS_INCLUDE_DIRS )
+ENDIF(KERBEROS_FOUND)
+
+MARK_AS_ADVANCED( KERBEROS_LIBRARIES KERBEROS_INCLUDE_DIRS )