mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-26 00:46:59 +00:00
Improve GNU Radio 3.7 / 3.8 handling
This commit is contained in:
parent
f9c54e57cc
commit
c1b48d675a
@ -695,7 +695,7 @@ endif()
|
||||
################################################################################
|
||||
# GNU Radio - https://gnuradio.org
|
||||
################################################################################
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT)
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS FFT FILTER ANALOG)
|
||||
|
||||
find_package(UHD)
|
||||
set_package_properties(UHD PROPERTIES
|
||||
@ -719,10 +719,10 @@ set_package_properties(GNURADIO PROPERTIES
|
||||
PURPOSE "Implements flowgraph scheduler, provides some processing blocks and classes to create new ones."
|
||||
TYPE REQUIRED
|
||||
)
|
||||
if(PC_GNURADIO_RUNTIME_VERSION)
|
||||
if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
|
||||
if(GNURADIO_VERSION)
|
||||
if(GNURADIO_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
|
||||
unset(GNURADIO_RUNTIME_FOUND)
|
||||
message(STATUS "The GNU Radio version installed in your system is too old.")
|
||||
message(STATUS "The GNU Radio version installed in your system (v${GNURADIO_VERSION}) is too old.")
|
||||
endif()
|
||||
endif()
|
||||
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||
@ -730,15 +730,14 @@ if(NOT GNURADIO_RUNTIME_FOUND)
|
||||
if(OS_IS_LINUX)
|
||||
message("Go to https://github.com/gnuradio/pybombs")
|
||||
message("and follow the instructions to install GNU Radio in your system.")
|
||||
message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(OS_IS_MACOSX)
|
||||
message("You can install it easily via Macports:")
|
||||
message(" sudo port install gnuradio ")
|
||||
message("Alternatively, you can use homebrew:")
|
||||
message(" brew install gnuradio")
|
||||
message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
|
||||
endif()
|
||||
message(FATAL_ERROR "GNU Radio v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr.")
|
||||
else()
|
||||
if(NOT TARGET Gnuradio::runtime)
|
||||
add_library(Gnuradio::runtime SHARED IMPORTED)
|
||||
|
@ -24,7 +24,7 @@ include(FindPackageHandleStandardArgs)
|
||||
|
||||
# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list
|
||||
if(NOT GR_REQUIRED_COMPONENTS)
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD)
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS FFT FILTER ANALOG)
|
||||
endif()
|
||||
|
||||
# Allows us to use all .cmake files in this directory
|
||||
@ -43,9 +43,6 @@ macro(LIST_CONTAINS var value)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# Trick for feature_summary
|
||||
set(GNURADIO_FOUND TRUE)
|
||||
|
||||
function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
|
||||
list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS})
|
||||
if(NOT REQUIRED_MODULE)
|
||||
@ -150,24 +147,21 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
|
||||
endfunction()
|
||||
|
||||
gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime)
|
||||
gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
|
||||
gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
|
||||
gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
|
||||
gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks)
|
||||
gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels)
|
||||
gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital)
|
||||
gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd)
|
||||
gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec)
|
||||
gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft)
|
||||
gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter)
|
||||
gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa)
|
||||
gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager)
|
||||
gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
|
||||
gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital)
|
||||
gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
|
||||
gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels)
|
||||
gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui)
|
||||
gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis)
|
||||
gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd)
|
||||
gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder)
|
||||
gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet)
|
||||
gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui)
|
||||
gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
|
||||
|
||||
|
||||
list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES)
|
||||
@ -206,4 +200,7 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION)
|
||||
endif()
|
||||
|
||||
# Trick for feature_summary
|
||||
set(GNURADIO_FOUND TRUE)
|
||||
if(NOT DEFINED GNURADIO_FOUND)
|
||||
set(GNURADIO_FOUND TRUE)
|
||||
endif()
|
||||
set(GNURADIO_VERSION ${PC_GNURADIO_RUNTIME_VERSION})
|
||||
|
@ -62,7 +62,7 @@ target_include_directories(input_filter_adapters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.20")
|
||||
if(NOT (GNURADIO_VERSION VERSION_LESS "3.8"))
|
||||
target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1)
|
||||
endif()
|
||||
|
||||
|
@ -52,7 +52,7 @@ target_include_directories(resampler_adapters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
)
|
||||
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.20")
|
||||
if(NOT (GNURADIO_VERSION VERSION_LESS "3.8"))
|
||||
target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1)
|
||||
endif()
|
||||
|
||||
|
@ -135,6 +135,8 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES
|
||||
spir_gss6450_file_signal_source.cc
|
||||
rtl_tcp_signal_source.cc
|
||||
labsat_signal_source.cc
|
||||
two_bit_cpx_file_signal_source.cc
|
||||
two_bit_packed_file_signal_source.cc
|
||||
${OPT_DRIVER_SOURCES}
|
||||
)
|
||||
|
||||
@ -146,20 +148,11 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS
|
||||
spir_gss6450_file_signal_source.h
|
||||
rtl_tcp_signal_source.h
|
||||
labsat_signal_source.h
|
||||
two_bit_cpx_file_signal_source.h
|
||||
two_bit_packed_file_signal_source.h
|
||||
${OPT_DRIVER_HEADERS}
|
||||
)
|
||||
|
||||
if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3)
|
||||
set(SIGNAL_SOURCE_ADAPTER_SOURCES ${SIGNAL_SOURCE_ADAPTER_SOURCES}
|
||||
two_bit_cpx_file_signal_source.cc
|
||||
two_bit_packed_file_signal_source.cc
|
||||
)
|
||||
set(SIGNAL_SOURCE_ADAPTER_HEADERS ${SIGNAL_SOURCE_ADAPTER_HEADERS}
|
||||
two_bit_cpx_file_signal_source.h
|
||||
two_bit_packed_file_signal_source.h
|
||||
)
|
||||
endif()
|
||||
|
||||
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
|
||||
list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES)
|
||||
|
||||
|
@ -80,11 +80,7 @@ if(ENABLE_RAW_UDP)
|
||||
target_compile_definitions(core_receiver PRIVATE -DRAW_UDP=1)
|
||||
endif()
|
||||
|
||||
if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3)
|
||||
target_compile_definitions(core_receiver PRIVATE -DMODERN_GNURADIO=1)
|
||||
endif()
|
||||
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.20")
|
||||
if(NOT (GNURADIO_VERSION VERSION_LESS "3.8"))
|
||||
target_compile_definitions(core_receiver PRIVATE -DGR_GREATER_38=1)
|
||||
endif()
|
||||
|
||||
|
@ -1299,7 +1299,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#if MODERN_GNURADIO
|
||||
else if (implementation == "Two_Bit_Cpx_File_Signal_Source")
|
||||
{
|
||||
try
|
||||
@ -1328,7 +1327,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (implementation == "Spir_File_Signal_Source")
|
||||
{
|
||||
try
|
||||
|
@ -141,7 +141,7 @@ endif()
|
||||
# Definitions
|
||||
################################################################################
|
||||
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.20")
|
||||
if(NOT (GNURADIO_VERSION VERSION_LESS "3.8"))
|
||||
add_definitions(-DGR_GREATER_38=1)
|
||||
endif()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user