gnss-sdr/src/algorithms/signal_source/adapters/CMakeLists.txt

261 lines
8.0 KiB
CMake
Raw Normal View History

2019-02-04 21:44:45 +00:00
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# Optional drivers
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)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h)
2018-11-24 17:40:34 +00:00
endif()
2019-02-04 17:17:35 +00:00
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
2018-11-21 07:28:50 +00:00
if(NOT GRIIO_FOUND)
2018-05-25 18:49:45 +00:00
message(STATUS "gnuradio-iio not found, its installation is required.")
message(STATUS "Please build and install the following projects:")
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
2019-03-23 11:59:49 +00:00
message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with -DENABLE_PLUTOSDR=ON or -DENABLE_FMCOMMS2=ON.")
2018-11-24 17:40:34 +00:00
endif()
endif()
2019-02-04 17:17:35 +00:00
2018-03-02 10:30:36 +00:00
if(ENABLE_AD9361)
2018-05-25 18:49:45 +00:00
if(NOT LIBIIO_FOUND)
message(STATUS "libiio not found, its installation is required.")
message(STATUS "Please build and install the following projects:")
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
2019-03-23 11:59:49 +00:00
message(FATAL_ERROR "libiio is required for building gnss-sdr with -DENABLE_AD9361=ON.")
2018-11-24 17:40:34 +00:00
endif()
endif()
2018-03-02 10:30:36 +00:00
2017-10-31 15:03:41 +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-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
if(ENABLE_GN3S)
##############################################
# GN3S (USB dongle)
##############################################
if(NOT GRGN3S_FOUND)
message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ")
message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled")
2018-11-24 17:40:34 +00:00
endif()
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()
2019-02-04 17:17:35 +00:00
if(ENABLE_FLEXIBAND AND TELEORBIT_FOUND)
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()
if(ENABLE_ARRAY)
##############################################
# DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
##############################################
if(NOT GRDBFCTTC_FOUND)
message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ")
message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled")
2018-11-24 17:40:34 +00:00
endif()
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()
if(ENABLE_OSMOSDR)
################################################################################
# OsmoSDR - http://sdr.osmocom.org/trac/
2015-05-08 06:59:38 +00:00
################################################################################
2019-03-23 10:31:53 +00:00
if(GROSMOSDR_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h)
2018-11-24 17:40:34 +00:00
endif()
endif()
2019-03-23 11:59:49 +00:00
if(ENABLE_UHD)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
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
file_signal_source.cc
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}
)
2018-11-24 17:40:34 +00:00
set(SIGNAL_SOURCE_ADAPTER_HEADERS
file_signal_source.h
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}
)
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES)
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
2019-02-03 18:24:44 +00:00
2019-02-04 21:44:45 +00:00
add_library(signal_source_adapters
${SIGNAL_SOURCE_ADAPTER_SOURCES}
${SIGNAL_SOURCE_ADAPTER_HEADERS}
)
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
target_link_libraries(signal_source_adapters
PUBLIC
Boost::headers
2019-02-03 18:24:44 +00:00
Gnuradio::runtime
2019-02-04 07:14:38 +00:00
Gnuradio::blocks
2019-02-03 18:24:44 +00:00
signal_source_gr_blocks
signal_source_libs
2019-02-03 18:24:44 +00:00
PRIVATE
2019-02-10 00:13:02 +00:00
gnss_sdr_flags
core_system_parameters
2019-02-03 19:28:49 +00:00
Gflags::gflags
2019-02-03 18:24:44 +00:00
Glog::glog
Volk::volk
)
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)
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
)
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-02-04 21:44:45 +00:00
target_compile_definitions(signal_source_adapters
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
)
2019-02-04 07:14:38 +00:00
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()
endif()
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(signal_source_adapters
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
2019-02-03 18:24:44 +00:00
set_property(TARGET signal_source_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)