]> git.proxmox.com Git - ceph.git/blame - ceph/src/civetweb/cmake/FindLibSubunit.cmake
buildsys: switch source download to quincy
[ceph.git] / ceph / src / civetweb / cmake / FindLibSubunit.cmake
CommitLineData
7c673cae
FG
1#.rst:
2# FindLibSubunit
3# --------
4#
5# Find the native realtime includes and library.
6#
7# IMPORTED Targets
8# ^^^^^^^^^^^^^^^^
9#
10# This module defines :prop_tgt:`IMPORTED` target ``LIBSUBUNIT::LIBSUBUNIT``, if
11# LIBSUBUNIT has been found.
12#
13# Result Variables
14# ^^^^^^^^^^^^^^^^
15#
16# This module defines the following variables:
17#
18# ::
19#
20# LIBSUBUNIT_INCLUDE_DIRS - where to find subunit/child.h
21# LIBSUBUNIT_LIBRARIES - List of libraries when using libsubunit.
22# LIBSUBUNIT_FOUND - True if subunit library found.
23#
24# Hints
25# ^^^^^
26#
27# A user may set ``LIBSUBUNIT_ROOT`` to a subunit library installation root to tell this
28# module where to look.
29
30find_path(LIBSUBUNIT_INCLUDE_DIRS
31 NAMES subunit/child.h
32 PATHS ${LIBSUBUNIT_ROOT}/include/
33)
34find_library(LIBSUBUNIT_LIBRARIES subunit)
35include(FindPackageHandleStandardArgs)
36find_package_handle_standard_args(LibSubunit DEFAULT_MSG LIBSUBUNIT_LIBRARIES LIBSUBUNIT_INCLUDE_DIRS)
37mark_as_advanced(LIBSUBUNIT_INCLUDE_DIRS LIBSUBUNIT_LIBRARIES)
38
39if(LIBSUBUNIT_FOUND)
40 if(NOT TARGET LIBSUBUNIT::LIBSUBUNIT)
41 add_library(LIBSUBUNIT::LIBSUBUNIT UNKNOWN IMPORTED)
42 set_target_properties(LIBSUBUNIT::LIBSUBUNIT PROPERTIES
43 IMPORTED_LOCATION "${LIBSUBUNIT_LIBRARIES}"
44 INTERFACE_INCLUDE_DIRECTORIES "${LIBSUBUNIT_INCLUDE_DIRS}")
45 endif()
46endif()