mirror of
https://github.com/qTox/qTox.git
synced 2024-03-22 14:00:36 +08:00
fix(build): add install steps for libfilteraudio on OSX
This commit is contained in:
parent
526701fa9f
commit
8f2401fee6
|
@ -8,6 +8,7 @@ cmake_minimum_required(VERSION 2.8.11)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
|
option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
|
||||||
|
option(USE_FILTERAUDIO "Enable the echo canceling backend" ON)
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE Debug)
|
set(CMAKE_BUILD_TYPE Debug)
|
||||||
|
@ -16,6 +17,12 @@ endif()
|
||||||
set(ENV{PKG_CONFIG_PATH}
|
set(ENV{PKG_CONFIG_PATH}
|
||||||
${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
${CMAKE_SOURCE_DIR}/libs/lib/pkgconfig:/opt/ffmpeg/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
||||||
|
|
||||||
|
# necessary to find openal-soft on mac os
|
||||||
|
if(APPLE)
|
||||||
|
set(ENV{PKG_CONFIG_PATH}
|
||||||
|
/usr/local/opt/openal-soft/lib/pkgconfig:$ENV{PKG_CONFIG_PATH})
|
||||||
|
endif()
|
||||||
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND brew --prefix qt5
|
COMMAND brew --prefix qt5
|
||||||
OUTPUT_VARIABLE QT_PREFIX_PATH
|
OUTPUT_VARIABLE QT_PREFIX_PATH
|
||||||
|
@ -185,8 +192,6 @@ set(${PROJECT_NAME}_SOURCES
|
||||||
src/audio/audio.h
|
src/audio/audio.h
|
||||||
src/audio/backend/openal.cpp
|
src/audio/backend/openal.cpp
|
||||||
src/audio/backend/openal.h
|
src/audio/backend/openal.h
|
||||||
src/audio/backend/openal2.cpp
|
|
||||||
src/audio/backend/openal2.h
|
|
||||||
src/chatlog/chatlinecontent.cpp
|
src/chatlog/chatlinecontent.cpp
|
||||||
src/chatlog/chatlinecontent.h
|
src/chatlog/chatlinecontent.h
|
||||||
src/chatlog/chatlinecontentproxy.cpp
|
src/chatlog/chatlinecontentproxy.cpp
|
||||||
|
@ -520,6 +525,19 @@ if(${ENABLE_GTK_SYSTRAY})
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(${USE_FILTERAUDIO})
|
||||||
|
search_dependency(FILTERAUDIO LIBRARY filteraudio OPTIONAL)
|
||||||
|
if(${FILTERAUDIO_FOUND})
|
||||||
|
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
|
||||||
|
src/audio/backend/openal2.cpp
|
||||||
|
src/audio/backend/openal2.h)
|
||||||
|
add_definitions(-DUSE_FILTERAUDIO=1)
|
||||||
|
message(STATUS "using filteraudio")
|
||||||
|
else()
|
||||||
|
message(STATUS "not using filteraudio, libfilteraudio not found")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
# the compiler flags for compiling C sources
|
# the compiler flags for compiling C sources
|
||||||
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
|
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
|
||||||
|
|
||||||
|
|
|
@ -116,7 +116,7 @@ if (NOT TOXCORE_FOUND OR
|
||||||
search_dependency(TOXAV PACKAGE libtoxav)
|
search_dependency(TOXAV PACKAGE libtoxav)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
search_dependency(OPENAL PACKAGE openal FRAMEWORK OpenAL)
|
search_dependency(OPENAL PACKAGE openal)
|
||||||
search_dependency(FILTERAUDIO LIBRARY filteraudio)
|
search_dependency(FILTERAUDIO LIBRARY filteraudio)
|
||||||
|
|
||||||
if (PLATFORM_EXTENSIONS AND UNIX AND NOT APPLE)
|
if (PLATFORM_EXTENSIONS AND UNIX AND NOT APPLE)
|
||||||
|
|
|
@ -41,6 +41,7 @@ QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1
|
||||||
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
|
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
|
||||||
|
|
||||||
TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location
|
TOXCORE_DIR="${MAIN_DIR}/toxcore" # Change to Git location
|
||||||
|
FILTERAUIO_DIR="${MAIN_DIR}/filter_audio" # Change to Git location
|
||||||
|
|
||||||
LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
|
LIB_INSTALL_PREFIX="${QTOX_DIR}/libs"
|
||||||
|
|
||||||
|
@ -166,7 +167,13 @@ install() {
|
||||||
else
|
else
|
||||||
brew install cmake
|
brew install cmake
|
||||||
fi
|
fi
|
||||||
brew install ffmpeg qrencode qt5 sqlcipher
|
brew install ffmpeg qrencode qt5 sqlcipher openal-soft
|
||||||
|
|
||||||
|
fcho "Cloning filter_audio ... "
|
||||||
|
git clone --branch v0.0.1 --depth=1 https://github.com/irungentoo/filter_audio "$FILTERAUIO_DIR"
|
||||||
|
cd "$FILTERAUIO_DIR"
|
||||||
|
fcho "Installing filter_audio ... "
|
||||||
|
make install PREFIX="$LIB_INSTALL_PREFIX"
|
||||||
|
|
||||||
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
|
QT_VER=($(ls ${QT_DIR} | sed -n -e 's/^\([0-9]*\.([0-9]*\.([0-9]*\).*/\1/' -e '1p;$p'))
|
||||||
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
|
QT_DIR_VER="${QT_DIR}/${QT_VER[1]}"
|
||||||
|
|
|
@ -32,14 +32,8 @@
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
#include <OpenAL/al.h>
|
|
||||||
#include <OpenAL/alc.h>
|
|
||||||
#else
|
|
||||||
#include <AL/al.h>
|
#include <AL/al.h>
|
||||||
#include <AL/alc.h>
|
#include <AL/alc.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef ALC_ALL_DEVICES_SPECIFIER
|
#ifndef ALC_ALL_DEVICES_SPECIFIER
|
||||||
// compatibility with older versions of OpenAL
|
// compatibility with older versions of OpenAL
|
||||||
|
|
|
@ -32,15 +32,9 @@
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#if defined(__APPLE__) && defined(__MACH__)
|
|
||||||
#include <OpenAL/al.h>
|
|
||||||
#include <OpenAL/alc.h>
|
|
||||||
#include <OpenAL/alext.h>
|
|
||||||
#else
|
|
||||||
#include <AL/al.h>
|
#include <AL/al.h>
|
||||||
#include <AL/alc.h>
|
#include <AL/alc.h>
|
||||||
#include <AL/alext.h>
|
#include <AL/alext.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <filter_audio.h>
|
#include <filter_audio.h>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user