From ff92812ac57d59e9c43cc90b93c0048630304ebe Mon Sep 17 00:00:00 2001 From: Ilya Golshtein Date: Wed, 29 Jul 2020 01:34:31 +0300 Subject: [PATCH] openssl to link with krb5 --- cmake/find/krb5.cmake | 7 +++---- contrib/krb5-cmake/CMakeLists.txt | 18 +++++++++++------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/cmake/find/krb5.cmake b/cmake/find/krb5.cmake index 6b3e20d4957..bd9c8e239cd 100644 --- a/cmake/find/krb5.cmake +++ b/cmake/find/krb5.cmake @@ -15,11 +15,10 @@ if (ENABLE_KRB5) set (USE_KRB5 1) set (KRB5_LIBRARY krb5) - set (KRB5_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/krb5/include") - - list (APPEND KRB5_INCLUDE_DIR + set (KRB5_INCLUDE_DIR "${ClickHouse_SOURCE_DIR}/contrib/krb5/src/include" - ) + "${ClickHouse_BINARY_DIR}/contrib/krb5-cmake/include" + ) endif () diff --git a/contrib/krb5-cmake/CMakeLists.txt b/contrib/krb5-cmake/CMakeLists.txt index 51a088904a7..059e2b4a46a 100644 --- a/contrib/krb5-cmake/CMakeLists.txt +++ b/contrib/krb5-cmake/CMakeLists.txt @@ -557,10 +557,10 @@ add_custom_target( VERBATIM ) -add_library(krb5) +add_library(${KRB5_LIBRARY}) add_dependencies( - krb5 + ${KRB5_LIBRARY} ERRMAP_H ERROR_MAP_H KRB_5_H @@ -574,7 +574,7 @@ add_custom_command( WORKING_DIRECTORY "${KRB5_SOURCE_DIR}/lib/gssapi/generic" ) -target_sources(krb5 PRIVATE +target_sources(${KRB5_LIBRARY} PRIVATE ${ALL_SRCS} ) @@ -627,12 +627,12 @@ add_custom_command( -target_include_directories(krb5 PUBLIC +target_include_directories(${KRB5_LIBRARY} PUBLIC ${KRB5_SOURCE_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include ) -target_include_directories(krb5 PRIVATE +target_include_directories(${KRB5_LIBRARY} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} #for autoconf.h ${KRB5_SOURCE_DIR} ${KRB5_SOURCE_DIR}/include @@ -652,10 +652,10 @@ target_include_directories(krb5 PRIVATE ${KRB5_SOURCE_DIR}/lib/krb5/rcache ${KRB5_SOURCE_DIR}/lib/krb5/unicode ${KRB5_SOURCE_DIR}/lib/krb5/os - ${OPENSSL_INCLUDE_DIR} + # ${OPENSSL_INCLUDE_DIR} ) -target_compile_definitions(krb5 PRIVATE +target_compile_definitions(${KRB5_LIBRARY} PRIVATE KRB5_PRIVATE _GSS_STATIC_LINK=1 KRB5_DEPRECATED=1 @@ -664,3 +664,7 @@ target_compile_definitions(krb5 PRIVATE SBINDIR="/usr/local/sbin" LIBDIR="/usr/local/lib" ) + +target_link_libraries(${KRB5_LIBRARY} + PRIVATE ${OPENSSL_CRYPTO_LIBRARY} +)