summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindOATH.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /cmake/modules/FindOATH.cmake
parentInitial commit. (diff)
downloadceph-b26c4052f3542036551aa9dec9caa4226e456195.tar.xz
ceph-b26c4052f3542036551aa9dec9caa4226e456195.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindOATH.cmake')
-rw-r--r--cmake/modules/FindOATH.cmake31
1 files changed, 31 insertions, 0 deletions
diff --git a/cmake/modules/FindOATH.cmake b/cmake/modules/FindOATH.cmake
new file mode 100644
index 000000000..d9821fe3f
--- /dev/null
+++ b/cmake/modules/FindOATH.cmake
@@ -0,0 +1,31 @@
+# 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
+ liboath/oath.h
+ PATHS
+ /usr/include
+ /usr/local/include)
+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()