mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-15 11:45:47 +00:00
Improve portability
In some architectures (e.g. alpha, hppa, powerpcspe, m68k, sh4, sparc64, x32) the package gr-osmosdr is not available. So when the package is build with -DENABLE_OSMOSDR=ON, it breaks on the mentioned architectures. This is expected behaviour (it breaks because a required dependency is not found), but prevents from building the package on such architectures. This commit introduces a small change: when compilation is called with cmake -DENABLE_OSMOSDR=ON -DENABLE_PACKAGING=ON .. then, the compilation does not break if gr-osmosdr is not found. This commit also fixes building when UHD is present but gnuradio-uhd is not (for instance, in hurd-i386)
This commit is contained in:
parent
d76e8efe18
commit
95ffcd3ac0
@ -1167,8 +1167,17 @@ if($ENV{RTLSDR_DRIVER})
|
||||
endif($ENV{RTLSDR_DRIVER})
|
||||
|
||||
if(ENABLE_OSMOSDR)
|
||||
find_package(GrOsmoSDR)
|
||||
if(GROSMOSDR_FOUND)
|
||||
message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled." )
|
||||
message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'" )
|
||||
else(GROSMOSDR_FOUND)
|
||||
if(ENABLE_PACKAGING)
|
||||
message(WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built.")
|
||||
else(ENABLE_PACKAGING)
|
||||
message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver")
|
||||
endif(ENABLE_PACKAGING)
|
||||
endif(GROSMOSDR_FOUND)
|
||||
else(ENABLE_OSMOSDR)
|
||||
message(STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled." )
|
||||
message(STATUS "Enable it with 'cmake -DENABLE_OSMOSDR=ON ../' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)" )
|
||||
|
@ -16,6 +16,9 @@
|
||||
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_ADAPTER_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
|
||||
|
||||
# Optional drivers
|
||||
|
||||
if(ENABLE_GN3S)
|
||||
@ -72,11 +75,11 @@ if(ENABLE_OSMOSDR)
|
||||
################################################################################
|
||||
# OsmoSDR - http://sdr.osmocom.org/trac/
|
||||
################################################################################
|
||||
find_package(GrOsmoSDR REQUIRED)
|
||||
if(NOT GROSMOSDR_FOUND)
|
||||
message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver")
|
||||
endif(NOT GROSMOSDR_FOUND)
|
||||
|
||||
if(ENABLE_PACKAGING)
|
||||
list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h)
|
||||
endif(ENABLE_PACKAGING)
|
||||
else(NOT GROSMOSDR_FOUND)
|
||||
# set OSMO include dirs
|
||||
set(OSMO_DRIVER_INCLUDE_DIRS
|
||||
${OPT_DRIVER_INCLUDE_DIRS}
|
||||
@ -85,13 +88,16 @@ if(ENABLE_OSMOSDR)
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS})
|
||||
endif(NOT GROSMOSDR_FOUND)
|
||||
endif(ENABLE_OSMOSDR)
|
||||
|
||||
if(ENABLE_UHD)
|
||||
if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS})
|
||||
endif(ENABLE_UHD)
|
||||
else(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/uhd_signal_source.h)
|
||||
endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
|
||||
|
||||
set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc
|
||||
@ -129,8 +135,6 @@ endif(ARCH_64BITS)
|
||||
|
||||
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_ADAPTER_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
|
||||
add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
||||
target_link_libraries(signal_source_adapters signal_source_gr_blocks
|
||||
@ -140,4 +144,3 @@ target_link_libraries(signal_source_adapters signal_source_gr_blocks
|
||||
${OPT_LIBRARIES}
|
||||
gnss_sp_libs
|
||||
)
|
||||
|
||||
|
@ -101,12 +101,14 @@ if(ENABLE_FLEXIBAND)
|
||||
endif(ENABLE_FLEXIBAND)
|
||||
|
||||
if(ENABLE_OSMOSDR)
|
||||
if(GROSMOSDR_FOUND)
|
||||
add_definitions(-DOSMOSDR_DRIVER=1)
|
||||
endif(GROSMOSDR_FOUND)
|
||||
endif(ENABLE_OSMOSDR)
|
||||
|
||||
if(ENABLE_UHD)
|
||||
if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
add_definitions(-DUHD_DRIVER=1)
|
||||
endif(ENABLE_UHD)
|
||||
endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
|
||||
#Enable OpenCL if found in the system
|
||||
if(OPENCL_FOUND)
|
||||
|
@ -28,10 +28,10 @@ if(ENABLE_GPERFTOOLS)
|
||||
endif(GPERFTOOLS_FOUND)
|
||||
endif(ENABLE_GPERFTOOLS)
|
||||
|
||||
if(ENABLE_UHD)
|
||||
if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES})
|
||||
set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS})
|
||||
endif(ENABLE_UHD)
|
||||
endif(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
|
Loading…
Reference in New Issue
Block a user