Fix detection of older Heimdal versions

because paths may be inaccurate in pkg-config.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/4/head
Slávek Banko 6 years ago
parent b2d89e08d0
commit 9ca53813e2
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -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( )

Loading…
Cancel
Save