Allow packaging when gr-iio is not present

This commit is contained in:
Carles Fernandez 2019-09-07 16:41:27 +02:00
parent f54902389e
commit 9eb294209a
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
3 changed files with 39 additions and 50 deletions

View File

@ -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()
##############################################

View File

@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
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}>
)

View File

@ -16,29 +16,10 @@
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
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)