diff options
Diffstat (limited to 'cmake/FindOSS.cmake')
-rw-r--r-- | cmake/FindOSS.cmake | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/cmake/FindOSS.cmake b/cmake/FindOSS.cmake index 811e052..a750db6 100644 --- a/cmake/FindOSS.cmake +++ b/cmake/FindOSS.cmake @@ -4,29 +4,27 @@ 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") + set(PLATFORM_PREFIX "linux/") + ELSEIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(PLATFORM_PREFIX "sys/") + ELSEIF(CMAKE_SYSTEM_NAME MATCHES "OpenBSD") + set(PLATFORM_PREFIX "machine/") + ENDIF() ENDIF(UNIX) -FIND_PATH(OSS_INCLUDE_DIR "${OSS_HDR_NAME}" - "/usr/include" "/usr/local/include" +set(OSS_HDR_NAME "${PLATFORM_PREFIX}soundcard.h" CACHE STRING "oss header include file name") +FIND_PATH(OSS_INCLUDE_DIRS ${OSS_HDR_NAME} + PATHS + "/usr/local/include" + PATH_SUFFIXES + ${PLATFORM_SUFFIX} ) -IF(OSS_INCLUDE_DIR) - SET(OSS_FOUND TRUE) -ELSE(OSS_INCLUDE_DIR) - SET(OSS_FOUND) -ENDIF(OSS_INCLUDE_DIR) +IF(OSS_INCLUDE_DIRS) + SET(OSS_FOUND ON CACHE BOOL "oss detection status") +ELSE(OSS_INCLUDE_DIRS) + SET(OSS_FOUND OFF CACHE BOOL "oss detection status") +ENDIF(OSS_INCLUDE_DIRS) IF(OSS_FOUND) MESSAGE(STATUS "Found OSS Audio") @@ -40,5 +38,6 @@ ENDIF(OSS_FOUND) MARK_AS_ADVANCED ( OSS_FOUND - OSS_INCLUDE_DIR + OSS_HDR_NAME + OSS_INCLUDE_DIRS ) |