summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ConfigureChecks.cmake27
1 files 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