Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cmake options to build with ldap and radius support #235

Merged
merged 2 commits into from
Jun 5, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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