From 9203473d7892634d474cf2bbd96a05707c142683 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Mon, 23 Sep 2013 12:36:51 +0200 Subject: [PATCH] Added OpenSLES detection script. --- cmake/FindOpenSLES.cmake | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 cmake/FindOpenSLES.cmake diff --git a/cmake/FindOpenSLES.cmake b/cmake/FindOpenSLES.cmake new file mode 100644 index 000000000..d11a64324 --- /dev/null +++ b/cmake/FindOpenSLES.cmake @@ -0,0 +1,34 @@ +# - Find OpenSLES +# Find the OpenSLES includes and libraries +# +# OPENSLES_INCLUDE_DIR - where to find dsound.h +# OPENSLES_LIBRARIES - List of libraries when using dsound. +# OPENSLES_FOUND - True if dsound found. + +if(OPENSLES_INCLUDE_DIR) + # Already in cache, be silent + set(OPENSLES_FIND_QUIETLY TRUE) +else() + find_package(PkgConfig) + pkg_check_modules(PC_OPENSLES QUIET OpenSLES) +endif(OPENSLES_INCLUDE_DIR) + +find_path(OPENSLES_INCLUDE_DIR SLES/OpenSLES.h + HINTS ${PC_OPENSLES_INCLUDE_DIR}) + +find_library(OPENSLES_LIBRARY NAMES OpenSLES + HINTS ${PC_OPENSLES_LIBDIR} ${PC_OPENSLES_LIBARRY_DIRS}) + +# Handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if +# all listed variables are TRUE. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OPENSLES DEFAULT_MSG + OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY) + +if(OPENSLES_FOUND) + set(OPENSLES_LIBRARIES ${OPENSLES_LIBRARY}) +else(OPENSLES_FOUND) + set(OPENSLES_LIBRARIES) +endif(OPENSLES_FOUND) + +mark_as_advanced(OPENSLES_INCLUDE_DIR OPENSLES_LIBRARY)