ceph/cmake/modules/Finduring.cmake
Casey Bodley 670118abfb cmake: fix Finduring.cmake
liburing-devel package provides `/usr/lib64/liburing.so`. without this
fix, `find_package(uring)` failed with this `CMAKE_FIND_DEBUG_MODE`
output:
```
  find_library considered the following locations:

    /home/cbodley/ceph/build/virtualenv/bin//(lib)liburing.a(\.so|\.a)
    /home/cbodley/ceph/build/virtualenv/bin/(lib)liburing.a(\.so|\.a)
    /usr/local/bin//(lib)liburing.a(\.so|\.a)
    /usr/local/bin/(lib)liburing.a(\.so|\.a)
    /usr/local/sbin//(lib)liburing.a(\.so|\.a)
    /usr/local/sbin/(lib)liburing.a(\.so|\.a)
    /usr/bin//(lib)liburing.a(\.so|\.a)
    /usr/bin/(lib)liburing.a(\.so|\.a)
    /usr/sbin//(lib)liburing.a(\.so|\.a)
    /usr/sbin/(lib)liburing.a(\.so|\.a)
    /usr/local/lib64//(lib)liburing.a(\.so|\.a)
    /usr/local/lib64/(lib)liburing.a(\.so|\.a)
    /usr/local/lib//(lib)liburing.a(\.so|\.a)
    /usr/local/lib/(lib)liburing.a(\.so|\.a)
    /usr/local//(lib)liburing.a(\.so|\.a)
    /usr/local/(lib)liburing.a(\.so|\.a)
    /usr/lib64//(lib)liburing.a(\.so|\.a)
    /usr/lib64/(lib)liburing.a(\.so|\.a)
    /usr/lib//(lib)liburing.a(\.so|\.a)
    /usr/lib/(lib)liburing.a(\.so|\.a)
    /usr//(lib)liburing.a(\.so|\.a)
    /usr/(lib)liburing.a(\.so|\.a)
    /lib64//(lib)liburing.a(\.so|\.a)
    /lib64/(lib)liburing.a(\.so|\.a)
    /lib//(lib)liburing.a(\.so|\.a)
    /lib/(lib)liburing.a(\.so|\.a)
    /opt//(lib)liburing.a(\.so|\.a)
    /opt/(lib)liburing.a(\.so|\.a)
    /usr/lib64/X11//(lib)liburing.a(\.so|\.a)
    /usr/lib64/X11/(lib)liburing.a(\.so|\.a)
```

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2023-10-20 09:18:30 -04:00

22 lines
703 B
CMake

# - Find uring
#
# URING_INCLUDE_DIR - Where to find liburing.h
# URING_LIBRARIES - List of libraries when using uring.
# uring_FOUND - True if uring found.
find_path(URING_INCLUDE_DIR liburing.h)
find_library(URING_LIBRARIES uring)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(uring DEFAULT_MSG URING_LIBRARIES URING_INCLUDE_DIR)
if(uring_FOUND AND NOT TARGET uring::uring)
add_library(uring::uring UNKNOWN IMPORTED)
set_target_properties(uring::uring PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${URING_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${URING_LIBRARIES}")
endif()
mark_as_advanced(URING_INCLUDE_DIR URING_LIBRARIES)