Skip to content

Commit

Permalink
Merge pull request #235 from bjoernricks/ldap-and-radius-options
Browse files Browse the repository at this point in the history
Add cmake options to build with ldap and radius support
  • Loading branch information
timopollmeier committed Jun 5, 2019
2 parents a4d775d + b0e1f5e commit d1e3036
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ execute_process (COMMAND libgcrypt-config --cflags
string(REPLACE "-I" "" GCRYPT_INCLUDE_DIRS "${GCRYPT_CFLAGS}")
endif (NOT GCRYPT)

option (BUILD_WITH_RADIUS "Try to build with Radius support" ON)
option (BUILD_WITH_LDAP "Try to build with LDAP support" ON)

if (BUILD_WITH_RADIUS)
#for radiusutils we need freerdius-client library
message (STATUS "Looking for freeradius-client library...")
Expand All @@ -100,7 +103,7 @@ if (BUILD_WITH_RADIUS)
find_library (LIBRADCLI radcli)
endif (NOT LIBFREERADIUS)
if (NOT LIBFREERADIUS AND NOT LIBRADCLI)
message (SEND_ERROR " No suitable radius library found")
message (STATUS " No suitable radius library found - radius support disabled")
elseif (LIBFREERADIUS)
message (STATUS " Found ${LIBFREERADIUS} - radius support enabled")
set (RADIUS_LDFLAGS "-lfreeradius-client")
Expand All @@ -112,20 +115,21 @@ if (BUILD_WITH_RADIUS)
endif (NOT LIBFREERADIUS AND NOT LIBRADCLI)
endif (BUILD_WITH_RADIUS)

#for ldaputils we need ldap library
message (STATUS "Looking for libldap...")
find_library (LIBLDAP ldap2)
if (NOT LIBLDAP)
find_library (LIBLDAP ldap)
endif (NOT LIBLDAP)
if (NOT LIBLDAP)
message (STATUS " No ldap library found - ldap support disabled")
else (NOT LIBLDAP)
message (STATUS " Found ${LIBLDAP} - ldap support enabled")
add_definitions (-DENABLE_LDAP_AUTH=1)
set (BUILD_WITH_LDAP TRUE)
set (LDAP_LDFLAGS "-lldap")
endif (NOT LIBLDAP)
if (BUILD_WITH_LDAP)
#for ldaputils we need ldap library
message (STATUS "Looking for libldap...")
find_library (LIBLDAP ldap2)
if (NOT LIBLDAP)
find_library (LIBLDAP ldap)
endif (NOT LIBLDAP)
if (NOT LIBLDAP)
message (STATUS " No ldap library found - ldap support disabled")
else (NOT LIBLDAP)
message (STATUS " Found ${LIBLDAP} - ldap support enabled")
add_definitions (-DENABLE_LDAP_AUTH=1)
set (LDAP_LDFLAGS "-lldap")
endif (NOT LIBLDAP)
endif (BUILD_WITH_LDAP)

include_directories (${GLIB_INCLUDE_DIRS} ${GPGME_INCLUDE_DIRS} ${GCRYPT_INCLUDE_DIRS})

Expand Down

0 comments on commit d1e3036

Please sign in to comment.