2022-01-17 06:00:50 +00:00
option ( ENABLE_LDAP "Enable LDAP" ${ ENABLE_LIBRARIES } )
if ( NOT ENABLE_LDAP )
message ( STATUS "Not using ldap" )
return ( )
endif ( )
string ( TOLOWER "${CMAKE_SYSTEM_NAME}" _system_name )
string ( TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" _system_processor )
if (
" $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " a m d 6 4 " O R
" $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " x 6 4 "
)
set ( _system_processor "x86_64" )
elseif ( "${_system_processor}" STREQUAL "arm64" )
set ( _system_processor "aarch64" )
endif ( )
if ( NOT(
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " l i n u x " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " x 8 6 _ 6 4 " ) O R
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " l i n u x " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " a a r c h 6 4 " ) O R
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " l i n u x " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " p p c 6 4 l e " ) O R
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " f r e e b s d " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " x 8 6 _ 6 4 " ) O R
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " f r e e b s d " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " a a r c h 6 4 " ) O R
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " d a r w i n " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " x 8 6 _ 6 4 " ) O R
( " $ { _ s y s t e m _ n a m e } " S T R E Q U A L " d a r w i n " A N D " $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " a a r c h 6 4 " )
) )
message ( ${ RECONFIGURE_MESSAGE_LEVEL } "LDAP support using the bundled library is not implemented for ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} platform." )
endif ( )
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 ( OPENLDAP_VERSION_STRING "2.5.X" )
macro ( mkversion _lib_name )
add_custom_command (
2021-04-24 19:47:52 +00:00
O U T P U T " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { _ l i b _ n a m e } - v e r s i o n . c "
C O M M A N D $ { C M A K E _ C O M M A N D } - E e n v b a s h - c " $ { O P E N L D A P _ S O U R C E _ D I R } / b u i l d / m k v e r s i o n - v ' $ { O P E N L D A P _ V E R S I O N _ S T R I N G } ' l i b l b e r . l a > \ " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / $ { _ l i b _ n a m e } - v e r s i o n . c \ " "
M A I N _ D E P E N D E N C Y " $ { O P E N L D A P _ S O U R C E _ D I R } / b u i l d / m k v e r s i o n "
2020-05-12 19:19:15 +00:00
W O R K I N G _ D I R E C T O R Y $ { O P E N L D A P _ S O U R C E _ D I R }
V E R B A T I M
)
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 (
" $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " a m d 6 4 " O R
" $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " x 6 4 "
)
set ( _system_processor "x86_64" )
2020-05-15 11:15:13 +00:00
elseif (
" $ { _ s y s t e m _ p r o c e s s o r } " S T R E Q U A L " a r m 6 4 "
)
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
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / a s s e r t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / d e c o d e . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / e n c o d e . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / i o . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / b p r i n t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / d e b u g . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / m e m o r y . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / o p t i o n s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / s o c k b u f . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r / s t d i o . c "
2020-05-12 19:19:15 +00:00
)
mkversion ( lber )
2022-01-17 06:00:50 +00:00
add_library ( _lber
2020-05-12 19:19:15 +00:00
$ { _ l b e r _ s r c s }
2021-04-24 19:47:52 +00:00
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / l b e r - v e r s i o n . c "
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_link_libraries ( _lber
2022-01-17 05:45:10 +00:00
P R I V A T E O p e n S S L : : C r y p t o O p e n S S L : : S S L
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_include_directories ( _lber SYSTEM
P U B L I C $ { _ e x t r a _ b u i l d _ d i r } / i n c l u d e
P U B L I C " $ { O P E N L D A P _ S O U R C E _ D I R } / i n c l u d e "
2021-04-24 19:47:52 +00:00
P R I V A T E " $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l b e r "
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_compile_definitions ( _lber
2020-05-12 19:19:15 +00:00
P R I V A T E L B E R _ L I B R A R Y
)
set ( _ldap_srcs
2021-04-24 19:47:52 +00:00
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / b i n d . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / o p e n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / r e s u l t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / e r r o r . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / c o m p a r e . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s e a r c h . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / c o n t r o l s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / m e s s a g e s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / r e f e r e n c e s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / e x t e n d e d . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / c y r u s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / m o d i f y . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / a d d . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / m o d r d n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / d e l e t e . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / a b a n d o n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s a s l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s b i n d . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / u n b i n d . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / c a n c e l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / f i l t e r . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / f r e e . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s o r t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / p a s s w d . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / w h o a m i . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / v c . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / g e t d n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / g e t e n t r y . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / g e t a t t r . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / g e t v a l u e s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / a d d e n t r y . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / r e q u e s t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / o s - i p . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / u r l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / p a g e c t r l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s o r t c t r l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / v l v c t r l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / i n i t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / o p t i o n s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / p r i n t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s t r i n g . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / u t i l - i n t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s c h e m a . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / c h a r r a y . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / o s - l o c a l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / d n s s r v . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / u t f - 8 . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / u t f - 8 - c o n v . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / t l s 2 . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / t l s _ o . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / t l s _ g . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / t u r n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / p p o l i c y . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / d d s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / t x n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / l d a p _ s y n c . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / s t c t r l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / a s s e r t i o n . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / d e r e f . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / l d i f u t i l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / l d i f . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / f e t c h . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / l b a s e 6 4 . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / m s c t r l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p / p s e a r c h c t r l . c "
2020-05-12 19:19:15 +00:00
)
mkversion ( ldap )
2022-01-17 06:00:50 +00:00
add_library ( _ldap
2020-05-12 19:19:15 +00:00
$ { _ l d a p _ s r c s }
2021-04-24 19:47:52 +00:00
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / l d a p - v e r s i o n . c "
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_link_libraries ( _ldap
P R I V A T E _ l b e r
2022-01-17 05:45:10 +00:00
P R I V A T E O p e n S S L : : C r y p t o O p e n S S L : : S S L
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_include_directories ( _ldap SYSTEM
P U B L I C $ { _ e x t r a _ b u i l d _ d i r } / i n c l u d e
P U B L I C " $ { O P E N L D A P _ S O U R C E _ D I R } / i n c l u d e "
2021-04-24 19:47:52 +00:00
P R I V A T E " $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p "
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_compile_definitions ( _ldap
2020-05-12 19:19:15 +00:00
P R I V A T E L D A P _ L I B R A R Y
)
set ( _ldap_r_specific_srcs
2021-04-24 19:47:52 +00:00
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r e a d s . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / r d w r . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t p o o l . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / r q . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r _ p o s i x . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r _ t h r . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r _ n t . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r _ p t h . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r _ s t u b . c "
" $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r / t h r _ d e b u g . c "
2020-05-12 19:19:15 +00:00
)
mkversion ( ldap_r )
2022-01-17 06:00:50 +00:00
add_library ( _ldap_r
2020-05-12 19:19:15 +00:00
$ { _ l d a p _ r _ s p e c i f i c _ s r c s }
$ { _ l d a p _ s r c s }
2021-04-24 19:47:52 +00:00
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / l d a p _ r - v e r s i o n . c "
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_link_libraries ( _ldap_r
P R I V A T E _ l b e r
2022-01-17 05:45:10 +00:00
P R I V A T E O p e n S S L : : C r y p t o O p e n S S L : : S S L
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_include_directories ( _ldap_r SYSTEM
P U B L I C $ { _ e x t r a _ b u i l d _ d i r } / i n c l u d e
P U B L I C " $ { O P E N L D A P _ S O U R C E _ D I R } / i n c l u d e "
2021-04-24 19:47:52 +00:00
P R I V A T E " $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p _ r "
P R I V A T E " $ { O P E N L D A P _ S O U R C E _ D I R } / l i b r a r i e s / l i b l d a p "
2020-05-12 19:19:15 +00:00
)
2022-01-17 06:00:50 +00:00
target_compile_definitions ( _ldap_r
2020-05-12 19:19:15 +00:00
P R I V A T E L D A P _ R _ C O M P I L E
P R I V A T E L D A P _ L I B R A R Y
)
2022-01-17 06:00:50 +00:00
add_library ( ch_contrib::ldap ALIAS _ldap_r )
add_library ( ch_contrib::lber ALIAS _lber )