X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=cmake%2FFindLdap.cmake;fp=cmake%2FFindLdap.cmake;h=2c96faeb76901962055ed31b445988c4d9884aaf;hp=5532547888e4753263ea640fe290c22813539eae;hb=8a7444f4ed825b65acc874d9c2e8359f82523ac0;hpb=0c7ad7a44c42df4156376600c3c9f353fa06e72d diff --git a/cmake/FindLdap.cmake b/cmake/FindLdap.cmake index 55325478..2c96faeb 100644 --- a/cmake/FindLdap.cmake +++ b/cmake/FindLdap.cmake @@ -15,7 +15,22 @@ endif(LDAP_INCLUDE_DIR AND LDAP_LIBRARIES) # Attempt to link against ldap.h regardless of platform! FIND_PATH(LDAP_INCLUDE_DIR ldap.h) + +# If we detect path to invalid ldap.h on osx, try /usr/include/ +# This might also be achievable with additional parameters to FIND_PATH. +string(TOLOWER ${LDAP_INCLUDE_DIR} ldapincludelower) +if("${ldapincludelower}" MATCHES "\\/system\\/library\\/frameworks\\/ldap\\.framework\\/headers") + set(LDAP_INCLUDE_DIR "/usr/include/") +endif() + FIND_LIBRARY(LDAP_LIBRARIES NAMES ldap) + +# On osx remove invalid ldap.h +string(TOLOWER ${LDAP_LIBRARIES} ldaplower) +if("${ldaplower}" MATCHES "\\/system\\/library\\/frameworks\\/ldap\\.framework") + set(LDAP_LIBRARIES FALSE) +endif() + FIND_LIBRARY(LBER_LIBRARIES NAMES lber) # It'd be nice to link against winldap on Windows, unfortunately