summaryrefslogtreecommitdiffstats
path: root/cmake/modules/Findrdmacm.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 18:45:59 +0000
commit19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch)
tree42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /cmake/modules/Findrdmacm.cmake
parentInitial commit. (diff)
downloadceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz
ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/Findrdmacm.cmake')
-rw-r--r--cmake/modules/Findrdmacm.cmake26
1 files changed, 26 insertions, 0 deletions
diff --git a/cmake/modules/Findrdmacm.cmake b/cmake/modules/Findrdmacm.cmake
new file mode 100644
index 000000000..0016180f4
--- /dev/null
+++ b/cmake/modules/Findrdmacm.cmake
@@ -0,0 +1,26 @@
+# - Find rdma cm
+# Find the rdma cm library and includes
+#
+# RDMACM_INCLUDE_DIR - where to find cma.h, etc.
+# RDMACM_LIBRARIES - List of libraries when using rdmacm.
+# RDMACM_FOUND - True if rdmacm found.
+
+find_path(RDMACM_INCLUDE_DIR rdma/rdma_cma.h)
+find_library(RDMACM_LIBRARIES rdmacm)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(rdmacm DEFAULT_MSG RDMACM_LIBRARIES RDMACM_INCLUDE_DIR)
+
+if(RDMACM_FOUND)
+ if(NOT TARGET RDMA::RDMAcm)
+ add_library(RDMA::RDMAcm UNKNOWN IMPORTED)
+ endif()
+ set_target_properties(RDMA::RDMAcm PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${RDMACM_INCLUDE_DIR}"
+ IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+ IMPORTED_LOCATION "${RDMACM_LIBRARIES}")
+endif()
+
+mark_as_advanced(
+ RDMACM_LIBRARIES
+)