Browse Source

* add linking with 'ldap' library

master
Alex 'AdUser' Z 9 years ago
parent
commit
e6c4cd704f
  1. 4
      CMakeLists.txt
  2. 3
      src/CMakeLists.txt
  3. 3
      src/ldapauth.c

4
CMakeLists.txt

@ -11,11 +11,15 @@ set(INSTALL_LIB "${CMAKE_INSTALL_PREFIX}/lib/openvpn")
list(APPEND CMAKE_C_FLAGS "-Wall -Wextra -pedantic")
find_library(LIBLDAP NAMES "ldap")
message(STATUS "------------------------------------------")
message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}")
message(STATUS "")
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Library directory: ${INSTALL_LIB}")
message(STATUS "")
message(STATUS "ldap: ${LIBLDAP}")
add_subdirectory (src)
add_subdirectory (tests)

3
src/CMakeLists.txt

@ -1,4 +1,5 @@
add_library("openvpn-auth-ldap" SHARED "config.c" "ldapauth.c" "main.c")
add_library("openvpn-auth-ldap" SHARED "config.c" "ldapauth.c" "plugin.c")
target_link_libraries("openvpn-auth-ldap" "ldap")
install(TARGETS "openvpn-auth-ldap"
LIBRARY DESTINATION "${INSTALL_LIB}")

3
src/ldapauth.c

@ -4,6 +4,7 @@
#include <string.h>
#include <sys/time.h>
#define LDAP_DEPRECATED 1
#include <ldap.h>
#include "config.h"
@ -90,4 +91,4 @@ check_against_ldap(oal_config_t * const config,
error_opts:
config->error = strndup(err, bufsize);
return 1;
}
}

Loading…
Cancel
Save