diff --git a/CMakeLists.txt b/CMakeLists.txt index 87653a607..bd90d746f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2216,6 +2216,21 @@ set_package_properties(GRIIO PROPERTIES PURPOSE "Used for communication with PlutoSDR and FMCOMMS devices." TYPE OPTIONAL ) +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + if(NOT GRIIO_FOUND) + 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") + if(ENABLE_PACKAGING) + set(ENABLE_PLUTOSDR OFF) + set(ENABLE_FMCOMMS2 OFF) + else() + message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with -DENABLE_PLUTOSDR=ON or -DENABLE_FMCOMMS2=ON.") + endif() + endif() +endif() ##################################################################### @@ -2228,6 +2243,21 @@ set_package_properties(LIBIIO PROPERTIES PURPOSE "Used for communication with the AD9361 chipset." TYPE OPTIONAL ) +if(ENABLE_AD9361 OR ENABLE_FMCOMMS2) + 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") + if(ENABLE_PACKAGING) + set(ENABLE_AD9361 OFF) + set(ENABLE_FMCOMMS2 OFF) + else() + message(FATAL_ERROR "libiio is required for building gnss-sdr with -DENABLE_AD9361=ON.") + endif() + endif() +endif() ############################################## diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 50e794d72..fd3240b0b 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -25,30 +25,6 @@ if(ENABLE_RAW_UDP AND PCAP_FOUND) endif() -if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - if(NOT GRIIO_FOUND) - 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") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with -DENABLE_PLUTOSDR=ON or -DENABLE_FMCOMMS2=ON.") - endif() -endif() - - -if(ENABLE_AD9361) - 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") - message(FATAL_ERROR "libiio is required for building gnss-sdr with -DENABLE_AD9361=ON.") - endif() -endif() - - if(ENABLE_PLUTOSDR) ############################################## # ADALM-PLUTO (Analog Devices Inc.) @@ -234,9 +210,6 @@ if(ENABLE_ARRAY AND GRDBFCTTC_FOUND) ) endif() -target_compile_definitions(signal_source_adapters - PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" -) if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(GR_IIO_INCLUDE_HAS_GNURADIO) @@ -255,6 +228,11 @@ if(ENABLE_CLANG_TIDY) endif() endif() -set_property(TARGET signal_source_adapters APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES - $ +target_compile_definitions(signal_source_adapters + PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" +) + +set_property(TARGET signal_source_adapters + APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES + $ ) diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt index 1f968cab6..75fd8eb7a 100644 --- a/src/algorithms/signal_source/libs/CMakeLists.txt +++ b/src/algorithms/signal_source/libs/CMakeLists.txt @@ -16,29 +16,10 @@ # along with GNSS-SDR. If not, see . # -if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) - if(NOT GRIIO_FOUND) - 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") - message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled") - endif() -endif() if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) - 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") - message(FATAL_ERROR "libiio is required for building gnss-sdr with this option enabled") - else() - set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) - set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) - endif() + set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc) + set(OPT_SIGNAL_SOURCE_LIB_HEADERS ad9361_manager.h) endif() if(ENABLE_FPGA OR ENABLE_AD9361)