Add libsamplerate as a cmake dependency for codec2.
authorhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 13 Mar 2017 17:50:30 +0000 (17:50 +0000)
committerhobbes1069 <hobbes1069@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 13 Mar 2017 17:50:30 +0000 (17:50 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@3058 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/CMakeLists.txt

index 940beb340569086a4762a6402fdfaaccd582aa69..ebf8fff1c0073e951e8d4181d92baf15bdddead1 100644 (file)
@@ -172,6 +172,24 @@ if(UNITTEST)
         message(FATAL_ERROR "Speex DSP library not found!")
     endif()
 
+    #
+    # Samplerate Library
+    #
+    message(STATUS "Looking for samplerate...")
+    find_library(LIBSAMPLERATE samplerate)
+    find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
+    message(STATUS "  samplerate headers: ${LIBSAMPLERATE_INCLUDE_DIR}")
+    message(STATUS "  samplerate library: ${LIBSAMPLERATE}")
+    if(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        list(APPEND FREEDV_LINK_LIBS ${CMAKE_REQUIRED_LIBRARIES})
+        include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
+    else(LIBSTAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+        message(FATAL_ERROR "samplerate library not found.
+On Linux systems try installing:
+    samplerate-devel  (RPM based systems)
+    libsamplerate-dev (DEB based systems)")
+    endif(LIBSAMPLERATE AND LIBSAMPLERATE_INCLUDE_DIR)
+
     add_subdirectory(unittest)
 endif(UNITTEST)