From 7d07bce64f280b44032bbe33bb4f14376cd14122 Mon Sep 17 00:00:00 2001 From: "Pascal J. Bourguignon" Date: Fri, 21 Dec 2018 11:59:04 +0100 Subject: [PATCH] cmake: made FindGSSAPI.cmake able to detect kerberos versions such as: "Kerberos 5 release 1.18-prerelease". --- cmake/FindGSSAPI.cmake | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/cmake/FindGSSAPI.cmake b/cmake/FindGSSAPI.cmake index 621238f..54d3070 100644 --- a/cmake/FindGSSAPI.cmake +++ b/cmake/FindGSSAPI.cmake @@ -115,7 +115,7 @@ if(NOT GSS_FOUND) # not found by pkg-config. Let's take more traditional approac string(STRIP "${_GSS_VENDOR}" _GSS_VENDOR) if((GSS_FLAVOUR STREQUAL "Heimdal" AND NOT _GSS_VENDOR STREQUAL "Heimdal") OR (GSS_FLAVOUR STREQUAL "MIT" AND NOT _GSS_VENDOR STREQUAL "Massachusetts Institute of Technology")) - message(SEND_ERROR "GSS vendor and GSS flavour are not matching : _GSS_VENDOR=${_GSS_VENDOR} ; GSS_FLAVOUR=${GSS_FLAVOUR}") + message(SEND_ERROR "GSS vendor and GSS flavour are not matching : _GSS_VENDOR=${_GSS_VENDOR} ; GSS_FLAVOUR=${GSS_FLAVOUR}") message(STATUS "Try to set the path to GSS root folder in the system variable GSS_ROOT_DIR") endif() else() @@ -428,13 +428,17 @@ 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 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_PATCH "${GSS_VERSION_PATCH}") + 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 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}") + string(REGEX REPLACE "\\." "" GSS_VERSION_MINOR "${GSS_VERSION_MINOR}") set(GSS_VERSION_PATCH "0") endif() if(GSS_VERSION_MAJOR AND GSS_VERSION_MINOR) @@ -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) -- 2.7.4