2022-07-05 11:26:52 +00:00
|
|
|
# Copyright (C) 2022 The Qt Company Ltd.
|
2022-08-19 13:21:34 +00:00
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2022-07-05 11:26:52 +00:00
|
|
|
|
2020-06-26 18:41:29 +00:00
|
|
|
find_package(PkgConfig QUIET)
|
2022-12-26 18:25:14 +00:00
|
|
|
pkg_check_modules(PC_GSSAPI QUIET "krb5-gssapi")
|
2022-01-28 13:34:00 +00:00
|
|
|
if (NOT PC_GSSAPI_FOUND)
|
2022-12-26 18:25:14 +00:00
|
|
|
pkg_check_modules(PC_GSSAPI QUIET "mit-krb5-gssapi")
|
2022-01-28 13:34:00 +00:00
|
|
|
endif()
|
2019-10-11 14:55:55 +00:00
|
|
|
|
|
|
|
find_path(GSSAPI_INCLUDE_DIRS
|
|
|
|
NAMES gssapi/gssapi.h
|
|
|
|
HINTS ${PC_GSSAPI_INCLUDEDIR}
|
2022-01-28 13:34:00 +00:00
|
|
|
)
|
2019-10-11 14:55:55 +00:00
|
|
|
|
|
|
|
find_library(GSSAPI_LIBRARIES
|
|
|
|
NAMES
|
|
|
|
GSS # framework
|
2021-04-14 08:09:17 +00:00
|
|
|
gss # solaris
|
2022-06-21 21:16:44 +00:00
|
|
|
gssapi # FreeBSD
|
2019-10-11 14:55:55 +00:00
|
|
|
gssapi_krb5
|
2022-01-28 13:34:00 +00:00
|
|
|
HINTS ${PC_GSSAPI_LIBDIR}
|
2019-10-11 14:55:55 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(GSSAPI DEFAULT_MSG GSSAPI_LIBRARIES GSSAPI_INCLUDE_DIRS)
|
|
|
|
|
|
|
|
if(GSSAPI_FOUND AND NOT TARGET GSSAPI::GSSAPI)
|
|
|
|
if(GSSAPI_LIBRARIES MATCHES "/([^/]+)\\.framework$")
|
|
|
|
add_library(GSSAPI::GSSAPI INTERFACE IMPORTED)
|
|
|
|
set_target_properties(GSSAPI::GSSAPI PROPERTIES
|
|
|
|
INTERFACE_LINK_LIBRARIES "${GSSAPI_LIBRARIES}")
|
|
|
|
else()
|
|
|
|
add_library(GSSAPI::GSSAPI UNKNOWN IMPORTED)
|
|
|
|
set_target_properties(GSSAPI::GSSAPI PROPERTIES
|
|
|
|
IMPORTED_LOCATION "${GSSAPI_LIBRARIES}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set_target_properties(GSSAPI::GSSAPI PROPERTIES
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${GSSAPI_INCLUDE_DIRS}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
mark_as_advanced(GSSAPI_INCLUDE_DIRS GSSAPI_LIBRARIES)
|
|
|
|
|
|
|
|
include(FeatureSummary)
|
|
|
|
set_package_properties(GSSAPI PROPERTIES
|
|
|
|
DESCRIPTION "Generic Security Services Application Program Interface")
|
|
|
|
|