forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FindLdap.cmake
24 lines (18 loc) · 928 Bytes
/
FindLdap.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# - Try to find the LDAP client libraries
# Once done this will define
#
# LDAP_FOUND - system has libldap
# LDAP_INCLUDE_DIR - the ldap include directory
# LDAP_LIBRARY libldap library
# LBER_LIBRARY liblber library
# LDAP_LIBRARIES - libldap + liblber (if found) library
find_path(LDAP_INCLUDE_DIR NAMES ldap.h HINTS ${LDAP_DIR}/include $ENV{LDAP_DIR}/include)
find_library(LDAP_LIBRARY NAMES ldap HINTS ${LDAP_DIR}/lib $ENV{LDAP_DIR}/lib)
find_library(LBER_LIBRARY NAMES lber HINTS ${LDAP_DIR}/lib $ENV{LDAP_DIR}/lib)
set(LDAP_INCLUDE_DIRS ${LDAP_INCLUDE_DIR})
set(LDAP_LIBRARIES ${LDAP_LIBRARY} ${LBER_LIBRARY})
# handle the QUIETLY and REQUIRED arguments and set LDAP_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LDAP DEFAULT_MSG LDAP_INCLUDE_DIR LDAP_LIBRARY)
mark_as_advanced(LDAP_FOUND LDAP_INCLUDE_DIR LDAP_LIBRARY LBER_LIBRARY)