Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sndio support
- Loading branch information
Showing
8 changed files
with
586 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying | ||
# file Copyright.txt or https://cmake.org/licensing for details. | ||
|
||
#[=======================================================================[.rst: | ||
FindSndio | ||
------- | ||
|
||
Finds the Sndio library. | ||
|
||
Imported Targets | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This module provides the following imported targets, if found: | ||
|
||
``Sndio::Sndio`` | ||
The Sndio library | ||
|
||
Result Variables | ||
^^^^^^^^^^^^^^^^ | ||
|
||
This will define the following variables: | ||
|
||
``Sndio_FOUND`` | ||
True if the system has the Sndio library. | ||
``Sndio_VERSION`` | ||
The version of the Sndio library which was found. | ||
``Sndio_INCLUDE_DIRS`` | ||
Include directories needed to use Sndio. | ||
``Sndio_LIBRARIES`` | ||
Libraries needed to link to Sndio. | ||
|
||
Cache Variables | ||
^^^^^^^^^^^^^^^ | ||
|
||
The following cache variables may also be set: | ||
|
||
``Sndio_INCLUDE_DIR`` | ||
The directory containing ``sndio.h``. | ||
``Sndio_LIBRARY`` | ||
The path to the Sndio library. | ||
|
||
#]=======================================================================] | ||
|
||
find_path(Sndio_INCLUDE_DIR sndio.h) | ||
find_library(Sndio_LIBRARY sndio) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(Sndio | ||
FOUND_VAR Sndio_FOUND | ||
REQUIRED_VARS | ||
Sndio_LIBRARY | ||
Sndio_INCLUDE_DIR | ||
) | ||
|
||
if(Sndio_FOUND) | ||
set(Sndio_LIBRARIES ${Sndio_LIBRARY}) | ||
set(Sndio_INCLUDE_DIRS ${Sndio_INCLUDE_DIR}) | ||
endif() | ||
|
||
if(Sndio_FOUND AND NOT TARGET Sndio::Sndio) | ||
add_library(Sndio::Sndio UNKNOWN IMPORTED) | ||
set_target_properties(Sndio::Sndio PROPERTIES | ||
IMPORTED_LOCATION "${Sndio_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${Sndio_INCLUDE_DIR}" | ||
) | ||
endif() | ||
|
||
mark_as_advanced( | ||
Sndio_INCLUDE_DIR | ||
Sndio_LIBRARY | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
project(sndio) | ||
|
||
if(DISABLE_SNDIO) | ||
message(STATUS "Sndio support disabled") | ||
return() | ||
endif() | ||
|
||
find_package(Sndio) | ||
if(NOT Sndio_FOUND AND ENABLE_SNDIO) | ||
message(FATAL_ERROR "Sndio not found but set as enabled") | ||
elseif(NOT Sndio_FOUND) | ||
message(STATUS "Sndio not found, disabling Sndio plugin") | ||
return() | ||
endif() | ||
|
||
include_directories( | ||
SYSTEM "${CMAKE_SOURCE_DIR}/libobs" SYSTEM "${CMAKE_SOURCE_DIR}/../../libobs" | ||
${Sndio_INCLUDE_DIRS} | ||
) | ||
|
||
set(sndio_SOURCES | ||
sndio.c | ||
sndio-input.c | ||
) | ||
|
||
add_library(sndio MODULE | ||
${sndio_SOURCES} | ||
) | ||
target_link_libraries(sndio | ||
libobs | ||
${Sndio_LIBRARIES} | ||
) | ||
set_target_properties(sndio PROPERTIES FOLDER "plugins") | ||
|
||
install_obs_plugin_with_data(sndio data) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Channels="Number of channels" | ||
Device="Device" | ||
BitsPerSample="Bits per sample" | ||
Rate="Rate" | ||
SndioInput="Sndio input client" | ||
|
Oops, something went wrong.