From: Viktor Szakats Date: Mon, 23 Dec 2024 20:36:23 +0000 (+0100) Subject: cmake/FindLDAP: avoid empty 'Requires' item when omitting `pkg-config` module X-Git-Tag: curl-8_12_0~269 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32bc4288262f704e2e1f4e9f8dd9c06ece314b5f;p=thirdparty%2Fcurl.git cmake/FindLDAP: avoid empty 'Requires' item when omitting `pkg-config` module `list(APPEND ...)` does this automatically, but we're _prepending_ LDAP (to follow historical code and also autotools). `list(PREPEND ...)` would likely do that the same, but it requires CMake 3.15 so we do this manually and the manual method needs to skip the empty value manually. Follow-up to 49f2a23d509645d534cbb2e2ffbd6347fac6e59e #15273 Closes #15828 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 3400327b50..197e94a0eb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1115,7 +1115,9 @@ if(NOT CURL_DISABLE_LDAP) set(HAVE_LBER_H 1) set(CURL_LIBS "${LDAP_LIBRARIES};${CURL_LIBS}") list(APPEND CURL_LIBDIRS ${LDAP_LIBRARY_DIRS}) - set(LIBCURL_PC_REQUIRES_PRIVATE "${LDAP_PC_REQUIRES};${LIBCURL_PC_REQUIRES_PRIVATE}") + if(LDAP_PC_REQUIRES) + set(LIBCURL_PC_REQUIRES_PRIVATE "${LDAP_PC_REQUIRES};${LIBCURL_PC_REQUIRES_PRIVATE}") + endif() include_directories(SYSTEM ${LDAP_INCLUDE_DIRS}) link_directories(${LDAP_LIBRARY_DIRS}) if(LDAP_CFLAGS)