mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2024-11-24 20:58:37 -05:00
use the system RtAudio on Linux
This commit is contained in:
parent
27046a51e4
commit
03eb22a5c7
@ -177,48 +177,26 @@ ENDIF (WIN32)
|
|||||||
IF (UNIX AND NOT APPLE)
|
IF (UNIX AND NOT APPLE)
|
||||||
set(BUILD_DEB OFF CACHE BOOL "Build DEB")
|
set(BUILD_DEB OFF CACHE BOOL "Build DEB")
|
||||||
|
|
||||||
|
|
||||||
SET(USE_AUDIO_PULSE ON CACHE BOOL "Use Pulse Audio")
|
|
||||||
SET(USE_AUDIO_JACK OFF CACHE BOOL "Use Jack Audio")
|
|
||||||
SET(USE_AUDIO_ALSA OFF CACHE BOOL "Use ALSA Audio")
|
|
||||||
SET(USE_AUDIO_OSS OFF CACHE BOOL "Use OSS Audio")
|
|
||||||
|
|
||||||
SET(LIQUID_LIB liquid)
|
SET(LIQUID_LIB liquid)
|
||||||
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl)
|
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl)
|
||||||
|
|
||||||
IF(USE_AUDIO_PULSE)
|
# use the system RtAudio which in turn provides OSS, ALSA, JACK,
|
||||||
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} pulse-simple pulse)
|
# PulseAudio support depending on how it was compiled
|
||||||
ADD_DEFINITIONS(
|
find_package(RtAudio)
|
||||||
-D__LINUX_PULSE__
|
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} ${RTAUDIO_LIBRARIES})
|
||||||
)
|
ADD_DEFINITIONS(${RTAUDIO_DEFINITIONS})
|
||||||
ENDIF(USE_AUDIO_PULSE)
|
include_directories(${RTAUDIO_INCLUDE_DIR})
|
||||||
|
ELSE(UNIX AND NOT APPLE)
|
||||||
IF(USE_AUDIO_JACK)
|
SET (cubicsdr_sources
|
||||||
find_package(Jack)
|
${cubicsdr_sources}
|
||||||
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} ${JACK_LIBRARIES})
|
external/rtaudio/RtAudio.cpp
|
||||||
ADD_DEFINITIONS(
|
)
|
||||||
-D__UNIX_JACK__
|
SET (cubicsdr_headers
|
||||||
)
|
${cubicsdr_headers}
|
||||||
include_directories(${JACK_INCLUDE_DIRS})
|
external/rtaudio/RtAudio.h
|
||||||
ENDIF(USE_AUDIO_JACK)
|
)
|
||||||
|
SOURCE_GROUP("_ext-RTAudio" REGULAR_EXPRESSION "external/rtaudio/.*${REG_EXT}")
|
||||||
IF(USE_AUDIO_ALSA)
|
include_directories(${PROJECT_SOURCE_DIR}/external/rtaudio)
|
||||||
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} asound)
|
|
||||||
set(ALSA_INCLUDE_DIR "/usr/include" CACHE FILEPATH "ALSA include path")
|
|
||||||
include_directories(${ALSA_INCLUDE_DIR})
|
|
||||||
set(ALSA_LIB_DIR "/usr/lib" CACHE FILEPATH "ALSA lib path")
|
|
||||||
link_directories(${ALSA_LIB_DIR})
|
|
||||||
ADD_DEFINITIONS(
|
|
||||||
-D__LINUX_ALSA__
|
|
||||||
)
|
|
||||||
ENDIF(USE_AUDIO_ALSA)
|
|
||||||
|
|
||||||
IF(USE_AUDIO_OSS)
|
|
||||||
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} oss)
|
|
||||||
ADD_DEFINITIONS(
|
|
||||||
-D__LINUX_OSS__
|
|
||||||
)
|
|
||||||
ENDIF(USE_AUDIO_OSS)
|
|
||||||
ENDIF(UNIX AND NOT APPLE)
|
ENDIF(UNIX AND NOT APPLE)
|
||||||
|
|
||||||
IF (APPLE)
|
IF (APPLE)
|
||||||
@ -304,7 +282,6 @@ SET (cubicsdr_sources
|
|||||||
src/forms/SDRDevices/SDRDevicesForm.cpp
|
src/forms/SDRDevices/SDRDevicesForm.cpp
|
||||||
src/forms/SDRDevices/SDRDeviceAdd.cpp
|
src/forms/SDRDevices/SDRDeviceAdd.cpp
|
||||||
src/forms/SDRDevices/SDRDeviceAddForm.cpp
|
src/forms/SDRDevices/SDRDeviceAddForm.cpp
|
||||||
external/rtaudio/RtAudio.cpp
|
|
||||||
external/lodepng/lodepng.cpp
|
external/lodepng/lodepng.cpp
|
||||||
external/tinyxml/tinyxml.cpp
|
external/tinyxml/tinyxml.cpp
|
||||||
external/tinyxml/tinystr.cpp
|
external/tinyxml/tinystr.cpp
|
||||||
@ -408,7 +385,6 @@ SET (cubicsdr_headers
|
|||||||
src/forms/SDRDevices/SDRDevicesForm.h
|
src/forms/SDRDevices/SDRDevicesForm.h
|
||||||
src/forms/SDRDevices/SDRDeviceAdd.h
|
src/forms/SDRDevices/SDRDeviceAdd.h
|
||||||
src/forms/SDRDevices/SDRDeviceAddForm.h
|
src/forms/SDRDevices/SDRDeviceAddForm.h
|
||||||
external/rtaudio/RtAudio.h
|
|
||||||
external/lodepng/lodepng.h
|
external/lodepng/lodepng.h
|
||||||
external/tinyxml/tinyxml.h
|
external/tinyxml/tinyxml.h
|
||||||
external/tinyxml/tinystr.h
|
external/tinyxml/tinystr.h
|
||||||
@ -512,7 +488,6 @@ SOURCE_GROUP("Visual" REGULAR_EXPRESSION "src/visual/${REG_EXT}")
|
|||||||
SOURCE_GROUP("Panel" REGULAR_EXPRESSION "src/panel/${REG_EXT}")
|
SOURCE_GROUP("Panel" REGULAR_EXPRESSION "src/panel/${REG_EXT}")
|
||||||
SOURCE_GROUP("Process" REGULAR_EXPRESSION "src/process/${REG_EXT}")
|
SOURCE_GROUP("Process" REGULAR_EXPRESSION "src/process/${REG_EXT}")
|
||||||
SOURCE_GROUP("UI" REGULAR_EXPRESSION "src/ui/${REG_EXT}")
|
SOURCE_GROUP("UI" REGULAR_EXPRESSION "src/ui/${REG_EXT}")
|
||||||
SOURCE_GROUP("_ext-RTAudio" REGULAR_EXPRESSION "external/rtaudio/.*${REG_EXT}")
|
|
||||||
SOURCE_GROUP("_ext-LodePNG" REGULAR_EXPRESSION "external/lodepng/.*${REG_EXT}")
|
SOURCE_GROUP("_ext-LodePNG" REGULAR_EXPRESSION "external/lodepng/.*${REG_EXT}")
|
||||||
SOURCE_GROUP("_ext-TinyXML" REGULAR_EXPRESSION "external/tinyxml/.*${REG_EXT}")
|
SOURCE_GROUP("_ext-TinyXML" REGULAR_EXPRESSION "external/tinyxml/.*${REG_EXT}")
|
||||||
SOURCE_GROUP("_ext-CubicVR2" REGULAR_EXPRESSION "external/cubicvr2/.*${REG_EXT}")
|
SOURCE_GROUP("_ext-CubicVR2" REGULAR_EXPRESSION "external/cubicvr2/.*${REG_EXT}")
|
||||||
@ -534,7 +509,6 @@ include_directories (
|
|||||||
${PROJECT_SOURCE_DIR}/src/ui
|
${PROJECT_SOURCE_DIR}/src/ui
|
||||||
${PROJECT_SOURCE_DIR}/src/rig
|
${PROJECT_SOURCE_DIR}/src/rig
|
||||||
${PROJECT_SOURCE_DIR}/src
|
${PROJECT_SOURCE_DIR}/src
|
||||||
${PROJECT_SOURCE_DIR}/external/rtaudio
|
|
||||||
${PROJECT_SOURCE_DIR}/external/lodepng
|
${PROJECT_SOURCE_DIR}/external/lodepng
|
||||||
${PROJECT_SOURCE_DIR}/external/tinyxml
|
${PROJECT_SOURCE_DIR}/external/tinyxml
|
||||||
${PROJECT_SOURCE_DIR}/external/cubicvr2/math
|
${PROJECT_SOURCE_DIR}/external/cubicvr2/math
|
||||||
|
48
cmake/Modules/FindRtAudio.cmake
Normal file
48
cmake/Modules/FindRtAudio.cmake
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# https://github.com/idiap/juicer/blob/master/cmake/FindRtAudio.cmake
|
||||||
|
#
|
||||||
|
# Copyright 2015 by Idiap Research Institute
|
||||||
|
#
|
||||||
|
# Licensed under 3-clause BSD.
|
||||||
|
#
|
||||||
|
# Author(s):
|
||||||
|
# Phil Garner, November 2015
|
||||||
|
#
|
||||||
|
# ...but basically copied from FindSndFile in libube, in turn from the examples
|
||||||
|
# on the web.
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# Try to find RtAudio
|
||||||
|
# Once done this will define
|
||||||
|
# RTAUDIO_FOUND - System has RtAudio
|
||||||
|
# RTAUDIO_INCLUDE_DIR - The RtAudio include directories
|
||||||
|
# RTAUDIO_LIBRARIES - The libraries needed to use RtAudio
|
||||||
|
# RTAUDIO_DEFINITIONS - Compiler switches required for using RtAudio
|
||||||
|
# RTAUDIO_VERSION_STRING - the version of RtAudio found
|
||||||
|
#
|
||||||
|
|
||||||
|
find_package(PkgConfig)
|
||||||
|
pkg_check_modules(PC_RTAUDIO rtaudio)
|
||||||
|
|
||||||
|
set(RTAUDIO_DEFINITIONS ${PC_RTAUDIO_CFLAGS_OTHER})
|
||||||
|
set(RTAUDIO_VERSION_STRING ${PC_RTAUDIO_VERSION})
|
||||||
|
|
||||||
|
find_path(
|
||||||
|
RTAUDIO_INCLUDE_DIR RtAudio.h
|
||||||
|
HINTS ${PC_RTAUDIO_INCLUDEDIR} ${PC_RTAUDIO_INCLUDE_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(
|
||||||
|
RTAUDIO_LIBRARIES NAMES rtaudio
|
||||||
|
HINTS ${PC_RTAUDIO_LIBDIR} ${PC_RTAUDIO_LIBRARY_DIRS}
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(
|
||||||
|
RtAudio
|
||||||
|
REQUIRED_VARS RTAUDIO_LIBRARIES RTAUDIO_INCLUDE_DIR
|
||||||
|
VERSION_VAR RTAUDIO_VERSION_STRING
|
||||||
|
)
|
||||||
|
|
||||||
|
#mark_as_advanced(RTAUDIO_INCLUDE_DIR RTAUDIO_LIBRARIES)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user