Skip to content
Snippets Groups Projects
Commit c0c67729 authored by Pere Mato Vila's avatar Pere Mato Vila
Browse files

Added LDAP on the CMake builds

parent 61b8ce8a
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,6 @@ find_library(DCAP_LIBRARY NAMES dcap HINTS ${DCAP_DIR}/lib $ENV{DCAP_DIR}/lib)
set(DCAP_INCLUDE_DIRS ${DCAP_INCLUDE_DIR})
set(DCAP_LIBRARIES ${DCAP_LIBRARY})
add_definitions(-pthread)
# handle the QUIETLY and REQUIRED arguments and set DCAP_FOUND to TRUE if
# all listed variables are TRUE
......
# - 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)
......@@ -661,6 +661,20 @@ if(dcache)
endif()
endif()
#---Check for Ldap--------------------------------------------------------------------
if(ldap)
find_package(Ldap)
if(NOT LDAP_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "ldap library not found and is required (ldap option enabled)")
else()
message(STATUS "ldap library not found. Set variable LDAP_DIR to point to your ldap installation")
message(STATUS "For the time being switching OFF 'ldap' option")
set(ldap OFF CACHE BOOL "" FORCE)
endif()
endif()
endif()
#---Report non implemented options---------------------------------------------------
foreach(opt afs chirp clarens cling glite globus hdfs lzma pch peac sapdb srp)
......
......@@ -5,6 +5,7 @@
ROOT_USE_PACKAGE(io/io)
ROOT_USE_PACKAGE(net/net)
include_directories(${DCAP_INCLUDE_DIRS})
add_definitions(-pthread)
ROOT_GENERATE_DICTIONARY(G__DCache *.h LINKDEF LinkDef.h)
ROOT_GENERATE_ROOTMAP(DCache LINKDEF LinkDef.h DEPENDENCIES Net RIO)
......
......@@ -23,5 +23,7 @@ if(monalisa)
add_subdirectory(monalisa)
endif()
if(ldap)
add_subdirectory(ldap)
endif()
############################################################################
# CMakeLists.txt file for building ROOT net/ldap package
############################################################################
ROOT_USE_PACKAGE(net/net)
include_directories(${LDAP_INCLUDE_DIRS})
add_definitions(-DLDAP_DEPRECATED)
ROOT_GENERATE_DICTIONARY(G__LDAP *.h LINKDEF LinkDef.h)
ROOT_GENERATE_ROOTMAP(RLDAP LINKDEF LinkDef.h DEPENDENCIES Net RIO)
ROOT_LINKER_LIBRARY(RLDAP *.cxx G__LDAP.cxx LIBRARIES Core ${LDAP_LIBRARIES} DEPENDENCIES Net)
ROOT_INSTALL_HEADERS()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment