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. 1
      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") list(APPEND CMAKE_C_FLAGS "-Wall -Wextra -pedantic")
find_library(LIBLDAP NAMES "ldap")
message(STATUS "------------------------------------------") message(STATUS "------------------------------------------")
message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}") message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}")
message(STATUS "") message(STATUS "")
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}") message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
message(STATUS "Library directory: ${INSTALL_LIB}") message(STATUS "Library directory: ${INSTALL_LIB}")
message(STATUS "")
message(STATUS "ldap: ${LIBLDAP}")
add_subdirectory (src) add_subdirectory (src)
add_subdirectory (tests) 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" install(TARGETS "openvpn-auth-ldap"
LIBRARY DESTINATION "${INSTALL_LIB}") LIBRARY DESTINATION "${INSTALL_LIB}")

1
src/ldapauth.c

@ -4,6 +4,7 @@
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
#define LDAP_DEPRECATED 1
#include <ldap.h> #include <ldap.h>
#include "config.h" #include "config.h"

Loading…
Cancel
Save