shithub: sox

Download patch

ref: 36926ce02b5e6784e6d6deafba8af71d356f66a1
parent: fdd3ba29de1cc8e75383268e28417f03189bb860
author: Doug Cook <idigdoug@users.sourceforge.net>
date: Thu Feb 2 23:55:41 EST 2012

Fix up CoreAudio detection for OSX with CMake build.
Patch from Michael Chen.

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -115,7 +115,6 @@
   endif(HAVE_OPENMP)
 endif(CMAKE_COMPILER_IS_GNUCC)
 optional(HAVE_ID3TAG id3tag.h id3tag id3_file_open "")
-optional(HAVE_SNDIO CoreAudio/CoreAudio.h CoreAudio AudioHardwareGetProperty coreaudio)
 optional(HAVE_SNDIO sndio.h sndio sio_open sndio)
 optional(HAVE_AO ao/ao.h ao ao_play ao)
 optional(HAVE_FLAC FLAC/all.h FLAC FLAC__stream_encoder_new flac)
@@ -186,3 +185,15 @@
 if (NOT EXTERNAL_LPC10)
   add_subdirectory(lpc10)
 endif (NOT EXTERNAL_LPC10)
+
+if(APPLE)
+	find_library(COREAUDIO_LIBRARY CoreAudio)
+	mark_as_advanced(COREAUDIO_LIBRARY)
+	if(COREAUDIO_LIBRARY)
+		set(HAVE_COREAUDIO 1)
+		set(optional_srcs ${optional_srcs} coreaudio)
+	endif(COREAUDIO_LIBRARY)
+	set(optional_libs ${optional_libs} ${COREAUDIO_LIBRARY})
+endif(APPLE)
+
+