summaryrefslogtreecommitdiffstats
path: root/bindings/audio/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/audio/CMakeLists.txt')
-rw-r--r--bindings/audio/CMakeLists.txt27
1 files changed, 27 insertions, 0 deletions
diff --git a/bindings/audio/CMakeLists.txt b/bindings/audio/CMakeLists.txt
new file mode 100644
index 00000000..11da28e1
--- /dev/null
+++ b/bindings/audio/CMakeLists.txt
@@ -0,0 +1,27 @@
+INCLUDE(FindPkgConfig)
+PKG_CHECK_MODULES(alsa alsa)
+PKG_CHECK_MODULES(pulseaudio libpulse libpulse-simple)
+INCLUDE(FindThreads)
+FIND_PACKAGE(Threads)
+
+IF(alsa_FOUND)
+
+ MESSAGE(STATUS "ALSA found ; will compile Audio binding... (BINDING)")
+
+ IF(pulseaudio_FOUND)
+ MESSAGE(STATUS "PulseAudio found ; Audio binding will have PulseAudio support")
+ ADD_DEFINITIONS(-DHAVE_PULSE=1)
+ SET(pulse_sources audio-pulse.c)
+ ENDIF(pulseaudio_FOUND)
+
+ INCLUDE_DIRECTORIES(${include_dirs} ${alsa_INCLUDE_DIRS} ${pulseaudio_INCLUDE_DIRS})
+ ADD_LIBRARY(audio-api MODULE audio-api.c audio-alsa.c ${pulse_sources})
+ SET_TARGET_PROPERTIES(audio-api PROPERTIES
+ PREFIX ""
+ LINK_FLAGS "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/export.map"
+ )
+ TARGET_LINK_LIBRARIES(audio-api ${link_libraries} ${alsa_LIBRARIES} ${pulseaudio_LIBRARIES})
+ INSTALL(TARGETS audio-api
+ LIBRARY DESTINATION ${binding_install_dir})
+
+ENDIF(alsa_FOUND)