From 629ee7b0c153faeb3a1f1101e956eeca9b1c3558 Mon Sep 17 00:00:00 2001
From: Ken Cooke <ken@highfidelity.io>
Date: Thu, 24 Sep 2015 15:12:10 -0700
Subject: [PATCH] Completely remove SOXR from cmake

---
 BUILD.md                              |  1 -
 cmake/externals/soxr/CMakeLists.txt   | 34 ---------------------
 cmake/modules/FindSoxr.cmake          | 43 ---------------------------
 libraries/audio-client/CMakeLists.txt |  7 +----
 libraries/audio/CMakeLists.txt        |  6 ----
 5 files changed, 1 insertion(+), 90 deletions(-)
 delete mode 100644 cmake/externals/soxr/CMakeLists.txt
 delete mode 100644 cmake/modules/FindSoxr.cmake

diff --git a/BUILD.md b/BUILD.md
index ae4a67c2ee..e2f310bb1f 100644
--- a/BUILD.md
+++ b/BUILD.md
@@ -13,7 +13,6 @@
 * [Intel Threading Building Blocks](https://www.threadingbuildingblocks.org/) ~> 4.3
 * [glm](http://glm.g-truc.net/0.9.5/index.html) ~> 0.9.5.4
 * [gverb](https://github.com/highfidelity/gverb)
-* [Soxr](http://sourceforge.net/projects/soxr/) ~> 0.1.1
 
 The following external projects are optional dependencies. You can indicate to CMake that you would like to include them by passing -DGET_$NAME=1 when running a clean CMake build. For example, to get CMake to download and compile SDL2 you would pass -DGET_SDL2=1.
 
diff --git a/cmake/externals/soxr/CMakeLists.txt b/cmake/externals/soxr/CMakeLists.txt
deleted file mode 100644
index 69d2276ab9..0000000000
--- a/cmake/externals/soxr/CMakeLists.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-set(EXTERNAL_NAME soxr)
-
-if (ANDROID)
-  set(PLATFORM_CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" "-DANDROID_NATIVE_API_LEVEL=19" "-DHAVE_WORDS_BIGENDIAN_EXITCODE=1")
-endif ()
-
-include(ExternalProject)
-ExternalProject_Add(
-  ${EXTERNAL_NAME}
-  URL http://hifi-public.s3.amazonaws.com/dependencies/soxr-0.1.1.zip
-  URL_MD5 349b5b2f323a7380bc12186d98c77d1d
-  CMAKE_ARGS ${PLATFORM_CMAKE_ARGS} -DBUILD_SHARED_LIBS=1 -DBUILD_TESTS=0 -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
-  LOG_DOWNLOAD 1
-  LOG_CONFIGURE 1
-  LOG_BUILD 1
-  BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build
-)
-
-# Hide this external target (for ide users)
-set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
-
-ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
-
-string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
-set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${INSTALL_DIR}/include CACHE PATH "List of soxr include directories")
-
-if (WIN32) 
-  set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/soxr.lib CACHE FILEPATH "List of soxr libraries")
-  set(${EXTERNAL_NAME_UPPER}_DLL_PATH ${INSTALL_DIR}/bin CACHE PATH "Path to soxr dll")
-elseif (APPLE)
-  set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/libsoxr.dylib CACHE FILEPATH "List of soxr libraries")
-else ()
-  set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/libsoxr.so CACHE FILEPATH "List of soxr libraries")
-endif ()
\ No newline at end of file
diff --git a/cmake/modules/FindSoxr.cmake b/cmake/modules/FindSoxr.cmake
deleted file mode 100644
index df6ad8050e..0000000000
--- a/cmake/modules/FindSoxr.cmake
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-#  FindSoxr.cmake
-# 
-#  Try to find the libsoxr resampling library
-#
-#  You can provide a LIBSOXR_ROOT_DIR which contains lib and include directories
-#
-#  Once done this will define
-#
-#  SOXR_FOUND - system found libsoxr
-#  SOXR_INCLUDE_DIRS - the libsoxr include directory
-#  SOXR_LIBRARIES - link to this to use libsoxr
-#
-#  Created on 1/22/2015 by Stephen Birarda
-#  Copyright 2015 High Fidelity, Inc.
-#
-#  Distributed under the Apache License, Version 2.0.
-#  See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
-# 
-
-include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
-hifi_library_search_hints("soxr")
-
-find_path(SOXR_INCLUDE_DIRS soxr.h PATH_SUFFIXES include HINTS ${SOXR_SEARCH_DIRS})
-find_library(SOXR_LIBRARIES NAMES soxr PATH_SUFFIXES lib HINTS ${SOXR_SEARCH_DIRS})
-
-if (WIN32)
-  find_path(SOXR_DLL_PATH soxr.dll PATH_SUFFIXES bin HINTS ${SOXR_SEARCH_DIRS}) 
-endif()
-
-set(SOXR_REQUIREMENTS SOXR_INCLUDE_DIRS SOXR_LIBRARIES)
-if (WIN32)
-  list(APPEND SOXR_REQUIREMENTS SOXR_DLL_PATH)
-endif ()
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Soxr DEFAULT_MSG ${SOXR_REQUIREMENTS})
-
-if (WIN32)
-  add_paths_to_fixup_libs(${SOXR_DLL_PATH})
-endif ()
-
-mark_as_advanced(SOXR_INCLUDE_DIRS SOXR_LIBRARIES SOXR_SEARCH_DIRS)
\ No newline at end of file
diff --git a/libraries/audio-client/CMakeLists.txt b/libraries/audio-client/CMakeLists.txt
index 76f4cb4a0f..f631ec6387 100644
--- a/libraries/audio-client/CMakeLists.txt
+++ b/libraries/audio-client/CMakeLists.txt
@@ -9,18 +9,13 @@ link_hifi_libraries(audio)
 target_include_directories(${TARGET_NAME} PUBLIC "${HIFI_LIBRARY_DIR}/audio/src")
 
 # have CMake grab externals for us
-add_dependency_external_projects(gverb soxr)
+add_dependency_external_projects(gverb)
 
 find_package(Gverb REQUIRED)
 
 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)
-target_link_libraries(${TARGET_NAME} ${SOXR_LIBRARIES})
-target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${SOXR_INCLUDE_DIRS})
-
 if (APPLE)
   find_library(CoreAudio CoreAudio)
   find_library(CoreFoundation CoreFoundation)
diff --git a/libraries/audio/CMakeLists.txt b/libraries/audio/CMakeLists.txt
index c03f588d94..5134ccda36 100644
--- a/libraries/audio/CMakeLists.txt
+++ b/libraries/audio/CMakeLists.txt
@@ -7,10 +7,4 @@ add_dependency_external_projects(glm)
 find_package(GLM REQUIRED)
 target_include_directories(${TARGET_NAME} PUBLIC ${GLM_INCLUDE_DIRS})
 
-# we use libsoxr for resampling
-add_dependency_external_projects(soxr)
-find_package(Soxr REQUIRED)
-target_link_libraries(${TARGET_NAME} ${SOXR_LIBRARIES})
-target_include_directories(${TARGET_NAME} SYSTEM PRIVATE ${SOXR_INCLUDE_DIRS})
-
 link_hifi_libraries(networking shared)