diff --git a/CMakeLists.txt b/CMakeLists.txt index 30e267eb0a..2a7e14f55a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1007,8 +1007,14 @@ if(NOT CURL_DISABLE_LDAP) if(LDAP_INCLUDE_DIR) list(APPEND CMAKE_REQUIRED_INCLUDES ${LDAP_INCLUDE_DIR}) endif() - check_include_file_concat("ldap.h" HAVE_LDAP_H) - check_include_file_concat("lber.h" HAVE_LBER_H) + + unset(_include_list) + check_include_file("lber.h" HAVE_LBER_H) + if(HAVE_LBER_H) + list(APPEND _include_list "lber.h") + endif() + check_include_files("${_include_list};ldap.h" HAVE_LDAP_H) + unset(_include_list) if(NOT HAVE_LDAP_H) message(STATUS "LDAP_H not found CURL_DISABLE_LDAP set ON") @@ -1203,12 +1209,15 @@ if(CURL_USE_GSSAPI) endforeach() if(NOT GSS_FLAVOUR STREQUAL "GNU") - check_include_file_concat("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) - check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H) + set(_include_list "") + check_include_file("gssapi/gssapi.h" HAVE_GSSAPI_GSSAPI_H) + if(HAVE_GSSAPI_GSSAPI_H) + list(APPEND _include_list "gssapi/gssapi.h") + endif() + check_include_files("${_include_list};gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H) if(GSS_FLAVOUR STREQUAL "MIT") - check_include_file_concat("gssapi/gssapi_krb5.h" _have_gssapi_gssapi_krb5_h) - set(_include_list "") + check_include_files("${_include_list};gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H) if(HAVE_GSSAPI_GSSAPI_H) list(APPEND _include_list "gssapi/gssapi.h") endif() @@ -1228,6 +1237,7 @@ if(CURL_USE_GSSAPI) set(HAVE_OLD_GSSMIT ON) endif() endif() + unset(_include_list) endif() cmake_pop_check_state()