summaryrefslogtreecommitdiffstats
path: root/FindPAM.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'FindPAM.cmake')
-rw-r--r--FindPAM.cmake16
1 files changed, 16 insertions, 0 deletions
diff --git a/FindPAM.cmake b/FindPAM.cmake
new file mode 100644
index 0000000..f324670
--- /dev/null
+++ b/FindPAM.cmake
@@ -0,0 +1,16 @@
+FIND_PATH(PAM_INCLUDE_DIR security/pam_appl.h)
+FIND_LIBRARY(PAM_LIBRARY NAMES pam)
+
+IF (PAM_INCLUDE_DIR AND PAM_LIBRARY)
+ SET(PAM_FOUND TRUE)
+ENDIF (PAM_INCLUDE_DIR AND PAM_LIBRARY)
+
+IF (PAM_FOUND)
+ IF (NOT PAM_FIND_QUIETLY)
+ MESSAGE(STATUS "Found PAM: ${PAM_LIBRARY}; include path: ${PAM_INCLUDE_DIR}")
+ ENDIF (NOT PAM_FIND_QUIETLY)
+ELSE (PAM_FOUND)
+ IF (PAM_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find PAM")
+ ENDIF (PAM_FIND_REQUIRED)
+ENDIF (PAM_FOUND)