diff options
Diffstat (limited to 'cmake/FindGSSAPI.cmake')
-rw-r--r-- | cmake/FindGSSAPI.cmake | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/cmake/FindGSSAPI.cmake b/cmake/FindGSSAPI.cmake index 8b7cf7d2ee..44594941e3 100644 --- a/cmake/FindGSSAPI.cmake +++ b/cmake/FindGSSAPI.cmake @@ -1,10 +1,10 @@ # Copyright (C) 2022 The Qt Company Ltd. -# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 +# SPDX-License-Identifier: BSD-3-Clause find_package(PkgConfig QUIET) -pkg_check_modules(PC_GSSAPI QUIET krb5-gssapi) +pkg_check_modules(PC_GSSAPI QUIET "krb5-gssapi") if (NOT PC_GSSAPI_FOUND) - pkg_check_modules(PC_GSSAPI QUIET mit-krb5-gssapi) + pkg_check_modules(PC_GSSAPI QUIET "mit-krb5-gssapi") endif() find_path(GSSAPI_INCLUDE_DIRS @@ -12,12 +12,24 @@ find_path(GSSAPI_INCLUDE_DIRS HINTS ${PC_GSSAPI_INCLUDEDIR} ) +# On macOS, vcpkg opts for finding frameworks LAST. This is generally fine; +# however, in the case of GSSAPI, `usr/lib/libgssapi_krb5.tbd` which is a +# symlink to `Kerberos.framework` misses a few symols, e.g., +# `___gss_c_nt_hostbased_service_oid_desc`, and it causes build failure. +# So, we need to make sure that we find `GSS.framework`. +set(gssapi_library_names + GSS # framework + gss # solaris + gssapi # FreeBSD + gssapi_krb5 +) +if(APPLE) + list(REMOVE_ITEM gssapi_library_names "gssapi_krb5") +endif() + find_library(GSSAPI_LIBRARIES NAMES - GSS # framework - gss # solaris - gssapi # FreeBSD - gssapi_krb5 + ${gssapi_library_names} HINTS ${PC_GSSAPI_LIBDIR} ) @@ -44,4 +56,3 @@ mark_as_advanced(GSSAPI_INCLUDE_DIRS GSSAPI_LIBRARIES) include(FeatureSummary) set_package_properties(GSSAPI PROPERTIES DESCRIPTION "Generic Security Services Application Program Interface") - |