X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=cmake%2FFindLdap.cmake;h=2c96faeb76901962055ed31b445988c4d9884aaf;hp=5532547888e4753263ea640fe290c22813539eae;hb=222d0be6ffa0f6c63c3c8c5a303260b9aee10e68;hpb=258d157a228d2b2b46b01d3b33ab932b9979436a 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