1c255350ff6d5080d5ac169d8306cb684c08a0ba
[metze/wireshark/wip.git] / cmake / modules / FindKERBEROS.cmake
1 #
2 # $Id$
3 #
4 # - Find kerberos
5 # Find the native KERBEROS includes and library
6 #
7 #  KERBEROS_INCLUDE_DIRS - where to find krb5.h, etc.
8 #  KERBEROS_LIBRARIES    - List of libraries when using krb5.
9 #  KERBEROS_FOUND        - True if krb5 found.
10
11
12 IF (KERBEROS_INCLUDE_DIRS)
13   # Already in cache, be silent
14   SET(KERBEROS_FIND_QUIETLY TRUE)
15 ENDIF (KERBEROS_INCLUDE_DIRS)
16
17 FIND_PATH(KERBEROS_INCLUDE_DIR krb5.h)
18
19 SET(KERBEROS_NAMES krb5)
20 FIND_LIBRARY(KERBEROS_LIBRARY NAMES ${KERBEROS_NAMES} )
21
22 # handle the QUIETLY and REQUIRED arguments and set KERBEROS_FOUND to TRUE if 
23 # all listed variables are TRUE
24 INCLUDE(FindPackageHandleStandardArgs)
25 FIND_PACKAGE_HANDLE_STANDARD_ARGS(KERBEROS DEFAULT_MSG KERBEROS_LIBRARY KERBEROS_INCLUDE_DIR)
26
27 # todo
28 # add all kerberos libs
29 # autodetect HAVE_HEIMDAL_KERBEROS
30 # autodetect HAVE_MIT_KERBEROS
31 # autodetect(?) HAVE_KEYTYPE_ARCFOUR_56
32
33 IF(KERBEROS_FOUND)
34   SET( KERBEROS_LIBRARIES ${KERBEROS_LIBRARY} )
35   SET( KERBEROS_INCLUDE_DIRS ${KERBEROS_INCLUDE_DIR} )
36 ELSE(KERBEROS_FOUND)
37   SET( KERBEROS_LIBRARIES )
38   SET( KERBEROS_INCLUDE_DIRS )
39 ENDIF(KERBEROS_FOUND)
40
41 MARK_AS_ADVANCED( KERBEROS_LIBRARIES KERBEROS_INCLUDE_DIRS )