summaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindSndio.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-10 18:07:22 +0000
commitc04dcc2e7d834218ef2d4194331e383402495ae1 (patch)
tree7333e38d10d75386e60f336b80c2443c1166031d /cmake/modules/FindSndio.cmake
parentInitial commit. (diff)
downloadkodi-c04dcc2e7d834218ef2d4194331e383402495ae1.tar.xz
kodi-c04dcc2e7d834218ef2d4194331e383402495ae1.zip
Adding upstream version 2:20.4+dfsg.upstream/2%20.4+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/modules/FindSndio.cmake')
-rw-r--r--cmake/modules/FindSndio.cmake41
1 files changed, 41 insertions, 0 deletions
diff --git a/cmake/modules/FindSndio.cmake b/cmake/modules/FindSndio.cmake
new file mode 100644
index 0000000..992c0b1
--- /dev/null
+++ b/cmake/modules/FindSndio.cmake
@@ -0,0 +1,41 @@
+#
+# FindSndio
+# ---------
+# Finds the Sndio Library
+#
+# This will define the following variables:
+#
+# SNDIO_FOUND - system has sndio
+# SNDIO_INCLUDE_DIRS - sndio include directory
+# SNDIO_DEFINITIONS - sndio definitions
+#
+# and the following imported targets::
+#
+# Sndio::Sndio - the sndio library
+#
+
+find_path(SNDIO_INCLUDE_DIR sndio.h)
+find_library(SNDIO_LIBRARY sndio)
+
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(Sndio
+ REQUIRED_VARS SNDIO_LIBRARY SNDIO_INCLUDE_DIR)
+
+if(SNDIO_FOUND)
+ set(SNDIO_INCLUDE_DIRS ${SNDIO_INCLUDE_DIR})
+ set(SNDIO_LIBRARIES ${SNDIO_LIBRARY})
+ set(SNDIO_DEFINITIONS -DHAS_SNDIO=1)
+
+ if(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}")
+ set_target_properties(Sndio::Sndio PROPERTIES
+ INTERFACE_COMPILE_DEFINITIONS -DHAS_SNDIO=1)
+ endif()
+endif()
+
+
+mark_as_advanced(SNDIO_INCLUDE_DIR SNDIO_LIBRARY)