File: FindSndio.cmake

package info (click to toggle)
obs-studio 30.2.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 47,852 kB
  • sloc: ansic: 202,137; cpp: 112,402; makefile: 868; python: 599; sh: 275; javascript: 19
file content (66 lines) | stat: -rw-r--r-- 1,759 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# cmake-format: off
# Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
# file Copyright.txt or https://cmake.org/licensing for details.

#[=======================================================================[.rst:
FindSndio
-------

Finds the Sndio library.

Imported Targets
^^^^^^^^^^^^^^^^

This module provides the following imported targets, if found:

``Sndio::Sndio``
  The Sndio library

Result Variables
^^^^^^^^^^^^^^^^

This will define the following variables:

``Sndio_FOUND``
  True if the system has the Sndio library.
``Sndio_VERSION``
  The version of the Sndio library which was found.
``Sndio_INCLUDE_DIRS``
  Include directories needed to use Sndio.
``Sndio_LIBRARIES``
  Libraries needed to link to Sndio.

Cache Variables
^^^^^^^^^^^^^^^

The following cache variables may also be set:

``Sndio_INCLUDE_DIR``
  The directory containing ``sndio.h``.
``Sndio_LIBRARY``
  The path to the Sndio library.

#]=======================================================================]
# cmake-format: on

find_path(Sndio_INCLUDE_DIR sndio.h)
find_library(Sndio_LIBRARY sndio)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
  Sndio
  FOUND_VAR Sndio_FOUND
  REQUIRED_VARS Sndio_LIBRARY Sndio_INCLUDE_DIR)

if(Sndio_FOUND)
  set(Sndio_LIBRARIES ${Sndio_LIBRARY})
  set(Sndio_INCLUDE_DIRS ${Sndio_INCLUDE_DIR})
endif()

if(Sndio_FOUND AND NOT TARGET Sndio::Sndio)
  add_library(Sndio::Sndio UNKNOWN IMPORTED)
  set_target_properties(Sndio::Sndio PROPERTIES IMPORTED_LOCATION "${Sndio_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES
                                                                                     "${Sndio_INCLUDE_DIR}")
endif()

mark_as_advanced(Sndio_INCLUDE_DIR Sndio_LIBRARY)