diff --git a/cmake/modules/FindGverb.cmake b/cmake/modules/FindGverb.cmake index 8990009b59..f71e1256a2 100644 --- a/cmake/modules/FindGverb.cmake +++ b/cmake/modules/FindGverb.cmake @@ -13,26 +13,27 @@ # # Distributed under the Apache License, Version 2.0. # 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 () - find_path(GVERB_INCLUDE_DIRS gverb.h ${GVERB_ROOT_DIR}/include) - if (GVERB_INCLUDE_DIRS) - set(GVERB_FOUND TRUE) - endif (GVERB_INCLUDE_DIRS) +include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") +hifi_library_search_hints("gverb") - if (GVERB_FOUND) - if (NOT GVERB_FIND_QUIETLY) - message(STATUS "Found Gverb: ${GVERB_INCLUDE_DIRS}") - endif (NOT GVERB_FIND_QUIETLY) - else () - if (GVERB_FIND_REQUIRED) - message(FATAL_ERROR "Could NOT find Gverb") - endif (GVERB_FIND_REQUIRED) - endif () +find_path(GVERB_INCLUDE_DIRS gverb.h PATH_SUFFIXES include HINTS ${GVERB_SEARCH_DIRS}) +find_path(GVERB_SRC_DIRS gverb.c PATH_SUFFIXES src HINTS ${GVERB_SEARCH_DIRS}) + +if (GVERB_INCLUDE_DIRS) + set(GVERB_FOUND TRUE) +endif (GVERB_INCLUDE_DIRS) + +if (GVERB_FOUND) + message(STATUS "Found Gverb: ${GVERB_INCLUDE_DIRS}") +else () + message(FATAL_ERROR "Could NOT find Gverb. Read ./interface/externals/gverb/readme.txt") +endif () endif () diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 1c9c68ec5f..d0868aebcd 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -14,9 +14,17 @@ endforeach() find_package(Qt5LinguistTools REQUIRED) find_package(Qt5LinguistToolsMacros) + # As Gverb is currently the only reverb library, it's required. find_package(Gverb REQUIRED) +if (GVERB_FOUND) + file(GLOB GVERB_SRCS ${GVERB_SRC_DIRS}/*.c) + include_directories(${GVERB_INCLUDE_DIRS}) + add_library(Gverb ${GVERB_SRCS}) +message(STATUS "Gverb srcs: ${GVERB_SRCS}") +endif (GVERB_FOUND) + if (DEFINED ENV{JOB_ID}) set(BUILD_SEQ $ENV{JOB_ID}) else () @@ -169,12 +177,6 @@ if (QXMPP_FOUND AND NOT DISABLE_QXMPP AND WIN32) add_definitions(-DQXMPP_STATIC) endif () -if (GVERB_FOUND) - add_subdirectory(${GVERB_ROOT_DIR}) - include_directories(${GVERB_INCLUDE_DIRS}) - target_link_libraries(${TARGET_NAME} gverb) -endif (GVERB_FOUND) - # include headers for interface and InterfaceConfig. include_directories("${PROJECT_SOURCE_DIR}/src" "${PROJECT_BINARY_DIR}/includes") diff --git a/interface/external/gverb/CMakeLists.txt b/interface/external/gverb/CMakeLists.txt deleted file mode 100644 index 7913348e1d..0000000000 --- a/interface/external/gverb/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -set(TARGET_NAME gverb) -project(${TARGET_NAME}) - -# grab the implementation and header files -file(GLOB GVERB_SRCS src/*.c) - -include_directories(include) - -add_library(${TARGET_NAME} ${GVERB_SRCS}) diff --git a/interface/src/Audio.h b/interface/src/Audio.h index 3b7c2eef03..900b6ce0d6 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -49,6 +49,7 @@ extern "C" { #include + #include } static const int NUM_AUDIO_CHANNELS = 2;