summaryrefslogtreecommitdiffstats
path: root/cmake/FindOSS.cmake
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:24:41 +0000
commita9bcc81f821d7c66f623779fa5147e728eb3c388 (patch)
tree98676963bcdd537ae5908a067a8eb110b93486a6 /cmake/FindOSS.cmake
parentInitial commit. (diff)
downloadfreerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.tar.xz
freerdp3-a9bcc81f821d7c66f623779fa5147e728eb3c388.zip
Adding upstream version 3.3.0+dfsg1.upstream/3.3.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cmake/FindOSS.cmake')
-rw-r--r--cmake/FindOSS.cmake44
1 files changed, 44 insertions, 0 deletions
diff --git a/cmake/FindOSS.cmake b/cmake/FindOSS.cmake
new file mode 100644
index 0000000..811e052
--- /dev/null
+++ b/cmake/FindOSS.cmake
@@ -0,0 +1,44 @@
+#
+# Find OSS include header for Unix platforms.
+# used by FQTerm to detect the availability of OSS.
+
+IF(UNIX)
+ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ SET(OSS_HDR_NAME "linux/soundcard.h")
+ ELSE(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ SET(OSS_HDR_NAME "sys/soundcard.h")
+ ELSE(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ IF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ SET(OSS_HDR_NAME "soundcard.h")
+ ELSE(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ SET(OSS_HDR_NAME "machine/soundcard.h")
+ ENDIF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD")
+ ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ENDIF(UNIX)
+
+FIND_PATH(OSS_INCLUDE_DIR "${OSS_HDR_NAME}"
+ "/usr/include" "/usr/local/include"
+)
+
+IF(OSS_INCLUDE_DIR)
+ SET(OSS_FOUND TRUE)
+ELSE(OSS_INCLUDE_DIR)
+ SET(OSS_FOUND)
+ENDIF(OSS_INCLUDE_DIR)
+
+IF(OSS_FOUND)
+ MESSAGE(STATUS "Found OSS Audio")
+ELSE(OSS_FOUND)
+ IF(OSS_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "FAILED to found Audio - REQUIRED")
+ ELSE(OSS_FIND_REQUIRED)
+ MESSAGE(STATUS "Audio Disabled")
+ ENDIF(OSS_FIND_REQUIRED)
+ENDIF(OSS_FOUND)
+
+MARK_AS_ADVANCED (
+ OSS_FOUND
+ OSS_INCLUDE_DIR
+)