add USE_SYSTEM_RTAUDIO flag, off by default

This commit is contained in:
Stefan Talpalaru 2017-02-07 17:07:44 +01:00
parent f4a60e6765
commit d1686f9699
No known key found for this signature in database
GPG Key ID: CBF7934204F1B6F9

View File

@ -214,19 +214,7 @@ IF (WIN32)
ENDIF()
ENDIF (WIN32)
IF (UNIX AND NOT APPLE)
set(BUILD_DEB OFF CACHE BOOL "Build DEB")
SET(LIQUID_LIB liquid)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl)
# use the system RtAudio which in turn provides OSS, ALSA, JACK,
# PulseAudio support depending on how it was compiled
find_package(RtAudio)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} ${RTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${RTAUDIO_DEFINITIONS})
include_directories(${RTAUDIO_INCLUDE_DIR})
ELSE(UNIX AND NOT APPLE)
MACRO(use_included_rtaudio)
SET (cubicsdr_sources
${cubicsdr_sources}
external/rtaudio/RtAudio.cpp
@ -237,6 +225,65 @@ ELSE(UNIX AND NOT APPLE)
)
SOURCE_GROUP("_ext-RTAudio" REGULAR_EXPRESSION "external/rtaudio/.*${REG_EXT}")
include_directories(${PROJECT_SOURCE_DIR}/external/rtaudio)
ENDMACRO(use_included_rtaudio)
IF (UNIX AND NOT APPLE)
set(BUILD_DEB OFF CACHE BOOL "Build DEB")
SET(USE_SYSTEM_RTAUDIO OFF CACHE BOOL "Use the system RtAudio which in turn provides OSS, ALSA, JACK, PulseAudio support depending on how it was compiled")
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(OTHER_LIBRARIES ${OTHER_LIBRARIES} dl)
IF(USE_SYSTEM_RTAUDIO)
find_package(RtAudio)
SET(OTHER_LIBRARIES ${OTHER_LIBRARIES} ${RTAUDIO_LIBRARIES})
ADD_DEFINITIONS(${RTAUDIO_DEFINITIONS})
include_directories(${RTAUDIO_INCLUDE_DIR})
ELSE(USE_SYSTEM_RTAUDIO)
use_included_rtaudio()
IF(USE_AUDIO_PULSE)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} pulse-simple pulse)
ADD_DEFINITIONS(
-D__LINUX_PULSE__
)
ENDIF(USE_AUDIO_PULSE)
IF(USE_AUDIO_JACK)
find_package(Jack)
SET (OTHER_LIBRARIES ${OTHER_LIBRARIES} ${JACK_LIBRARIES})
ADD_DEFINITIONS(
-D__UNIX_JACK__
)
include_directories(${JACK_INCLUDE_DIRS})
ENDIF(USE_AUDIO_JACK)
IF(USE_AUDIO_ALSA)
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(USE_SYSTEM_RTAUDIO)
ELSE(UNIX AND NOT APPLE)
use_included_rtaudio()
ENDIF(UNIX AND NOT APPLE)
IF (APPLE)
@ -258,6 +305,7 @@ ENDIF (APPLE)
SET (cubicsdr_sources
${cubicsdr_sources}
src/CubicSDR.cpp
src/AppFrame.cpp
src/AppConfig.cpp
@ -357,6 +405,7 @@ IF(ENABLE_DIGITAL_LAB)
ENDIF()
SET (cubicsdr_headers
${cubicsdr_headers}
src/CubicSDRDefs.h
src/CubicSDR.h
src/AppFrame.h