From: Ben Rosser Date: Tue, 2 Feb 2016 18:28:00 +0000 (-0500) Subject: Attempt to link against openldap on Windows, too X-Git-Tag: travis-deploy-test~278 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=07473582d22eddd934ee52127cad2baa11943d59 Attempt to link against openldap on Windows, too Rewrite cmake module to remove special case for Windows. Added some (commented out) example code to ldapauthenticator as how we'd need to link against winldap.h, but the implementations are sufficiently different that it's probably a waste of time. --- diff --git a/cmake/FindLdap.cmake b/cmake/FindLdap.cmake index e29d6a2a..2f0c0dd2 100644 --- a/cmake/FindLdap.cmake +++ b/cmake/FindLdap.cmake @@ -13,15 +13,16 @@ if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) set(Ldap_FIND_QUIETLY TRUE) endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) -if(UNIX) - FIND_PATH(LDAP_INCLUDE_DIR ldap.h) - FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap) - FIND_LIBRARY(LBER_LIBRARIES NAMES lber) +#if(UNIX) +# Attempt to link against ldap.h regardless of platform! +FIND_PATH(LDAP_INCLUDE_DIR ldap.h) +FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap) +FIND_LIBRARY(LBER_LIBRARIES NAMES lber) -else(UNIX) - FIND_PATH(LDAP_INCLUDE_DIR winldap.h) - FIND_LIBRARY(LDAP_LIBRARIES NAMES wldap32) -endif(UNIX) +#else(UNIX) +# FIND_PATH(LDAP_INCLUDE_DIR winldap.h) +# FIND_LIBRARY(LDAP_LIBRARIES NAMES wldap32) +#endif(UNIX) if(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) set(LDAP_FOUND TRUE) diff --git a/src/core/ldapauthenticator.cpp b/src/core/ldapauthenticator.cpp index 90b7e894..5b62b89b 100644 --- a/src/core/ldapauthenticator.cpp +++ b/src/core/ldapauthenticator.cpp @@ -32,8 +32,14 @@ #include "network.h" #include "quassel.h" -// Link against LDAP. +/* We should use openldap on windows if at all possible, rather than trying to + * write some kind of compatiblity routine. +#ifdef Q_CC_MSVC +#include +#include +#else*/ #include +//#endif LdapAuthenticator::LdapAuthenticator(QObject *parent) : Authenticator(parent), diff --git a/src/core/ldapauthenticator.h b/src/core/ldapauthenticator.h index a0c8720d..2281c687 100644 --- a/src/core/ldapauthenticator.h +++ b/src/core/ldapauthenticator.h @@ -34,7 +34,14 @@ #include "core.h" // Link against LDAP. +/* We should use openldap on windows if at all possible, rather than trying to + * write some kind of compatiblity routine. +#ifdef Q_CC_MSVC +#include +#include +#else*/ #include +//#endif // Default LDAP server port. #define DEFAULT_LDAP_PORT 389