1 # - Try to find the LDAP client libraries
2 # Once done this will define
4 # LDAP_FOUND - system has libldap
5 # LDAP_INCLUDE_DIR - the ldap include directory
6 # LDAP_LIBRARIES - libldap + liblber (if found) library
7 # LBER_LIBRARIES - liblber library
9 if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)
10 # Already in cache, be silent
11 set(Ldap_FIND_QUIETLY TRUE)
12 endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)
15 FIND_PATH(LDAP_INCLUDE_DIR ldap.h)
16 FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap)
17 FIND_LIBRARY(LBER_LIBRARIES NAMES lber)
20 FIND_PATH(LDAP_INCLUDE_DIR winldap.h)
21 FIND_LIBRARY(LDAP_LIBRARIES NAMES wldap32)
24 if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)
27 set(LDAP_LIBRARIES ${LDAP_LIBRARIES} ${LBER_LIBRARIES})
29 endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES)
32 if(NOT Ldap_FIND_QUIETLY)
33 message(STATUS "Found ldap: ${LDAP_LIBRARIES}")
34 endif(NOT Ldap_FIND_QUIETLY)
36 if (Ldap_FIND_REQUIRED)
37 message(FATAL_ERROR "Could NOT find ldap")
38 endif (Ldap_FIND_REQUIRED)
41 MARK_AS_ADVANCED(LDAP_INCLUDE_DIR LDAP_LIBRARIES LBER_LIBRARIES)