File: FindOpenSLES.cmake

package info (click to toggle)
fluidsynth 2.5.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,268 kB
  • sloc: ansic: 45,303; cpp: 4,897; xml: 864; sh: 200; makefile: 74
file content (44 lines) | stat: -rw-r--r-- 1,229 bytes parent folder | download | duplicates (2)
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
#[=======================================================================[.rst:
FindOpenSLES
-------

Finds the OpenSLES library.

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

This module provides the following imported targets, if found:

``OpenSLES::libOpenSLES``
  The OpenSLES library

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

This will define the following variables:

``OpenSLES_FOUND``
  True if the system has the OpenSLES library.

#]=======================================================================]

# Find the headers and library
find_path(OpenSLES_INCLUDE_DIR NAMES "SLES/OpenSLES.h")

find_library(OpenSLES_LIBRARY NAMES "OpenSLES")

# Forward the result to CMake
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OpenSLES REQUIRED_VARS "OpenSLES_LIBRARY"
                                                         "OpenSLES_INCLUDE_DIR")

# Create the target
if(OpenSLES_FOUND AND NOT TARGET OpenSLES::OpenSLES)
  add_library(OpenSLES::OpenSLES UNKNOWN IMPORTED)
  set_target_properties(
    OpenSLES::OpenSLES
    PROPERTIES IMPORTED_LOCATION "${OpenSLES_LIBRARY}"
               INTERFACE_INCLUDE_DIRECTORIES "${OpenSLES_INCLUDE_DIR}")
endif()

mark_as_advanced(OpenSLES_INCLUDE_DIR OpenSLES_LIBRARY)