blob: a41cb421a7e041fc73089a254bd708881fc7bddd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
#[=======================================================================[.rst:
FindPAM
-------
Find the Pluggable Authentication Modules library
Result variables
^^^^^^^^^^^^^^^^
This module will set the following variables if found:
``PAM_INCLUDE_DIRS``
where to find security/pam_appl.h, etc.
``PAM_LIBRARIES``
the libraries to link against to use PAM.
``PAM_FOUND``
TRUE if found
#]=======================================================================]
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_PAM QUIET pam)
endif()
find_path(PAM_INCLUDE_DIR NAMES security/pam_appl.h
HINTS
${PC_PAM_INCLUDE_DIRS}
)
mark_as_advanced(PAM_INCLUDE_DIR)
find_library(PAM_LIBRARY NAMES pam
HINTS
${PC_PAM_LIBRARY_DIRS}
)
mark_as_advanced(PAM_LIBRARY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PAM
REQUIRED_VARS
PAM_LIBRARY PAM_INCLUDE_DIR
)
if(PAM_FOUND)
set(PAM_INCLUDE_DIRS ${PAM_INCLUDE_DIR})
set(PAM_LIBRARIES ${PAM_LIBRARY})
endif()
|