diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-04-07 02:28:11 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-04-07 20:35:15 +0200 |
commit | 2f07f1237e0357647d18c55cec0bd78136efb4a2 (patch) | |
tree | 7c827b5322b52d9dfdbce63d4716b7ff8a3db65d | |
parent | fd16b3640527b9da8e1df97f5e25849e0313ac64 (diff) | |
download | kcmldapcontroller-2f07f1237e0357647d18c55cec0bd78136efb4a2.tar.gz kcmldapcontroller-2f07f1237e0357647d18c55cec0bd78136efb4a2.zip |
cmake: Add detection of slapi library without base slapi.so.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | ConfigureChecks.cmake | 27 |
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 |