[cosmetic] separate c-lang format commit
[xbmc.git] / cmake / modules / FindSndio.cmake
blobbc4f6d370a0e15b4cb79a703b7a1df2e3aa1b9a5
2 # FindSndio
3 # ---------
4 # Finds the Sndio Library
6 # This will define the following target:
8 #  ${APP_NAME_LC}::Sndio - the sndio library
10 if(NOT TARGET ${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME})
11   find_path(SNDIO_INCLUDE_DIR sndio.h)
12   find_library(SNDIO_LIBRARY sndio)
14   include(FindPackageHandleStandardArgs)
15   find_package_handle_standard_args(Sndio
16                                     REQUIRED_VARS SNDIO_LIBRARY SNDIO_INCLUDE_DIR)
18   if(SNDIO_FOUND)
19     list(APPEND AUDIO_BACKENDS_LIST "sndio")
20     set(AUDIO_BACKENDS_LIST ${AUDIO_BACKENDS_LIST} PARENT_SCOPE)
22     add_library(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} UNKNOWN IMPORTED)
23     set_target_properties(${APP_NAME_LC}::${CMAKE_FIND_PACKAGE_NAME} PROPERTIES
24                                                                      IMPORTED_LOCATION "${SNDIO_LIBRARY}"
25                                                                      INTERFACE_INCLUDE_DIRECTORIES "${SNDIO_INCLUDE_DIR}"
26                                                                      INTERFACE_COMPILE_DEFINITIONS HAS_SNDIO)
27   endif()
28 endif()