mirror of
https://github.com/ceph/ceph
synced 2026-08-01 22:45:39 +00:00
cmake: define OpenLDAP::OpenLDAP library
* define OpenLDAP::OpenLDAP, so this library can be consumed in a simpler way.
* use OpenLDAP::OpenLDAP instead of OpenLDAP_LIBRARIES when appropriate
* do not link against unused ${OpenLDAP_LIBRARIES}
Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
1c3c42fe52
commit
1af0c6195c
@ -16,7 +16,26 @@ include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(OpenLDAP DEFAULT_MSG
|
||||
OpenLDAP_INCLUDE_DIR LDAP_LIBRARY LBER_LIBRARY)
|
||||
|
||||
set(OpenLDAP_LIBRARIES ${LDAP_LIBRARY} ${LBER_LIBRARY})
|
||||
|
||||
mark_as_advanced(
|
||||
OpenLDAP_INCLUDE_DIR LDAP_LIBRARY LBER_LIBRARY)
|
||||
|
||||
if(OpenLDAP_FOUND)
|
||||
set(OpenLDAP_LIBRARIES ${LDAP_LIBRARY} ${LBER_LIBRARY})
|
||||
if(NOT TARGET OpenLDAP::OpenLDAP)
|
||||
add_library(OpenLDAP::LDAP UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenLDAP::LDAP PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenLDAP_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${LDAP_LIBRARY}")
|
||||
add_library(OpenLDAP::BER UNKNOWN IMPORTED)
|
||||
set_target_properties(OpenLDAP::BER PROPERTIES
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${OpenLDAP_INCLUDE_DIR}"
|
||||
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
IMPORTED_LOCATION "${LBER_LIBRARY}")
|
||||
add_library(openldap INTERFACE)
|
||||
target_link_libraries(openldap INTERFACE
|
||||
OpenLDAP::LDAP
|
||||
OpenLDAP::BER)
|
||||
add_library(OpenLDAP::OpenLDAP ALIAS openldap)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -188,7 +188,6 @@ target_link_libraries(rgw_common
|
||||
${CURL_LIBRARIES}
|
||||
${EXPAT_LIBRARIES}
|
||||
${LUA_LIBRARIES}
|
||||
${OpenLDAP_LIBRARIES}
|
||||
PUBLIC
|
||||
spawn)
|
||||
target_include_directories(rgw_common
|
||||
@ -208,6 +207,11 @@ if(WITH_RADOSGW_AMQP_ENDPOINT)
|
||||
RabbitMQ::RabbitMQ
|
||||
OpenSSL::SSL)
|
||||
endif()
|
||||
if(WITH_OPENLDAP)
|
||||
target_link_libraries(rgw_common
|
||||
PRIVATE
|
||||
OpenLDAP::OpenLDAP)
|
||||
endif()
|
||||
if(WITH_RADOSGW_LUA_PACKAGES)
|
||||
target_link_libraries(rgw_common
|
||||
PRIVATE Boost::filesystem StdFilesystem::filesystem)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
include(AddCephTest)
|
||||
|
||||
set(UNITTEST_LIBS GMock::Main GMock::GMock GTest::GTest ${CMAKE_THREAD_LIBS_INIT}
|
||||
${GSSAPI_LIBRARIES} ${OpenLDAP_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||
${GSSAPI_LIBRARIES} ${CMAKE_DL_LIBS})
|
||||
|
||||
if(WIN32)
|
||||
# Needed by Boost.
|
||||
@ -386,9 +386,11 @@ add_executable(test_rgw_ldap
|
||||
target_link_libraries(test_rgw_ldap
|
||||
librados
|
||||
ceph-common
|
||||
${OpenLDAP_LIBRARIES}
|
||||
${UNITTEST_LIBS}
|
||||
)
|
||||
${UNITTEST_LIBS})
|
||||
if(WITH_OPENLDAP)
|
||||
target_link_libraries(test_rgw_ldap
|
||||
OpenLDAP::OpenLDAP)
|
||||
endif()
|
||||
endif(${WITH_RADOSGW})
|
||||
|
||||
# ceph_multi_stress_watch
|
||||
|
||||
@ -12,7 +12,7 @@ target_link_libraries(radostest PUBLIC
|
||||
GTest::GTest
|
||||
ceph-common
|
||||
json_spirit
|
||||
${GSSAPI_LIBRARIES} ${OpenLDAP_LIBRARIES} ${EXTRALIBS})
|
||||
${GSSAPI_LIBRARIES} ${EXTRALIBS})
|
||||
add_library(radostest-cxx STATIC
|
||||
testcase_cxx.cc
|
||||
test_cxx.cc
|
||||
@ -181,7 +181,7 @@ add_executable(unittest_librados
|
||||
)
|
||||
add_ceph_unittest(unittest_librados)
|
||||
target_link_libraries(unittest_librados librados ${BLKID_LIBRARIES}
|
||||
${GSSAPI_LIBRARIES} ${OpenLDAP_LIBRARIES})
|
||||
${GSSAPI_LIBRARIES})
|
||||
|
||||
# unittest_librados_config
|
||||
add_executable(unittest_librados_config
|
||||
@ -190,7 +190,7 @@ add_executable(unittest_librados_config
|
||||
add_ceph_unittest(unittest_librados_config)
|
||||
target_link_libraries(unittest_librados_config
|
||||
librados
|
||||
${BLKID_LIBRARIES} ${GSSAPI_LIBRARIES} ${OpenLDAP_LIBRARIES})
|
||||
${BLKID_LIBRARIES} ${GSSAPI_LIBRARIES})
|
||||
|
||||
# Removing this test. We can't shove it into Finisher as it's not a
|
||||
# Context any more, and wrapping it to adapt it would be less fair.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user