Files
impala/cmake_modules/FindLdap.cmake
Henry Robinson 6d9a7e290d Build Openldap as a thirdparty package
Change-Id: Ifbb0f468a23186f4160fceb462953bc321469c27
Reviewed-on: http://gerrit.ent.cloudera.com:8080/1049
Reviewed-by: Henry Robinson <henry@cloudera.com>
Tested-by: Henry Robinson <henry@cloudera.com>
2014-01-08 10:54:20 -08:00

46 lines
1.1 KiB
CMake

# - Find Openldap
# This module defines
# LDAP_INCLUDE_DIR, where to find LDAP headers
# LDAP_STATIC_LIBRARY, the LDAP library to use.
# LBER_STATIC_LIBRARY, a support library for LDAP.
# LDAP_FOUND, If false, do not try to use.
set(THIRDPARTY_LDAP thirdparty/openldap-$ENV{IMPALA_OPENLDAP_VERSION})
set (THIRDPARTY ${CMAKE_SOURCE_DIR}/thirdparty)
set(LDAP_SEARCH_LIB_PATH
${THIRDPARTY}/openldap-$ENV{IMPALA_OPENLDAP_VERSION}/install/lib
)
set(LDAP_INCLUDE_DIR
${THIRDPARTY_LDAP}/install/include
)
find_library(LDAP_LIB_PATH NAMES ldap
PATHS ${LDAP_SEARCH_LIB_PATH}
NO_DEFAULT_PATH
DOC "Openldap library"
)
if (LDAP_LIB_PATH)
set(LDAP_FOUND TRUE)
set(LDAP_STATIC_LIBRARY ${LDAP_SEARCH_LIB_PATH}/libldap.a)
SET(LBER_STATIC_LIBRARY ${LDAP_SEARCH_LIB_PATH}/liblber.a)
else ()
set(LDAP_FOUND FALSE)
endif ()
if (LDAP_FOUND)
if (NOT LDAP_FIND_QUIETLY)
message(STATUS "Found LDAP ${LDAP_STATIC_LIBRARY}")
endif ()
else ()
message(STATUS "LDAP includes and libraries NOT found.")
endif ()
mark_as_advanced(
LDAP_STATIC_LIBRARY
LDAP_INCLUDE_DIR
)