summaryrefslogtreecommitdiffstats
path: root/src/civetweb/cmake/FindLibSubunit.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 /src/civetweb/cmake/FindLibSubunit.cmake
parentInitial commit. (diff)
downloadceph-upstream/16.2.11+ds.tar.xz
ceph-upstream/16.2.11+ds.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 '')
-rw-r--r--src/civetweb/cmake/FindLibSubunit.cmake46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/civetweb/cmake/FindLibSubunit.cmake b/src/civetweb/cmake/FindLibSubunit.cmake
new file mode 100644
index 000000000..b45344fbe
--- /dev/null
+++ b/src/civetweb/cmake/FindLibSubunit.cmake
@@ -0,0 +1,46 @@
+#.rst:
+# FindLibSubunit
+# --------
+#
+# Find the native realtime includes and library.
+#
+# IMPORTED Targets
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines :prop_tgt:`IMPORTED` target ``LIBSUBUNIT::LIBSUBUNIT``, if
+# LIBSUBUNIT has been found.
+#
+# Result Variables
+# ^^^^^^^^^^^^^^^^
+#
+# This module defines the following variables:
+#
+# ::
+#
+# LIBSUBUNIT_INCLUDE_DIRS - where to find subunit/child.h
+# LIBSUBUNIT_LIBRARIES - List of libraries when using libsubunit.
+# LIBSUBUNIT_FOUND - True if subunit library found.
+#
+# Hints
+# ^^^^^
+#
+# A user may set ``LIBSUBUNIT_ROOT`` to a subunit library installation root to tell this
+# module where to look.
+
+find_path(LIBSUBUNIT_INCLUDE_DIRS
+ NAMES subunit/child.h
+ PATHS ${LIBSUBUNIT_ROOT}/include/
+)
+find_library(LIBSUBUNIT_LIBRARIES subunit)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(LibSubunit DEFAULT_MSG LIBSUBUNIT_LIBRARIES LIBSUBUNIT_INCLUDE_DIRS)
+mark_as_advanced(LIBSUBUNIT_INCLUDE_DIRS LIBSUBUNIT_LIBRARIES)
+
+if(LIBSUBUNIT_FOUND)
+ if(NOT TARGET LIBSUBUNIT::LIBSUBUNIT)
+ add_library(LIBSUBUNIT::LIBSUBUNIT UNKNOWN IMPORTED)
+ set_target_properties(LIBSUBUNIT::LIBSUBUNIT PROPERTIES
+ IMPORTED_LOCATION "${LIBSUBUNIT_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBSUBUNIT_INCLUDE_DIRS}")
+ endif()
+endif()