Backported #6865: Disable websockets command line option
[platform/upstream/freerdp.git] / cmake / FindOpenSLES.cmake
1 # - Find OpenSLES
2 # Find the OpenSLES includes and libraries
3 #
4 #  OPENSLES_INCLUDE_DIR - where to find dsound.h
5 #  OPENSLES_LIBRARIES   - List of libraries when using dsound.
6 #  OPENSLES_FOUND       - True if dsound found.
7
8 if(OPENSLES_INCLUDE_DIR)
9         # Already in cache, be silent
10         set(OPENSLES_FIND_QUIETLY TRUE)
11 else()
12         find_package(PkgConfig)
13         pkg_check_modules(PC_OPENSLES QUIET OpenSLES)
14 endif(OPENSLES_INCLUDE_DIR)
15                                 
16 find_path(OPENSLES_INCLUDE_DIR SLES/OpenSLES.h
17         HINTS ${PC_OPENSLES_INCLUDE_DIR})
18
19 find_library(OPENSLES_LIBRARY NAMES OpenSLES
20         HINTS ${PC_OPENSLES_LIBDIR} ${PC_OPENSLES_LIBRARY_DIRS})
21
22 # Handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if
23 # all listed variables are TRUE.
24 include(FindPackageHandleStandardArgs)
25 find_package_handle_standard_args(OPENSLES DEFAULT_MSG
26         OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY)
27                                                 
28 if(OPENSLES_FOUND)
29         set(OPENSLES_LIBRARIES ${OPENSLES_LIBRARY})
30 else(OPENSLES_FOUND)
31         if (OpenSLES_FIND_REQUIRED)
32                 message(FATAL_ERROR "Could NOT find OPENSLES")
33         endif()
34 endif(OPENSLES_FOUND)
35
36 mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY)