Files
macports-ports/science/gr-lora/files/patch-build-fixes.diff

174 lines
5.1 KiB
Diff

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -71,7 +71,7 @@
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
)
-find_package(Boost "1.35" COMPONENTS filesystem system)
+find_package(Boost "1.35" COMPONENTS thread filesystem system)
if(NOT Boost_FOUND)
message(FATAL_ERROR "Boost required to compile lora")
@@ -117,8 +117,6 @@
########################################################################
# 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 @@
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 @@
${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
--- /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)
--- 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
@@ -35,22 +32,17 @@
message_socket_source_impl.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
########################################################################
@@ -77,11 +69,9 @@
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)
--- 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
########################################################################