From: Viktor Szakats Date: Thu, 2 Jan 2025 01:46:00 +0000 (+0100) Subject: cmake/FindLDAP: avoid framework locations for libs too (Apple) X-Git-Tag: curl-8_12_0~212 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=772b6933bcbc0694364ef9495e3413508cfecb0c;p=thirdparty%2Fcurl.git cmake/FindLDAP: avoid framework locations for libs too (Apple) We already avoid system framework paths while looking for LDAP headers to avoid issues. Do the same while looking for LDAP libraries. This makes sure to find the regular ldap library (`libldap.tbd`) instead of picking up `ldap.framework` and let that seep into `libcurl.pc` with a full path. This makes LDAP detection work on Apple as before introducing FindLDAP. Follow-up to 49f2a23d509645d534cbb2e2ffbd6347fac6e59e #15273 Closes #15895 --- diff --git a/CMake/FindLDAP.cmake b/CMake/FindLDAP.cmake index db4aad72dd..4f18e04b59 100644 --- a/CMake/FindLDAP.cmake +++ b/CMake/FindLDAP.cmake @@ -63,13 +63,14 @@ else() # On Apple the SDK LDAP gets picked up from # 'MacOSX.sdk/System/Library/Frameworks/LDAP.framework/Headers', which contains # ldap.h and lber.h both being stubs to include and . - # This causes an infinite inclusion loop in compile. + # This causes an infinite inclusion loop in compile. Also do this for libraries + # to avoid picking up the 'ldap.framework' with a full path. set(_save_cmake_system_framework_path ${CMAKE_SYSTEM_FRAMEWORK_PATH}) set(CMAKE_SYSTEM_FRAMEWORK_PATH "") find_path(LDAP_INCLUDE_DIR NAMES "ldap.h") - set(CMAKE_SYSTEM_FRAMEWORK_PATH ${_save_cmake_system_framework_path}) find_library(LDAP_LIBRARY NAMES "ldap") find_library(LDAP_LBER_LIBRARY NAMES "lber") + set(CMAKE_SYSTEM_FRAMEWORK_PATH ${_save_cmake_system_framework_path}) unset(LDAP_VERSION CACHE) if(LDAP_INCLUDE_DIR AND EXISTS "${LDAP_INCLUDE_DIR}/ldap_features.h")