diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-05-18 17:29:26 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-05-18 17:29:26 +0200 |
commit | 9481b4f2960c560ec8297bdc37d8014230072a5c (patch) | |
tree | b076d389746ae8e33f68855146fa5c58318764c4 /plugins/audio/CMakeLists.txt | |
parent | ceb2e567b5f26ff148fbc0e9526f7e7e99464000 (diff) |
improves the build system
Change-Id: Idad84e88cd8c21d111ce7ed44340f6d2b0fccb37
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'plugins/audio/CMakeLists.txt')
-rw-r--r-- | plugins/audio/CMakeLists.txt | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/audio/CMakeLists.txt b/plugins/audio/CMakeLists.txt index ee858b4c..2d74fd62 100644 --- a/plugins/audio/CMakeLists.txt +++ b/plugins/audio/CMakeLists.txt @@ -1,13 +1,26 @@ +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 plugin... (PLUGIN)") + IF(pulseaudio_FOUND) + MESSAGE(STATUS "PulseAudio found ; Audio plugin 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 "") - TARGET_LINK_LIBRARIES(audio-api ${link_libraries}) - INCLUDE_DIRECTORIES(${include_dirs}) + 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 ${plugin_install_dir}) |