diff options
Diffstat (limited to 'modules/FindGSSAPI.cmake')
-rw-r--r-- | modules/FindGSSAPI.cmake | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/modules/FindGSSAPI.cmake b/modules/FindGSSAPI.cmake index 36dffc85..45e4e0e1 100644 --- a/modules/FindGSSAPI.cmake +++ b/modules/FindGSSAPI.cmake @@ -5,30 +5,32 @@ # GSSAPI_INCS - the GSSAPI include directory # GSSAPI_LIBS - the libraries needed to use GSSAPI # GSSAPI_FLAVOR - the type of API - MIT or HEIMDAL -# + # Copyright (c) 2006, Pino Toscano, <toscano.pino@tiscali.it> # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -IF(GSSAPI_LIBS AND GSSAPI_FLAVOR) +if(GSSAPI_LIBS AND GSSAPI_FLAVOR) # in cache already - SET(GSSAPI_FOUND TRUE) + set(GSSAPI_FOUND TRUE) -ELSE(GSSAPI_LIBS AND GSSAPI_FLAVOR) +else(GSSAPI_LIBS AND GSSAPI_FLAVOR) - FIND_PROGRAM(KRB5_CONFIG NAMES krb5-config PATHS + find_program(KRB5_CONFIG NAMES 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 ) + mark_as_advanced(KRB5_CONFIG) #reset vars set(GSSAPI_INCS) set(GSSAPI_LIBS) set(GSSAPI_FLAVOR) - IF(KRB5_CONFIG) + if(KRB5_CONFIG) SET(HAVE_KRB5_GSSAPI TRUE) EXEC_PROGRAM(${KRB5_CONFIG} ARGS --libs gssapi RETURN_VALUE _return_VALUE OUTPUT_VARIABLE GSSAPI_LIBS) @@ -51,26 +53,26 @@ ELSE(GSSAPI_LIBS AND GSSAPI_FLAVOR) IF(NOT HAVE_KRB5_GSSAPI) IF (gssapi_flavor_tmp MATCHES "Sun Microsystems.*") - MESSAGE(STATUS "Solaris Kerberos does not have GSSAPI; this is normal.") - SET(GSSAPI_LIBS) - SET(GSSAPI_INCS) + MESSAGE(STATUS "Solaris Kerberos does not have GSSAPI; this is normal.") + SET(GSSAPI_LIBS) + SET(GSSAPI_INCS) ELSE(gssapi_flavor_tmp MATCHES "Sun Microsystems.*") - MESSAGE(WARNING "${KRB5_CONFIG} failed unexpectedly.") + MESSAGE(WARNING "${KRB5_CONFIG} failed unexpectedly.") ENDIF(gssapi_flavor_tmp MATCHES "Sun Microsystems.*") ENDIF(NOT HAVE_KRB5_GSSAPI) - IF(GSSAPI_LIBS) # GSSAPI_INCS can be also empty, so don't rely on that - SET(GSSAPI_FOUND TRUE) + if(GSSAPI_LIBS) # GSSAPI_INCS can be also empty, so don't rely on that + set(GSSAPI_FOUND TRUE) message(STATUS "Found GSSAPI: ${GSSAPI_LIBS}") - set(GSSAPI_INCS ${GSSAPI_INCS} CACHE STRING "The GSSAPI include directory" ) - set(GSSAPI_LIBS ${GSSAPI_LIBS} CACHE STRING "The libraries needed to use GSSAPI" ) - set(GSSAPI_FLAVOR ${GSSAPI_FLAVOR} CACHE STRING "The type of gss api, MIT or HEIMDAL") + set(GSSAPI_INCS ${GSSAPI_INCS}) + set(GSSAPI_LIBS ${GSSAPI_LIBS}) + set(GSSAPI_FLAVOR ${GSSAPI_FLAVOR}) - MARK_AS_ADVANCED(GSSAPI_INCS GSSAPI_LIBS GSSAPI_FLAVOR) + mark_as_advanced(GSSAPI_INCS GSSAPI_LIBS GSSAPI_FLAVOR) - ENDIF(GSSAPI_LIBS) + endif(GSSAPI_LIBS) - ENDIF(KRB5_CONFIG) + endif(KRB5_CONFIG) -ENDIF(GSSAPI_LIBS AND GSSAPI_FLAVOR) +endif(GSSAPI_LIBS AND GSSAPI_FLAVOR) |