From fd309b6990eacd28c10b4e994e08a1ad97edca5c Mon Sep 17 00:00:00 2001
From: "A. Maitland Bottoms" <bottoms@debian.org>
Date: Sat, 17 Oct 2020 22:21:56 -0400
Subject: [PATCH 5/6] optional lpcnetfreedv

Debian package builds with a system-wide libcodec2
and lpcnetfreedv might not be found, and need not be found.
---
 CMakeLists.txt     | 2 +-
 src/CMakeLists.txt | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fbfc055..35f5e3e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -266,7 +266,7 @@ else(CODEC2_BUILD_DIR)
         get_target_property(CODEC2_INCLUDE_DIRS codec2 INTERFACE_INCLUDE_DIRECTORIES)
         message(STATUS "  codec2 library: ${CODEC2_LIBRARY}")
         message(STATUS "  codec2 headers: ${CODEC2_INCLUDE_DIRS}")
-        find_package(lpcnetfreedv REQUIRED)
+        find_package(lpcnetfreedv)
     else()
         # Try to find manually
         find_path(CODEC2_INCLUDE_DIRS codec2.h
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9b93a01..700572c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -67,7 +67,7 @@ else()
 endif(APPLE)
 
 # Link imported or build tree targets.
-target_link_libraries(freedv codec2 lpcnetfreedv)
+target_link_libraries(freedv codec2)
 
 # Add build dependencies for interally built external libraries.
 if(USE_INTERNAL_CODEC2)
-- 
2.20.1

