1 # - Try to find the PAM libraries
2 # Once done this will define
4 # PAM_FOUND - system has pam
5 # PAM_INCLUDE_DIR - the pam include directory
6 # PAM_LIBRARIES - libpam library
8 if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
9 set(PAM_FIND_QUIETLY TRUE)
10 endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
12 find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h pam/pam_appl.h)
13 find_library(PAM_LIBRARY pam)
14 find_library(DL_LIBRARY dl)
16 if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
19 set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
21 set(PAM_LIBRARIES ${PAM_LIBRARY})
24 if (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
25 set(HAVE_PAM_PAM_APPL_H 1)
26 endif (EXISTS ${PAM_INCLUDE_DIR}/pam/pam_appl.h)
27 endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
30 if (NOT PAM_FIND_QUIETLY)
31 message(STATUS "Found PAM: ${PAM_LIBRARIES}")
32 endif (NOT PAM_FIND_QUIETLY)
34 if (PAM_FIND_REQUIRED)
35 message(FATAL_ERROR "PAM was not found")
36 endif(PAM_FIND_REQUIRED)
39 mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY)