commit b0654dc630a8c5150c4ea2cfdefaf68d71db7037
Author: Michael Dickens <mlk@alum.mit.edu>
Date:   Thu Sep 7 09:15:15 2017 -0400

    commit

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d4b6305..56136ec 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -117,8 +117,6 @@ endif(APPLE)
 ########################################################################
 # Find gnuradio build dependencies
 ########################################################################
-find_package(CppUnit)
-find_package(Doxygen)
 
 # Search for GNU Radio and its components and versions. Add any
 # components required to the list of GR_REQUIRED_COMPONENTS (in all
@@ -127,13 +125,25 @@ find_package(Doxygen)
 set(GR_REQUIRED_COMPONENTS RUNTIME FILTER)
 find_package(Gnuradio "3.7.2" REQUIRED)
 
+find_package(CppUnit)
 if(NOT CPPUNIT_FOUND)
-    message(FATAL_ERROR "CppUnit required to compile lora")
+    message(FATAL_ERROR "CppUnit required to compile gr-lora")
+endif()
+
+find_package(Volk)
+if(NOT VOLK_FOUND)
+    message(FATAL_ERROR "Volk required to compile gr-lora")
+endif()
+
+find_package(Liquid-DSP)
+if(NOT LIQUID_DSP_FOUND)
+    message(FATAL_ERROR "Liquid-DSP required to compile gr-lora")
 endif()
 
 ########################################################################
 # Setup doxygen option
 ########################################################################
+find_package(Doxygen)
 if(DOXYGEN_FOUND)
 	option(ENABLE_DOXYGEN "Build docs using Doxygen" ON)
 else(DOXYGEN_FOUND)
@@ -151,12 +161,16 @@ include_directories(
     ${Boost_INCLUDE_DIRS}
     ${CPPUNIT_INCLUDE_DIRS}
     ${GNURADIO_ALL_INCLUDE_DIRS}
+    ${VOLK_INCLUDE_DIRS}
+    ${LIQUID_DSP_INCLUDE_DIRS}
 )
 
 link_directories(
     ${Boost_LIBRARY_DIRS}
     ${CPPUNIT_LIBRARY_DIRS}
     ${GNURADIO_RUNTIME_LIBRARY_DIRS}
+    ${VOLK_LIBRARY_DIRS}
+    ${LIQUID_DSP_LIBRARY_DIRS}
 )
 
 # Set component parameters
diff --git a/cmake/Modules/FindLiquid-DSP.cmake b/cmake/Modules/FindLiquid-DSP.cmake
new file mode 100644
index 0000000..921bfbe
--- /dev/null
+++ b/cmake/Modules/FindLiquid-DSP.cmake
@@ -0,0 +1,33 @@
+#
+# Find the Liquid-DSP includes and library
+#
+# This module defines
+# LIQUID_DSP_INCLUDE_DIR, where to find the main Liquid-DSP header
+# LIQUID_DSP_LIBRARIES, the libraries to link against to use Liquid-DSP.
+# LIQUID_DSP_FOUND, If false, do not try to use Liquid-DSP.
+
+FIND_PATH(LIQUID_DSP_INCLUDE_DIRS
+    NAMES liquid/liquid.h
+    HINTS ${LIQUID_DIR}/include
+    ${CMAKE_INSTALL_PREFIX}/include
+    PATHS
+    /usr/local/include
+    /usr/include
+    /opt/local/include
+)
+
+FIND_LIBRARY(LIQUID_DSP_LIBRARIES
+    NAMES liquid
+    HINTS ${LIQUID_DIR}/lib
+    ${LIQUID_DSP_INCLUDE_DIRS}/../lib
+    ${CMAKE_INSTALL_PREFIX}/lib
+    ${CMAKE_INSTALL_PREFIX}/lib64
+    PATHS
+    /usr/local/lib
+    /usr/lib
+    /opt/local/lib
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIQUID_DSP DEFAULT_MSG LIQUID_DSP_LIBRARIES LIQUID_DSP_INCLUDE_DIRS)
+MARK_AS_ADVANCED(LIQUID_DSP_LIBRARIES LIQUID_DSP_INCLUDE_DIRS)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 8659c0f..877145a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -22,9 +22,6 @@
 ########################################################################
 include(GrPlatform) #define LIB_SUFFIX
 
-include_directories(${Boost_INCLUDE_DIR})
-link_directories(${Boost_LIBRARY_DIRS})
-
 list(APPEND lora_sources
     decoder_impl.cc
     message_file_sink_impl.cc
@@ -34,22 +31,17 @@ list(APPEND lora_sources
     debugger.cc
 )
 
-set(lora_sources "${lora_sources}" PARENT_SCOPE)
-if(NOT lora_sources)
-    MESSAGE(STATUS "No C++ sources... skipping lib/")
-    return()
-endif(NOT lora_sources)
+list(APPEND lora_libs
+    ${Boost_LIBRARIES}
+    ${GNURADIO_ALL_LIBRARIES}
+    ${VOLK_LIBRARIES}
+    ${LIQUID_DSP_LIBRARIES}
+)
 
 add_library(gnuradio-lora SHARED ${lora_sources})
-target_link_libraries(gnuradio-lora ${Boost_LIBRARIES} ${GNURADIO_ALL_LIBRARIES} liquid)
+target_link_libraries(gnuradio-lora ${lora_libs})
 set_target_properties(gnuradio-lora PROPERTIES DEFINE_SYMBOL "gnuradio_lora_EXPORTS")
 
-if(APPLE)
-    set_target_properties(gnuradio-lora PROPERTIES
-        INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib"
-    )
-endif(APPLE)
-
 ########################################################################
 # Install built library files
 ########################################################################
@@ -76,11 +68,9 @@ add_executable(test-lora ${test_lora_sources})
 
 target_link_libraries(
   test-lora
-  ${GNURADIO_RUNTIME_LIBRARIES}
-  ${Boost_LIBRARIES}
-  ${CPPUNIT_LIBRARIES}
   gnuradio-lora
-  liquid
+  ${lora_libs}
+  ${CPPUNIT_LIBRARIES}
 )
 
 GR_ADD_TEST(test_lora test-lora)
diff --git a/swig/CMakeLists.txt b/swig/CMakeLists.txt
index 9c120fc..a507c92 100644
--- a/swig/CMakeLists.txt
+++ b/swig/CMakeLists.txt
@@ -17,14 +17,6 @@
 # the Free Software Foundation, Inc., 51 Franklin Street,
 # Boston, MA 02110-1301, USA.
 
-########################################################################
-# Check if there is C++ code at all
-########################################################################
-if(NOT lora_sources)
-	MESSAGE(STATUS "No C++ sources... skipping swig/")
-	return()
-endif(NOT lora_sources)
-
 ########################################################################
 # Include swig generation macros
 ########################################################################
