From 1c3c42fe52cd435faa8304ef107ec689853058db Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 24 Jul 2021 17:28:11 +0800 Subject: [PATCH] cmake: s/OPENLDAP/OpenLDAP/ the upstream project of OpenLDAP is named "OpenLDAP", so rename OPENLDAP to OpenLDAP for better readability. Signed-off-by: Kefu Chai --- CMakeLists.txt | 4 ++-- cmake/modules/FindOpenLDAP.cmake | 22 ++++++++++++++++++++++ cmake/modules/FindOpenLdap.cmake | 22 ---------------------- src/rgw/CMakeLists.txt | 2 +- src/test/CMakeLists.txt | 4 ++-- src/test/librados/CMakeLists.txt | 6 +++--- 6 files changed, 30 insertions(+), 30 deletions(-) create mode 100644 cmake/modules/FindOpenLDAP.cmake delete mode 100644 cmake/modules/FindOpenLdap.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 1dd103b35ce6..0e289346112b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,8 +163,8 @@ endif(LINUX) option(WITH_OPENLDAP "OPENLDAP is here" ON) if(WITH_OPENLDAP) - find_package(OpenLdap REQUIRED) - set(HAVE_OPENLDAP ${OPENLDAP_FOUND}) + find_package(OpenLDAP REQUIRED) + set(HAVE_OPENLDAP ${OpenLDAP_FOUND}) endif() option(WITH_GSSAPI "GSSAPI/KRB5 is here" OFF) diff --git a/cmake/modules/FindOpenLDAP.cmake b/cmake/modules/FindOpenLDAP.cmake new file mode 100644 index 000000000000..1d515c173696 --- /dev/null +++ b/cmake/modules/FindOpenLDAP.cmake @@ -0,0 +1,22 @@ +# - Find OpenLDAP C Libraries +# +# OpenLDAP_FOUND - True if found. +# OpenLDAP_INCLUDE_DIR - Path to the openldap include directory +# OpenLDAP_LIBRARIES - Paths to the ldap and lber libraries + +find_path(OpenLDAP_INCLUDE_DIR ldap.h PATHS + /usr/include + /opt/local/include + /usr/local/include) + +find_library(LDAP_LIBRARY ldap) +find_library(LBER_LIBRARY lber) + +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) diff --git a/cmake/modules/FindOpenLdap.cmake b/cmake/modules/FindOpenLdap.cmake deleted file mode 100644 index 35b711d6b331..000000000000 --- a/cmake/modules/FindOpenLdap.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# - Find OpenLDAP C Libraries -# -# OPENLDAP_FOUND - True if found. -# OPENLDAP_INCLUDE_DIR - Path to the openldap include directory -# OPENLDAP_LIBRARIES - Paths to the ldap and lber libraries - -find_path(OPENLDAP_INCLUDE_DIR ldap.h PATHS - /usr/include - /opt/local/include - /usr/local/include) - -find_library(LDAP_LIBRARY ldap) -find_library(LBER_LIBRARY lber) - -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) diff --git a/src/rgw/CMakeLists.txt b/src/rgw/CMakeLists.txt index 789c060a983b..adcbac49d005 100644 --- a/src/rgw/CMakeLists.txt +++ b/src/rgw/CMakeLists.txt @@ -188,7 +188,7 @@ target_link_libraries(rgw_common ${CURL_LIBRARIES} ${EXPAT_LIBRARIES} ${LUA_LIBRARIES} - ${OPENLDAP_LIBRARIES} + ${OpenLDAP_LIBRARIES} PUBLIC spawn) target_include_directories(rgw_common diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 28d1f7849de3..6300943e6258 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -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} ${OpenLDAP_LIBRARIES} ${CMAKE_DL_LIBS}) if(WIN32) # Needed by Boost. @@ -386,7 +386,7 @@ add_executable(test_rgw_ldap target_link_libraries(test_rgw_ldap librados ceph-common - ${OPENLDAP_LIBRARIES} + ${OpenLDAP_LIBRARIES} ${UNITTEST_LIBS} ) endif(${WITH_RADOSGW}) diff --git a/src/test/librados/CMakeLists.txt b/src/test/librados/CMakeLists.txt index 344bca77c808..d7eb66730e1c 100644 --- a/src/test/librados/CMakeLists.txt +++ b/src/test/librados/CMakeLists.txt @@ -12,7 +12,7 @@ target_link_libraries(radostest PUBLIC GTest::GTest ceph-common json_spirit - ${GSSAPI_LIBRARIES} ${OPENLDAP_LIBRARIES} ${EXTRALIBS}) + ${GSSAPI_LIBRARIES} ${OpenLDAP_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} ${OpenLDAP_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} ${OpenLDAP_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. -- 2.47.3