Improve GNU Radio 3.7 / 3.8 handling

This commit is contained in:
Carles Fernandez 2019-04-27 17:28:49 +02:00
parent f9c54e57cc
commit c1b48d675a
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
8 changed files with 24 additions and 41 deletions

View File

@ -695,7 +695,7 @@ endif()
################################################################################ ################################################################################
# GNU Radio - https://gnuradio.org # 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) find_package(UHD)
set_package_properties(UHD PROPERTIES 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." PURPOSE "Implements flowgraph scheduler, provides some processing blocks and classes to create new ones."
TYPE REQUIRED TYPE REQUIRED
) )
if(PC_GNURADIO_RUNTIME_VERSION) if(GNURADIO_VERSION)
if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) if(GNURADIO_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
unset(GNURADIO_RUNTIME_FOUND) 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()
endif() endif()
if(NOT GNURADIO_RUNTIME_FOUND) if(NOT GNURADIO_RUNTIME_FOUND)
@ -730,15 +730,14 @@ if(NOT GNURADIO_RUNTIME_FOUND)
if(OS_IS_LINUX) if(OS_IS_LINUX)
message("Go to https://github.com/gnuradio/pybombs") message("Go to https://github.com/gnuradio/pybombs")
message("and follow the instructions to install GNU Radio in your system.") 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() endif()
if(OS_IS_MACOSX) if(OS_IS_MACOSX)
message("You can install it easily via Macports:") message("You can install it easily via Macports:")
message(" sudo port install gnuradio ") message(" sudo port install gnuradio ")
message("Alternatively, you can use homebrew:") message("Alternatively, you can use homebrew:")
message(" brew install gnuradio") message(" brew install gnuradio")
message(FATAL_ERROR "GNU Radio ${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr")
endif() endif()
message(FATAL_ERROR "GNU Radio v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr.")
else() else()
if(NOT TARGET Gnuradio::runtime) if(NOT TARGET Gnuradio::runtime)
add_library(Gnuradio::runtime SHARED IMPORTED) add_library(Gnuradio::runtime SHARED IMPORTED)

View File

@ -24,7 +24,7 @@ include(FindPackageHandleStandardArgs)
# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list # if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list
if(NOT GR_REQUIRED_COMPONENTS) 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() endif()
# Allows us to use all .cmake files in this directory # Allows us to use all .cmake files in this directory
@ -43,9 +43,6 @@ macro(LIST_CONTAINS var value)
endforeach() endforeach()
endmacro() endmacro()
# Trick for feature_summary
set(GNURADIO_FOUND TRUE)
function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS}) list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS})
if(NOT REQUIRED_MODULE) if(NOT REQUIRED_MODULE)
@ -150,24 +147,21 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
endfunction() endfunction()
gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime)
gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) 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(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec)
gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft)
gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter)
gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) 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(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui)
gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis)
gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd)
gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder)
gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) 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_INCLUDE_DIRS)
list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES)
@ -206,4 +200,7 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION)
endif() endif()
# Trick for feature_summary # 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})

View File

@ -62,7 +62,7 @@ target_include_directories(input_filter_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces ${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) target_compile_definitions(input_filter_adapters PUBLIC -DGR_GREATER_38=1)
endif() endif()

View File

@ -52,7 +52,7 @@ target_include_directories(resampler_adapters
${CMAKE_SOURCE_DIR}/src/core/interfaces ${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) target_compile_definitions(resampler_adapters PUBLIC -DGR_GREATER_38=1)
endif() endif()

View File

@ -135,6 +135,8 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES
spir_gss6450_file_signal_source.cc spir_gss6450_file_signal_source.cc
rtl_tcp_signal_source.cc rtl_tcp_signal_source.cc
labsat_signal_source.cc labsat_signal_source.cc
two_bit_cpx_file_signal_source.cc
two_bit_packed_file_signal_source.cc
${OPT_DRIVER_SOURCES} ${OPT_DRIVER_SOURCES}
) )
@ -146,20 +148,11 @@ set(SIGNAL_SOURCE_ADAPTER_HEADERS
spir_gss6450_file_signal_source.h spir_gss6450_file_signal_source.h
rtl_tcp_signal_source.h rtl_tcp_signal_source.h
labsat_signal_source.h labsat_signal_source.h
two_bit_cpx_file_signal_source.h
two_bit_packed_file_signal_source.h
${OPT_DRIVER_HEADERS} ${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_HEADERS)
list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES) list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES)

View File

@ -80,11 +80,7 @@ if(ENABLE_RAW_UDP)
target_compile_definitions(core_receiver PRIVATE -DRAW_UDP=1) target_compile_definitions(core_receiver PRIVATE -DRAW_UDP=1)
endif() endif()
if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3) if(NOT (GNURADIO_VERSION VERSION_LESS "3.8"))
target_compile_definitions(core_receiver PRIVATE -DMODERN_GNURADIO=1)
endif()
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.20")
target_compile_definitions(core_receiver PRIVATE -DGR_GREATER_38=1) target_compile_definitions(core_receiver PRIVATE -DGR_GREATER_38=1)
endif() endif()

View File

@ -1299,7 +1299,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
exit(1); exit(1);
} }
} }
#if MODERN_GNURADIO
else if (implementation == "Two_Bit_Cpx_File_Signal_Source") else if (implementation == "Two_Bit_Cpx_File_Signal_Source")
{ {
try try
@ -1328,7 +1327,6 @@ std::unique_ptr<GNSSBlockInterface> GNSSBlockFactory::GetBlock(
exit(1); exit(1);
} }
} }
#endif
else if (implementation == "Spir_File_Signal_Source") else if (implementation == "Spir_File_Signal_Source")
{ {
try try

View File

@ -141,7 +141,7 @@ endif()
# Definitions # 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) add_definitions(-DGR_GREATER_38=1)
endif() endif()