Merge pull request #5166 from informatimago/detect-kerberos-version

cmake: made FindGSSAPI.cmake able to detect kerberos versions such as…
This commit is contained in:
akallabeth 2019-01-02 12:51:40 +01:00 committed by GitHub
commit 442ba916bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -428,11 +428,15 @@ if(GSS_FLAVOUR STREQUAL "MIT")
string(REGEX REPLACE "\\." "" GSS_VERSION_MAJOR "${GSS_VERSION_MAJOR}")
string(REGEX MATCH "\\.([0-9]+)$" GSS_VERSION_MINOR ${GSS_RELEASE_NUMBER})
if(NOT GSS_VERSION_MINOR)
string(REGEX MATCH "\\.([0-9]+)\\." GSS_VERSION_MINOR ${GSS_RELEASE_NUMBER})
string(REGEX MATCH "\\.([0-9]+)[-\\.]" GSS_VERSION_MINOR ${GSS_RELEASE_NUMBER})
string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
string(REGEX MATCH "([0-9]+)$" GSS_VERSION_PATCH ${GSS_RELEASE_NUMBER})
string(REGEX REPLACE "-" "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
string(REGEX MATCH "\\.([0-9]+)$" GSS_VERSION_PATCH "${GSS_RELEASE_NUMBER}")
string(REGEX REPLACE "\\." "" GSS_VERSION_PATCH "${GSS_VERSION_PATCH}")
if(NOT GSS_VERSION_PATCH)
set(GSS_VERSION_PATCH "0")
endif()
else()
string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}")
set(GSS_VERSION_PATCH "0")
@ -443,6 +447,7 @@ if(GSS_FLAVOUR STREQUAL "MIT")
else()
message(SEND_ERROR "Failed to retrieved Kerberos version number")
endif()
message(STATUS "Located Kerberos ${GSS_VERSION_MAJOR}.${GSS_VERSION_MINOR}.${GSS_VERSION_PATCH}")
endif()
mark_as_advanced(GSS_INCLUDE_DIR GSS_LIBRARIES)