Backported #6865: Disable websockets command line option
[platform/upstream/freerdp.git] / cmake / FindPAM.cmake
1 # - Try to find the PAM libraries
2 # Once done this will define
3 #
4 #  PAM_FOUND - system has pam
5 #  PAM_INCLUDE_DIR - the pam include directory
6 #  PAM_LIBRARIES - libpam library
7
8 if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
9         set(PAM_FIND_QUIETLY TRUE)
10 endif (PAM_INCLUDE_DIR AND PAM_LIBRARY)
11
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)
15
16 if (PAM_INCLUDE_DIR AND PAM_LIBRARY)
17         set(PAM_FOUND TRUE)
18         if (DL_LIBRARY)
19                 set(PAM_LIBRARIES ${PAM_LIBRARY} ${DL_LIBRARY})
20         else (DL_LIBRARY)
21                 set(PAM_LIBRARIES ${PAM_LIBRARY})
22         endif (DL_LIBRARY)
23
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)
28
29 if (PAM_FOUND)
30         if (NOT PAM_FIND_QUIETLY)
31                 message(STATUS "Found PAM: ${PAM_LIBRARIES}")
32         endif (NOT PAM_FIND_QUIETLY)
33 else (PAM_FOUND)
34         if (PAM_FIND_REQUIRED)
35                 message(FATAL_ERROR "PAM was not found")
36         endif(PAM_FIND_REQUIRED)
37 endif (PAM_FOUND)
38
39 mark_as_advanced(PAM_INCLUDE_DIR PAM_LIBRARY DL_LIBRARY)
40