2020-12-30 12:35:06 +00:00
|
|
|
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2012-12-24 02:33:50 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
2020-12-30 12:35:06 +00:00
|
|
|
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2012-12-24 02:33:50 +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)
2017-04-12 16:06:04 +00:00
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
# Optional drivers
|
2020-02-29 13:33:09 +00:00
|
|
|
set(OPT_DRIVER_SOURCES "")
|
|
|
|
set(OPT_DRIVER_HEADERS "")
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2019-02-04 17:17:35 +00:00
|
|
|
if(ENABLE_RAW_UDP AND PCAP_FOUND)
|
2018-05-25 18:49:45 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc)
|
2018-10-04 20:35:44 +00:00
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2018-05-16 09:36:37 +00:00
|
|
|
|
2019-02-04 17:17:35 +00:00
|
|
|
|
2017-10-29 05:51:22 +00:00
|
|
|
if(ENABLE_PLUTOSDR)
|
|
|
|
##############################################
|
|
|
|
# ADALM-PLUTO (Analog Devices Inc.)
|
|
|
|
##############################################
|
2019-03-23 11:59:49 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc)
|
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2017-10-29 05:51:22 +00:00
|
|
|
|
2017-10-31 15:03:41 +00:00
|
|
|
|
2017-10-29 05:51:22 +00:00
|
|
|
if(ENABLE_FMCOMMS2)
|
|
|
|
###############################################
|
|
|
|
# FMCOMMS2 based SDR Hardware
|
|
|
|
###############################################
|
2019-03-23 11:59:49 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc)
|
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2017-10-29 05:51:22 +00:00
|
|
|
|
2018-11-21 23:35:21 +00:00
|
|
|
|
2018-03-02 10:30:36 +00:00
|
|
|
if(ENABLE_AD9361)
|
|
|
|
###############################################
|
|
|
|
# AD9361 DIRECT TO FPGA Hardware
|
|
|
|
###############################################
|
2019-03-23 11:59:49 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} ad9361_fpga_signal_source.cc)
|
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} ad9361_fpga_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2018-03-02 10:30:36 +00:00
|
|
|
|
|
|
|
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
if(ENABLE_GN3S)
|
2018-11-21 23:35:21 +00:00
|
|
|
##############################################
|
|
|
|
# GN3S (USB dongle)
|
|
|
|
##############################################
|
|
|
|
if(NOT GRGN3S_FOUND)
|
2019-10-10 06:12:25 +00:00
|
|
|
message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s")
|
2018-11-21 23:35:21 +00:00
|
|
|
message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled")
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2018-11-21 23:35:21 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc)
|
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gn3s_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2016-06-09 17:10:24 +00:00
|
|
|
|
2019-02-04 17:17:35 +00:00
|
|
|
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
|
2018-11-21 23:35:21 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc)
|
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} flexiband_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2015-03-03 17:07:26 +00:00
|
|
|
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
|
|
|
|
if(ENABLE_ARRAY)
|
2018-11-21 23:35:21 +00:00
|
|
|
##############################################
|
|
|
|
# DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
|
|
|
|
##############################################
|
|
|
|
if(NOT GRDBFCTTC_FOUND)
|
2019-10-10 06:12:25 +00:00
|
|
|
message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc")
|
2018-11-21 23:35:21 +00:00
|
|
|
message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled")
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2018-11-21 23:35:21 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc)
|
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} raw_array_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2012-12-27 21:11:50 +00:00
|
|
|
|
|
|
|
|
2014-12-15 16:39:22 +00:00
|
|
|
if(ENABLE_OSMOSDR)
|
2012-12-27 17:09:16 +00:00
|
|
|
################################################################################
|
2020-02-05 20:24:46 +00:00
|
|
|
# OsmoSDR - https://osmocom.org/projects/gr-osmosdr/
|
2015-05-08 06:59:38 +00:00
|
|
|
################################################################################
|
2019-03-23 10:31:53 +00:00
|
|
|
if(GROSMOSDR_FOUND)
|
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)
2017-04-12 16:06:04 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
|
2018-10-04 20:35:44 +00:00
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2018-11-21 23:35:21 +00:00
|
|
|
|
2019-03-23 11:59:49 +00:00
|
|
|
if(ENABLE_UHD)
|
2014-11-14 20:42:22 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
|
2018-10-04 20:35:44 +00:00
|
|
|
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
|
set(SIGNAL_SOURCE_ADAPTER_SOURCES
|
2021-02-09 22:47:34 +00:00
|
|
|
signal_source_base.cc
|
2021-02-11 19:47:17 +00:00
|
|
|
file_source_base.cc
|
2018-11-24 17:40:34 +00:00
|
|
|
file_signal_source.cc
|
2019-06-17 16:13:06 +00:00
|
|
|
multichannel_file_signal_source.cc
|
2018-11-24 17:40:34 +00:00
|
|
|
gen_signal_source.cc
|
|
|
|
nsr_file_signal_source.cc
|
|
|
|
spir_file_signal_source.cc
|
|
|
|
spir_gss6450_file_signal_source.cc
|
|
|
|
rtl_tcp_signal_source.cc
|
|
|
|
labsat_signal_source.cc
|
2019-04-27 15:28:49 +00:00
|
|
|
two_bit_cpx_file_signal_source.cc
|
|
|
|
two_bit_packed_file_signal_source.cc
|
2018-11-24 17:40:34 +00:00
|
|
|
${OPT_DRIVER_SOURCES}
|
2013-12-14 10:23:33 +00:00
|
|
|
)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2018-11-24 17:40:34 +00:00
|
|
|
set(SIGNAL_SOURCE_ADAPTER_HEADERS
|
2021-02-09 22:47:34 +00:00
|
|
|
signal_source_base.h
|
2021-02-11 19:47:17 +00:00
|
|
|
file_source_base.h
|
2018-11-24 17:40:34 +00:00
|
|
|
file_signal_source.h
|
2019-06-17 16:13:06 +00:00
|
|
|
multichannel_file_signal_source.h
|
2018-11-24 17:40:34 +00:00
|
|
|
gen_signal_source.h
|
|
|
|
nsr_file_signal_source.h
|
|
|
|
spir_file_signal_source.h
|
|
|
|
spir_gss6450_file_signal_source.h
|
|
|
|
rtl_tcp_signal_source.h
|
|
|
|
labsat_signal_source.h
|
2019-04-27 15:28:49 +00:00
|
|
|
two_bit_cpx_file_signal_source.h
|
|
|
|
two_bit_packed_file_signal_source.h
|
2018-11-24 17:40:34 +00:00
|
|
|
${OPT_DRIVER_HEADERS}
|
2018-10-04 20:35:44 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
|
|
|
|
list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES)
|
|
|
|
|
2020-06-12 22:32:40 +00:00
|
|
|
if(USE_CMAKE_TARGET_SOURCES)
|
2020-06-08 18:04:01 +00:00
|
|
|
add_library(signal_source_adapters STATIC)
|
|
|
|
target_sources(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
${SIGNAL_SOURCE_ADAPTER_SOURCES}
|
|
|
|
PUBLIC
|
|
|
|
${SIGNAL_SOURCE_ADAPTER_HEADERS}
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
|
|
|
add_library(signal_source_adapters
|
|
|
|
${SIGNAL_SOURCE_ADAPTER_SOURCES}
|
|
|
|
${SIGNAL_SOURCE_ADAPTER_HEADERS}
|
|
|
|
)
|
|
|
|
endif()
|
2019-02-04 15:07:29 +00:00
|
|
|
|
2019-02-04 21:44:45 +00:00
|
|
|
target_include_directories(signal_source_adapters
|
2019-02-10 00:13:02 +00:00
|
|
|
PUBLIC
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
2019-02-04 21:44:45 +00:00
|
|
|
)
|
2019-02-03 18:24:44 +00:00
|
|
|
|
2020-11-29 09:18:35 +00:00
|
|
|
if(ENABLE_FPGA OR ENABLE_AD9361)
|
2020-11-27 15:45:14 +00:00
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
core_libs
|
2020-11-27 12:49:14 +00:00
|
|
|
)
|
2020-11-26 16:07:15 +00:00
|
|
|
endif()
|
|
|
|
|
2019-02-03 18:24:44 +00:00
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PUBLIC
|
2019-09-07 10:36:19 +00:00
|
|
|
Boost::headers
|
2019-02-04 07:14:38 +00:00
|
|
|
Gnuradio::blocks
|
2019-02-03 18:24:44 +00:00
|
|
|
signal_source_gr_blocks
|
|
|
|
PRIVATE
|
2021-02-16 13:27:46 +00:00
|
|
|
algorithms_libs
|
2019-02-10 00:13:02 +00:00
|
|
|
gnss_sdr_flags
|
2019-02-10 17:34:28 +00:00
|
|
|
core_system_parameters
|
2019-02-03 18:24:44 +00:00
|
|
|
Glog::glog
|
|
|
|
Volk::volk
|
|
|
|
)
|
|
|
|
|
2020-04-02 21:59:35 +00:00
|
|
|
if(GNURADIO_USES_STD_POINTERS)
|
|
|
|
target_compile_definitions(signal_source_adapters
|
|
|
|
PUBLIC -DGNURADIO_USES_STD_POINTERS=1
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-02-04 19:00:29 +00:00
|
|
|
if(ENABLE_RAW_UDP AND PCAP_FOUND)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
Pcap::pcap
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-03-23 11:59:49 +00:00
|
|
|
if(ENABLE_UHD)
|
2019-02-04 15:07:29 +00:00
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PUBLIC
|
|
|
|
Gnuradio::uhd
|
|
|
|
PRIVATE
|
|
|
|
Uhd::uhd
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_OSMOSDR AND GROSMOSDR_FOUND)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PUBLIC
|
|
|
|
Gnuradio::osmosdr
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_AD9361 AND LIBIIO_FOUND)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
2019-02-04 19:00:29 +00:00
|
|
|
Iio::iio
|
2019-02-04 15:07:29 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-10-09 20:17:44 +00:00
|
|
|
if(ENABLE_AD9361 OR ENABLE_FMCOMMS2 OR ENABLE_PLUTOSDR)
|
|
|
|
if(LIBAD9361_VERSION)
|
|
|
|
if(LIBAD9361_VERSION VERSION_GREATER 0.1)
|
|
|
|
target_compile_definitions(signal_source_adapters
|
2019-10-09 20:24:29 +00:00
|
|
|
PRIVATE -DLIBAD9361_VERSION_GREATER_THAN_01=1
|
2019-10-09 20:17:44 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-02-04 17:17:35 +00:00
|
|
|
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
Gnuradio::teleorbit
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_GN3S AND GRGN3S_FOUND)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
Gnuradio::gn3s
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_ARRAY AND GRDBFCTTC_FOUND)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
Gnuradio::dbfcttc
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-05-26 18:28:53 +00:00
|
|
|
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
|
|
|
if(GR_IIO_INCLUDE_HAS_GNURADIO)
|
|
|
|
target_compile_definitions(signal_source_adapters
|
|
|
|
PUBLIC -DGRIIO_INCLUDE_HAS_GNURADIO=1
|
|
|
|
)
|
|
|
|
endif()
|
2019-10-05 19:12:54 +00:00
|
|
|
if(GNURADIO_API_IIO)
|
|
|
|
target_compile_definitions(signal_source_adapters
|
|
|
|
PUBLIC -DGNURADIO_API_IIO=1
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PUBLIC
|
|
|
|
Gnuradio::iio
|
|
|
|
Boost::chrono
|
2019-10-10 06:12:25 +00:00
|
|
|
PRIVATE
|
|
|
|
Iio::iio
|
2019-10-05 19:12:54 +00:00
|
|
|
)
|
2019-10-10 10:26:19 +00:00
|
|
|
if(NOT GNURADIO_API_IIO)
|
|
|
|
target_link_libraries(signal_source_adapters
|
|
|
|
PRIVATE
|
|
|
|
Gnuradio::analog
|
|
|
|
)
|
|
|
|
endif()
|
2019-05-26 18:28:53 +00:00
|
|
|
endif()
|
|
|
|
|
2019-02-21 08:59:06 +00:00
|
|
|
if(ENABLE_CLANG_TIDY)
|
|
|
|
if(CLANG_TIDY_EXE)
|
|
|
|
set_target_properties(signal_source_adapters
|
|
|
|
PROPERTIES
|
|
|
|
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-09-07 14:41:27 +00:00
|
|
|
target_compile_definitions(signal_source_adapters
|
|
|
|
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
|
|
|
|
)
|
|
|
|
|
|
|
|
set_property(TARGET signal_source_adapters
|
|
|
|
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
2013-12-14 10:23:33 +00:00
|
|
|
)
|