From 2f07f1237e0357647d18c55cec0bd78136efb4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 7 Apr 2019 02:28:11 +0200 Subject: cmake: Add detection of slapi library without base slapi.so. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index ab447c2..dbc71b8 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -42,12 +42,27 @@ endif( HAVE_LIBLDAP ) ##### check for openldap-server -find_library( HAVE_SLAPI slapi ) -if( HAVE_SLAPI ) - set( SLAPI_LIBRARIES slapi ) - else() - tde_message_fatal( "The slapi library ( openldap-server ) is required, but was not found on your system" ) -endif( HAVE_SLAPI ) +if( NOT DEFINED SLAPI_LIBRARIES ) + message( STATUS "Looking for slapi library" ) + find_library( HAVE_SLAPI slapi ) + if( HAVE_SLAPI ) + set( SLAPI_LIBRARIES slapi ) + else() + get_filename_component( LDAP_LIBDIR ${HAVE_LIBLDAP} PATH CACHE ) + file( GLOB LIBSLAPI_FILES + ${LDAP_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}slapi-[0-9]*${CMAKE_SHARED_LIBRARY_SUFFIX} + ${LDAP_LIBDIR}/${CMAKE_SHARED_LIBRARY_PREFIX}slapi-[0-9]*${CMAKE_SHARED_LIBRARY_SUFFIX}.[0-9]* + /usr/lib/${CMAKE_SHARED_LIBRARY_PREFIX}slapi-[0-9]*${CMAKE_SHARED_LIBRARY_SUFFIX} + /usr/lib/${CMAKE_SHARED_LIBRARY_PREFIX}slapi-[0-9]*${CMAKE_SHARED_LIBRARY_SUFFIX}.[0-9]* + ) + if( LIBSLAPI_FILES ) + list( GET LIBSLAPI_FILES 0 SLAPI_LIBRARIES ) + else( ) + tde_message_fatal( "The slapi library ( openldap-server ) is required, but was not found on your system" ) + endif( ) + endif( HAVE_SLAPI ) + message( STATUS "Looking for slapi library - found ${SLAPI_LIBRARIES}" ) +endif( ) ##### check for tdeldap -- cgit v1.2.1