From 9ca53813e2d4d2b27b5e14fcfcaaffdeecfc5942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Tue, 26 Mar 2019 02:11:28 +0100 Subject: Fix detection of older Heimdal versions because paths may be inaccurate in pkg-config. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- ConfigureChecks.cmake | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 43e28e3..0a645e9 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -49,22 +49,43 @@ if( NOT KRB5_FOUND) COMMAND ${KRB5_CONFIG_EXECUTABLE} --libs OUTPUT_VARIABLE KRB5_LIBRARIES ERROR_VARIABLE KRB5_LIBRARIES + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE ) execute_process( COMMAND ${KRB5_CONFIG_EXECUTABLE} --cflags OUTPUT_VARIABLE KRB5_INCLUDE_DIRS ERROR_VARIABLE KRB5_INCLUDE_DIRS + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_STRIP_TRAILING_WHITESPACE ) if( NOT "${KRB5_LIBRARIES}" STREQUAL "" ) set( KRB5_FOUND 1 ) endif( ) endif( ) -find_file( KRB5_ASN1_H +find_path( HEIMDAL_INCLUDEDIR NAMES krb5_asn1.h - HINTS ${KRB5_INCLUDE_DIRS} + HINTS ${KRB5_INCLUDE_DIRS} ${KRB5_INCLUDEDIR} /usr/include + PATH_SUFFIXES "heimdal" ) -if( "${KRB5_ASN1_H}" STREQUAL "KRB5_ASN1_H-NOTFOUND" ) +if( NOT "${HEIMDAL_INCLUDEDIR}" STREQUAL "${KRB5_INCLUDEDIR}" ) + # fix Heimdal include dirs + set( KRB5_INCLUDE_DIRS "${HEIMDAL_INCLUDEDIR}" ) +endif( ) + +find_path( HEIMDAL_LIBDIR + NAMES libhdb.so + HINTS ${KRB5_LIBRARY_DIRS} ${KRB5_LIBDIR} /usr/lib + PATH_SUFFIXES "heimdal" +) +if( NOT "${HEIMDAL_LIBDIR}" STREQUAL "${KRB5_LIBDIR}" ) + # fix Heimdal library dirs + set( KRB5_LIBRARY_DIRS "${HEIMDAL_LIBDIR}" ) +endif( ) + +if( "${HEIMDAL_INCLUDEDIR}" STREQUAL "HEIMDAL_INCLUDEDIR-NOTFOUND" OR + "${HEIMDAL_LIBDIR}" STREQUAL "HEIMDAL_LIBDIR-NOTFOUND" ) tde_message_fatal( "Heimdal Kerberos is required, but was not found on our system" ) endif( ) -- cgit v1.2.1