Skip to content

Commit

Permalink
Merge pull request ceph#22430 from tchaikov/wip-find_package-oath
Browse files Browse the repository at this point in the history
cmake: find liboath using the correct name

Reviewed-by: Casey Bodley <[email protected]>
Reviewed-by: Erwan Velu <[email protected]>
  • Loading branch information
tchaikov authored Jun 8, 2018
2 parents be651ca + ca78ab2 commit e61c186
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ if(WITH_RADOSGW)
message(WARNING "disabling WITH_RADOSGW_BEAST_FRONTEND, which depends on WITH_BOOST_CONTEXT")
set(WITH_RADOSGW_BEAST_FRONTEND OFF)
endif()
find_package(liboath REQUIRED)
find_package(OATH REQUIRED)

# https://curl.haxx.se/docs/install.html mentions the
# configure flags for various ssl backends
Expand Down
32 changes: 32 additions & 0 deletions cmake/modules/FindOATH.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# CMake module to search for liboath headers
#
# If it's found it sets OATH_FOUND to TRUE
# and following variables are set:
# OATH_INCLUDE_DIRS
# OATH_LIBRARIES
find_path(OATH_INCLUDE_DIR
oath.h
PATHS
/usr/include
/usr/local/include
/usr/include/liboath)
find_library(OATH_LIBRARY NAMES oath liboath PATHS
/usr/local/lib
/usr/lib)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OATH DEFAULT_MSG OATH_LIBRARY OATH_INCLUDE_DIR)

mark_as_advanced(OATH_LIBRARY OATH_INCLUDE_DIR)

if(OATH_FOUND)
set(OATH_INCLUDE_DIRS "${OATH_INCLUDE_DIR}")
set(OATH_LIBRARIES "${OATH_LIBRARY}")
if(NOT TARGET OATH::OATH)
add_library(OATH::OATH UNKNOWN IMPORTED)
endif()
set_target_properties(OATH::OATH PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${OATH_INCLUDE_DIRS}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${OATH_LIBRARIES}")
endif()
22 changes: 0 additions & 22 deletions cmake/modules/Findliboath.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion src/cls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ add_library(cls_lock_client STATIC ${cls_lock_client_srcs})
# cls_otp
set(cls_otp_srcs otp/cls_otp.cc)
add_library(cls_otp SHARED ${cls_otp_srcs})
target_link_libraries(cls_otp oath)
target_link_libraries(cls_otp OATH::OATH)
set_target_properties(cls_otp PROPERTIES
VERSION "1.0.0"
SOVERSION "1"
Expand Down
2 changes: 1 addition & 1 deletion src/rgw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ target_link_libraries(rgw_a librados cls_otp_client cls_lock_client cls_rgw_clie
${CURL_LIBRARIES}
${EXPAT_LIBRARIES}
${OPENLDAP_LIBRARIES} ${CRYPTO_LIBS}
oath)
OATH::OATH)

if (WITH_RADOSGW_BEAST_FRONTEND)
target_compile_definitions(rgw_a PUBLIC BOOST_COROUTINES_NO_DEPRECATION_WARNING)
Expand Down

0 comments on commit e61c186

Please sign in to comment.