mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 16:32:38 +02:00
make gverb a cmake external project
This commit is contained in:
parent
ab0692229d
commit
4300836810
7 changed files with 35 additions and 48 deletions
4
cmake/externals/glm/CMakeLists.txt
vendored
4
cmake/externals/glm/CMakeLists.txt
vendored
|
@ -9,7 +9,7 @@ ExternalProject_Add(
|
|||
LOG_DOWNLOAD ON
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(${EXTERNAL_NAME} install_dir)
|
||||
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||
|
||||
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${install_dir}/include CACHE TYPE STRING)
|
||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${INSTALL_DIR}/include CACHE TYPE STRING)
|
16
cmake/externals/gverb/CMakeLists.txt
vendored
Normal file
16
cmake/externals/gverb/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
set(EXTERNAL_NAME gverb)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
${EXTERNAL_NAME}
|
||||
PREFIX ${EXTERNAL_NAME}
|
||||
GIT_REPOSITORY https://github.com/birarda/gverb.git
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
|
||||
LOG_DOWNLOAD ON
|
||||
)
|
||||
|
||||
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||
|
||||
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${INSTALL_DIR}/include CACHE TYPE STRING)
|
||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/libgverb.a CACHE TYPE STRING)
|
|
@ -15,25 +15,11 @@
|
|||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
#
|
||||
|
||||
if (GVERB_INCLUDE_DIRS)
|
||||
# in cache already
|
||||
set(GVERB_FOUND TRUE)
|
||||
else (GVERB_INCLUDE_DIRS)
|
||||
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
|
||||
hifi_library_search_hints("gverb")
|
||||
|
||||
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
|
||||
hifi_library_search_hints("gverb")
|
||||
find_path(GVERB_INCLUDE_DIRS gverb.h PATH_SUFFIXES include HINTS ${GVERB_SEARCH_DIRS})
|
||||
find_path(GVERB_LIBRARIES gverb PATH_SUFFIXES lib HINTS ${GVERB_SEARCH_DIRS})
|
||||
|
||||
find_path(GVERB_INCLUDE_DIRS gverb.h PATH_SUFFIXES include HINTS ${GVERB_SEARCH_DIRS} NO_CMAKE_FIND_ROOT_PATH)
|
||||
find_path(GVERB_SRC_DIRS gverb.c PATH_SUFFIXES src HINTS ${GVERB_SEARCH_DIRS} NO_CMAKE_FIND_ROOT_PATH)
|
||||
|
||||
if (GVERB_INCLUDE_DIRS)
|
||||
set(GVERB_FOUND TRUE)
|
||||
endif (GVERB_INCLUDE_DIRS)
|
||||
|
||||
if (GVERB_FOUND)
|
||||
message(STATUS "Found Gverb: ${GVERB_INCLUDE_DIRS}")
|
||||
else (GVERB_FOUND)
|
||||
message(FATAL_ERROR "Could NOT find Gverb. Read ./libraries/audio-client/externals/gverb/readme.txt")
|
||||
endif (GVERB_FOUND)
|
||||
|
||||
endif(GVERB_INCLUDE_DIRS)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(GVERB DEFAULT_MSG GVERB_INCLUDE_DIRS GVERB_LIBRARIES)
|
|
@ -8,17 +8,13 @@ link_hifi_libraries(audio)
|
|||
# append audio includes to our list of includes to bubble
|
||||
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${HIFI_LIBRARY_DIR}/audio/src")
|
||||
|
||||
set(GVERB_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/gverb")
|
||||
# have CMake grab Gverb from git and then set up linking and directory include
|
||||
add_dependency_external_project(gverb)
|
||||
|
||||
# As Gverb is currently the only reverb library, it's required.
|
||||
find_package(Gverb REQUIRED)
|
||||
|
||||
file(GLOB GVERB_SRCS ${GVERB_SRC_DIRS}/*.c)
|
||||
add_library(gverb STATIC ${GVERB_SRCS})
|
||||
target_link_libraries(${TARGET_NAME} gverb)
|
||||
|
||||
# append gverb includes to our list of includes to bubble
|
||||
list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${GVERB_INCLUDE_DIRS}")
|
||||
target_link_libraries(${TARGET_NAME} ${GVERB_LIBRARIES})
|
||||
target_include_directories(${TARGET_NAME} PRIVATE ${GVERB_INCLUDE_DIRS})
|
||||
|
||||
# we use libsoxr for resampling
|
||||
find_package(Soxr REQUIRED)
|
||||
|
|
14
libraries/audio-client/external/gverb/readme.txt
vendored
14
libraries/audio-client/external/gverb/readme.txt
vendored
|
@ -1,14 +0,0 @@
|
|||
Instructions for adding the Gverb library to audio-client
|
||||
(This is a required library)
|
||||
Clément Brisset, October 22nd, 2014
|
||||
|
||||
1. Go to https://github.com/highfidelity/gverb
|
||||
Or download the sources directly via this link:
|
||||
https://github.com/highfidelity/gverb/archive/master.zip
|
||||
|
||||
2. Extract the archive
|
||||
|
||||
3. Place the directories “include” and “src” in libraries/audio-client/external/gverb
|
||||
(Normally next to this readme)
|
||||
|
||||
4. Clear your build directory, run cmake, build and you should be all set.
|
|
@ -33,6 +33,11 @@
|
|||
#include <QtMultimedia/QAudioInput>
|
||||
#include <QtMultimedia/QAudioOutput>
|
||||
|
||||
extern "C" {
|
||||
#include <gverb/gverb.h>
|
||||
#include <gverb/gverbdsp.h>
|
||||
}
|
||||
|
||||
#include <soxr.h>
|
||||
|
||||
#include <NodeList.h>
|
||||
|
|
|
@ -47,10 +47,7 @@
|
|||
#pragma warning( disable : 4273 )
|
||||
#pragma warning( disable : 4305 )
|
||||
#endif
|
||||
extern "C" {
|
||||
#include <gverb.h>
|
||||
#include <gverbdsp.h>
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
@ -68,6 +65,7 @@ class QAudioInput;
|
|||
class QAudioOutput;
|
||||
class QIODevice;
|
||||
struct soxr;
|
||||
typedef struct ty_gverb ty_gverb;
|
||||
|
||||
typedef glm::vec3 (*AudioPositionGetter)();
|
||||
typedef glm::quat (*AudioOrientationGetter)();
|
||||
|
|
Loading…
Reference in a new issue