Hello,

currently, gr-audio detects the available sound systems and enables all
that it finds. This is undesirable on Gentoo as it causes so-called
automagic dependencies.

Attached patch adds new options to explicitly enable and disable the
sound systems. The default behaviour remains unchanged.


Best regards,
Chí-Thanh Christopher

>From e4aaecb1638c3c3c47d5debfb95cd708c39a6a71 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ch=C3=AD-Thanh=20Christopher=20Nguy=E1=BB=85n?= <chith...@gentoo.org>
Date: Wed, 13 Jun 2012 01:33:31 +0200
Subject: [PATCH] cmake: allow disabling of individual gr-audio sound systems

---
 gr-audio/lib/CMakeLists.txt |   32 ++++++++++++++++++++++++--------
 1 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/gr-audio/lib/CMakeLists.txt b/gr-audio/lib/CMakeLists.txt
index c1781af..419f600 100644
--- a/gr-audio/lib/CMakeLists.txt
+++ b/gr-audio/lib/CMakeLists.txt
@@ -38,7 +38,11 @@ list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/gr-audio.conf)
 ########################################################################
 find_package(ALSA)
 
-if(ALSA_FOUND)
+GR_REGISTER_COMPONENT("gr-audio-alsa" ENABLE_GR_AUDIO_ALSA
+    ALSA_FOUND
+)
+
+if(ALSA_FOUND AND ENABLE_GR_AUDIO_ALSA)
 
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/alsa ${ALSA_INCLUDE_DIRS})
     list(APPEND gr_audio_libs ${ALSA_LIBRARIES})
@@ -49,14 +53,18 @@ if(ALSA_FOUND)
     )
     list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/alsa/gr-audio-alsa.conf)
 
-endif(ALSA_FOUND)
+endif(ALSA_FOUND AND ENABLE_GR_AUDIO_ALSA)
 
 ########################################################################
 ## OSS Support
 ########################################################################
 find_package(OSS)
 
-if(OSS_FOUND)
+GR_REGISTER_COMPONENT("gr-audio-oss" ENABLE_GR_AUDIO_OSS
+    OSS_FOUND
+)
+
+if(OSS_FOUND AND ENABLE_GR_AUDIO_OSS)
 
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/oss ${OSS_INCLUDE_DIRS})
     list(APPEND gr_audio_sources
@@ -65,7 +73,7 @@ if(OSS_FOUND)
     )
     list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/oss/gr-audio-oss.conf)
 
-endif(OSS_FOUND)
+endif(OSS_FOUND AND ENABLE_GR_AUDIO_OSS)
 
 
 ########################################################################
@@ -73,7 +81,11 @@ endif(OSS_FOUND)
 ########################################################################
 find_package(Jack)
 
-if(JACK_FOUND)
+GR_REGISTER_COMPONENT("gr-audio-jack" ENABLE_GR_AUDIO_JACK
+    JACK_FOUND
+)
+
+if(JACK_FOUND AND ENABLE_GR_AUDIO_JACK)
 
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/jack ${JACK_INCLUDE_DIRS})
     list(APPEND gr_audio_libs ${JACK_LIBRARIES})
@@ -85,7 +97,7 @@ if(JACK_FOUND)
     )
     list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/jack/gr-audio-jack.conf)
 
-endif(JACK_FOUND)
+endif(JACK_FOUND AND ENABLE_GR_AUDIO_JACK)
 
 ########################################################################
 ## OSX Support
@@ -115,7 +127,11 @@ endif(AUDIO_UNIT_H AND AUDIO_TOOLBOX_H)
 ########################################################################
 find_package(Portaudio)
 
-if(PORTAUDIO_FOUND)
+GR_REGISTER_COMPONENT("gr-audio-portaudio" ENABLE_GR_AUDIO_PORTAUDIO
+    PORTAUDIO_FOUND
+)
+
+if(PORTAUDIO_FOUND AND ENABLE_GR_AUDIO_PORTAUDIO)
 
     include_directories(${CMAKE_CURRENT_SOURCE_DIR}/portaudio ${PORTAUDIO_INCLUDE_DIRS})
     list(APPEND gr_audio_libs ${PORTAUDIO_LIBRARIES})
@@ -127,7 +143,7 @@ if(PORTAUDIO_FOUND)
     )
     list(APPEND gr_audio_confs ${CMAKE_CURRENT_SOURCE_DIR}/portaudio/gr-audio-portaudio.conf)
 
-endif(PORTAUDIO_FOUND)
+endif(PORTAUDIO_FOUND AND ENABLE_GR_AUDIO_PORTAUDIO)
 
 ########################################################################
 ## Windows Support
-- 
1.7.3.4


_______________________________________________
Patch-gnuradio mailing list
Patch-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/patch-gnuradio

Reply via email to