-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from Mindwerks/master
Hopefully this works
- Loading branch information
Showing
48 changed files
with
5,795 additions
and
1,604 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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,57 +1,67 @@ | ||
# - Find Oss | ||
# Find Oss headers and libraries. | ||
# - Find OSS | ||
# Find OSS headers and libraries. | ||
# | ||
# OSS_INCLUDE_DIR - where to find soundcard.h, etc. | ||
# OSS_FOUND - True if Oss found. | ||
# OSS_INCLUDE_DIR - where to find soundcard.h, etc. | ||
# OSS_LIBRARY - link library, if any, needed for OSS. | ||
# OSS_FOUND - True if OSS found. | ||
|
||
|
||
INCLUDE(LibFindMacros) | ||
INCLUDE(CheckIncludeFiles) | ||
INCLUDE(CheckCSourceCompiles) | ||
|
||
SET(OSS_LIBRARY "") | ||
SET(OSS_INCLUDE_DIR) # system header must suffice | ||
SET(OSS_FOUND) | ||
|
||
MESSAGE(STATUS "Looking for OSS...") | ||
CHECK_INCLUDE_FILES(linux/soundcard.h HAVE_LINUX_SOUNDCARD_H) | ||
|
||
#CHECK_INCLUDE_FILES(linux/soundcard.h HAVE_LINUX_SOUNDCARD_H) # Linux does provide <sys/soundcard.h> | ||
CHECK_INCLUDE_FILES(sys/soundcard.h HAVE_SYS_SOUNDCARD_H) | ||
CHECK_INCLUDE_FILES(machine/soundcard.h HAVE_MACHINE_SOUNDCARD_H) | ||
CHECK_INCLUDE_FILES(soundcard.h HAVE_SOUNDCARD_H) # less common, but exists. | ||
|
||
FIND_PATH(LINUX_OSS_INCLUDE_DIR "linux/soundcard.h" | ||
"/usr/include" "/usr/local/include" | ||
) | ||
|
||
FIND_PATH(SYS_OSS_INCLUDE_DIR "sys/soundcard.h" | ||
"/usr/include" "/usr/local/include" | ||
) | ||
|
||
FIND_PATH(MACHINE_OSS_INCLUDE_DIR "machine/soundcard.h" | ||
"/usr/include" "/usr/local/include" | ||
) | ||
|
||
SET(OSS_FOUND FALSE) | ||
|
||
IF(LINUX_OSS_INCLUDE_DIR) | ||
SET(OSS_FOUND TRUE) | ||
SET(OSS_INCLUDE_DIR ${LINUX_OSS_INCLUDE_DIR}) | ||
# NetBSD and OpenBSD uses ossaudio emulation layer, | ||
# otherwise no link library is needed. | ||
IF(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*|kOpenBSD.*|OpenBSD.*") # AND HAVE_SOUNDCARD_H ??? | ||
FIND_LIBRARY(OSSAUDIO_LIBRARIES "ossaudio") | ||
IF(OSSAUDIO_LIBRARIES STREQUAL "OSSAUDIO_LIBRARIES-NOTFOUND") | ||
SET(OSSAUDIO_LIBRARIES) | ||
ELSE() | ||
MESSAGE(STATUS "Found libossaudio: ${OSSAUDIO_LIBRARIES}") | ||
SET(OSS_LIBRARY ${OSSAUDIO_LIBRARIES}) | ||
ENDIF() | ||
ELSE() | ||
SET(OSSAUDIO_LIBRARIES) | ||
ENDIF() | ||
|
||
IF(SYS_OSS_INCLUDE_DIR) | ||
SET(OSS_FOUND TRUE) | ||
SET(OSS_INCLUDE_DIR ${SYS_OSS_INCLUDE_DIR}) | ||
SET(OLD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") | ||
IF(OSSAUDIO_LIBRARIES) | ||
SET(CMAKE_REQUIRED_LIBRARIES ${OSSAUDIO_LIBRARIES}) | ||
ENDIF() | ||
|
||
IF(MACHINE_OSS_INCLUDE_DIR) | ||
SET(OSS_FOUND TRUE) | ||
SET(OSS_INCLUDE_DIR ${MACHINE_OSS_INCLUDE_DIR}) | ||
IF(HAVE_SYS_SOUNDCARD_H) | ||
CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h> | ||
#include <sys/soundcard.h> | ||
int main() {return SNDCTL_DSP_RESET;}" OSS_FOUND) | ||
ELSEIF(HAVE_MACHINE_SOUNDCARD_H) | ||
CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h> | ||
#include <machine/soundcard.h> | ||
int main() {return SNDCTL_DSP_RESET;}" OSS_FOUND) | ||
ELSEIF(HAVE_SOUNDCARD_H) | ||
CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h> | ||
#include <soundcard.h> | ||
int main() {return SNDCTL_DSP_RESET;}" OSS_FOUND) | ||
ENDIF() | ||
|
||
SET(CMAKE_REQUIRED_LIBRARIES "${OLD_REQUIRED_LIBRARIES}") | ||
|
||
MARK_AS_ADVANCED ( | ||
OSS_FOUND | ||
OSS_INCLUDE_DIR | ||
LINUX_OSS_INCLUDE_DIR | ||
SYS_OSS_INCLUDE_DIR | ||
MACHINE_OSS_INCLUDE_DIR | ||
) | ||
OSS_LIBRARY | ||
) | ||
|
||
IF(OSS_FOUND) | ||
MESSAGE(STATUS "Found OSS headers.") | ||
ELSE(OSS_FOUND) | ||
FATAL_ERROR(STATUS "Could not find OSS headers!") | ||
ENDIF() | ||
MESSAGE(STATUS "Found OSS.") | ||
ELSE() | ||
MESSAGE(STATUS "Could not find OSS.") | ||
ENDIF() |
Oops, something went wrong.