diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2019-03-26 02:11:28 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2019-03-26 02:11:28 +0100 |
commit | 9ca53813e2d4d2b27b5e14fcfcaaffdeecfc5942 (patch) | |
tree | 07636fd5cdc094a150506e930ed7ea3896a1cc83 | |
parent | b2d89e08d03d6f50ee68bc0f07bafd2acb184575 (diff) | |
download | libtdeldap-9ca53813e2d4d2b27b5e14fcfcaaffdeecfc5942.tar.gz libtdeldap-9ca53813e2d4d2b27b5e14fcfcaaffdeecfc5942.zip |
Fix detection of older Heimdal versions
because paths may be inaccurate in pkg-config.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | ConfigureChecks.cmake | 27 |
1 files 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( ) |