2021-04-24 19:47:52 +00:00
|
|
|
set(OPENLDAP_SOURCE_DIR "${ClickHouse_SOURCE_DIR}/contrib/openldap")
|
2020-05-12 19:19:15 +00:00
|
|
|
|
|
|
|
# How these lists were generated?
|
|
|
|
# I compiled the original OpenLDAP with it's original build system and copied the list of source files from build commands.
|
|
|
|
|
|
|
|
set(_libs_type SHARED)
|
|
|
|
if(OPENLDAP_USE_STATIC_LIBS)
|
|
|
|
set(_libs_type STATIC)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(OPENLDAP_VERSION_STRING "2.5.X")
|
|
|
|
|
|
|
|
macro(mkversion _lib_name)
|
|
|
|
add_custom_command(
|
2021-04-24 19:47:52 +00:00
|
|
|
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-version.c"
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E env bash -c "${OPENLDAP_SOURCE_DIR}/build/mkversion -v '${OPENLDAP_VERSION_STRING}' liblber.la > \"${CMAKE_CURRENT_BINARY_DIR}/${_lib_name}-version.c\""
|
|
|
|
MAIN_DEPENDENCY "${OPENLDAP_SOURCE_DIR}/build/mkversion"
|
2020-05-12 19:19:15 +00:00
|
|
|
WORKING_DIRECTORY ${OPENLDAP_SOURCE_DIR}
|
|
|
|
VERBATIM
|
|
|
|
)
|
|
|
|
endmacro()
|
|
|
|
|
2020-05-14 20:40:27 +00:00
|
|
|
string(TOLOWER "${CMAKE_SYSTEM_NAME}" _system_name)
|
2020-05-14 20:25:27 +00:00
|
|
|
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _system_processor)
|
2020-05-14 20:40:27 +00:00
|
|
|
|
2020-05-14 20:25:27 +00:00
|
|
|
if(
|
|
|
|
"${_system_processor}" STREQUAL "amd64" OR
|
|
|
|
"${_system_processor}" STREQUAL "x64"
|
|
|
|
)
|
|
|
|
set(_system_processor "x86_64")
|
2020-05-15 11:15:13 +00:00
|
|
|
elseif(
|
|
|
|
"${_system_processor}" STREQUAL "arm64"
|
|
|
|
)
|
|
|
|
set (_system_processor "aarch64")
|
2020-05-14 20:25:27 +00:00
|
|
|
endif()
|
|
|
|
|
2020-05-14 20:40:27 +00:00
|
|
|
set(_extra_build_dir "${CMAKE_CURRENT_SOURCE_DIR}/${_system_name}_${_system_processor}")
|
2020-05-12 19:19:15 +00:00
|
|
|
|
|
|
|
set(_lber_srcs
|
2021-04-24 19:47:52 +00:00
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/assert.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/decode.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/encode.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/io.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/bprint.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/debug.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/memory.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/options.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/sockbuf.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/liblber/stdio.c"
|
2020-05-12 19:19:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
mkversion(lber)
|
|
|
|
|
|
|
|
add_library(lber ${_libs_type}
|
|
|
|
${_lber_srcs}
|
2021-04-24 19:47:52 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/lber-version.c"
|
2020-05-12 19:19:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(lber
|
|
|
|
PRIVATE ${OPENSSL_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(lber
|
|
|
|
PRIVATE ${_extra_build_dir}/include
|
2021-04-24 19:47:52 +00:00
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/include"
|
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/libraries/liblber"
|
2020-05-12 19:19:15 +00:00
|
|
|
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(lber
|
|
|
|
PRIVATE LBER_LIBRARY
|
|
|
|
)
|
|
|
|
|
|
|
|
set(_ldap_srcs
|
2021-04-24 19:47:52 +00:00
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/bind.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/open.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/result.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/error.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/compare.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/search.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/controls.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/messages.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/references.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/extended.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/cyrus.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/modify.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/add.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/modrdn.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/delete.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/abandon.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/sasl.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/sbind.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/unbind.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/cancel.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/filter.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/free.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/sort.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/passwd.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/whoami.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/vc.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/getdn.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/getentry.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/getattr.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/getvalues.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/addentry.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/request.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/os-ip.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/url.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/pagectrl.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/sortctrl.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/vlvctrl.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/init.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/options.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/print.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/string.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/util-int.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/schema.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/charray.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/os-local.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/dnssrv.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/utf-8.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/utf-8-conv.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/tls2.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/tls_o.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/tls_g.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/turn.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/ppolicy.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/dds.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/txn.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/ldap_sync.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/stctrl.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/assertion.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/deref.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/ldifutil.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/ldif.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/fetch.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/lbase64.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/msctrl.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap/psearchctrl.c"
|
2020-05-12 19:19:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
mkversion(ldap)
|
|
|
|
|
|
|
|
add_library(ldap ${_libs_type}
|
|
|
|
${_ldap_srcs}
|
2021-04-24 19:47:52 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/ldap-version.c"
|
2020-05-12 19:19:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(ldap
|
2020-05-13 11:16:59 +00:00
|
|
|
PRIVATE lber
|
2020-05-12 19:19:15 +00:00
|
|
|
PRIVATE ${OPENSSL_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(ldap
|
|
|
|
PRIVATE ${_extra_build_dir}/include
|
2021-04-24 19:47:52 +00:00
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/include"
|
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/libraries/libldap"
|
2020-05-12 19:19:15 +00:00
|
|
|
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(ldap
|
|
|
|
PRIVATE LDAP_LIBRARY
|
|
|
|
)
|
|
|
|
|
|
|
|
set(_ldap_r_specific_srcs
|
2021-04-24 19:47:52 +00:00
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/threads.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/rdwr.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/tpool.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/rq.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/thr_posix.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/thr_thr.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/thr_nt.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/thr_pth.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/thr_stub.c"
|
|
|
|
"${OPENLDAP_SOURCE_DIR}/libraries/libldap_r/thr_debug.c"
|
2020-05-12 19:19:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
mkversion(ldap_r)
|
|
|
|
|
|
|
|
add_library(ldap_r ${_libs_type}
|
|
|
|
${_ldap_r_specific_srcs}
|
|
|
|
${_ldap_srcs}
|
2021-04-24 19:47:52 +00:00
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/ldap_r-version.c"
|
2020-05-12 19:19:15 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(ldap_r
|
2020-05-13 11:16:59 +00:00
|
|
|
PRIVATE lber
|
2020-05-12 19:19:15 +00:00
|
|
|
PRIVATE ${OPENSSL_LIBRARIES}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(ldap_r
|
|
|
|
PRIVATE ${_extra_build_dir}/include
|
2021-04-24 19:47:52 +00:00
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/include"
|
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/libraries/libldap_r"
|
|
|
|
PRIVATE "${OPENLDAP_SOURCE_DIR}/libraries/libldap"
|
2020-05-12 19:19:15 +00:00
|
|
|
PRIVATE ${OPENSSL_INCLUDE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
target_compile_definitions(ldap_r
|
|
|
|
PRIVATE LDAP_R_COMPILE
|
|
|
|
PRIVATE LDAP_LIBRARY
|
|
|
|
)
|