🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.9 KiB

  1. # - Find OpenSL
  2. # Find the OpenSL libraries
  3. #
  4. # This module defines the following variables and targets:
  5. # OPENSL_FOUND - True if OPENSL was found
  6. # OpenSL::OpenSLES - The OpenSLES target
  7. #
  8. #=============================================================================
  9. # Copyright 2009-2011 Kitware, Inc.
  10. # Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
  11. #
  12. # Redistribution and use in source and binary forms, with or without
  13. # modification, are permitted provided that the following conditions are
  14. # met:
  15. #
  16. # * Redistributions of source code must retain the above copyright notice,
  17. # this list of conditions and the following disclaimer.
  18. #
  19. # * Redistributions in binary form must reproduce the above copyright notice,
  20. # this list of conditions and the following disclaimer in the documentation
  21. # and/or other materials provided with the distribution.
  22. #
  23. # * The names of Kitware, Inc., the Insight Consortium, or the names of
  24. # any consortium members, or of any contributors, may not be used to
  25. # endorse or promote products derived from this software without
  26. # specific prior written permission.
  27. #
  28. # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS ``AS IS''
  29. # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  31. # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
  32. # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  34. # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  35. # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  36. # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. #=============================================================================
  39. find_path(OPENSL_INCLUDE_DIR NAMES SLES/OpenSLES.h
  40. DOC "The OpenSL include directory")
  41. find_path(OPENSL_ANDROID_INCLUDE_DIR NAMES SLES/OpenSLES_Android.h
  42. DOC "The OpenSL Android include directory")
  43. find_library(OPENSL_LIBRARY NAMES OpenSLES
  44. DOC "The OpenSL library")
  45. # handle the QUIETLY and REQUIRED arguments and set OPENSL_FOUND to TRUE if
  46. # all listed variables are TRUE
  47. include(FindPackageHandleStandardArgs)
  48. find_package_handle_standard_args(OpenSL REQUIRED_VARS OPENSL_LIBRARY OPENSL_INCLUDE_DIR
  49. OPENSL_ANDROID_INCLUDE_DIR)
  50. if(OPENSL_FOUND)
  51. add_library(OpenSL::OpenSLES UNKNOWN IMPORTED)
  52. set_target_properties(OpenSL::OpenSLES PROPERTIES
  53. IMPORTED_LOCATION ${OPENSL_LIBRARY}
  54. INTERFACE_INCLUDE_DIRECTORIES ${OPENSL_INCLUDE_DIR}
  55. INTERFACE_INCLUDE_DIRECTORIES ${OPENSL_ANDROID_INCLUDE_DIR})
  56. endif()
  57. mark_as_advanced(OPENSL_INCLUDE_DIR OPENSL_ANDROID_INCLUDE_DIR OPENSL_LIBRARY)