qt5base-lts/cmake/FindGSSAPI.cmake
Alexandru Croitor 190e9dcdcf Regenerate files after dev -> wip/cmake merge
Note the following bigger things that had to be done:
Handle GSS library / feature with a new custom find module.
Implement rudimentary support for relocatability (does not currently
handle extprefix).

Change-Id: Ic6cd27dda7ebca9829f51cb42ea76fff6d1767ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-14 19:01:19 +00:00

40 lines
1.3 KiB
CMake

find_package(PkgConfig)
pkg_check_modules(PC_GSSAPI QUIET krb5-gssapi)
find_path(GSSAPI_INCLUDE_DIRS
NAMES gssapi/gssapi.h
HINTS ${PC_GSSAPI_INCLUDEDIR}
PATH_SUFFIXES gssapi)
find_library(GSSAPI_LIBRARIES
NAMES
GSS # framework
gssapi_krb5
HINTS ${PC_GSSAPILIBDIR}
)
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")