summaryrefslogtreecommitdiffstats
path: root/cmake/FindOSS.cmake
blob: 811e0520953627f143dcaf012d2bb4f42bda5955 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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
)