From 647a27a1924c39ef59518589ac2843c7703d9c9a Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Tue, 31 Oct 2017 16:02:18 +0100 Subject: [PATCH] Avoid possible duplication of linked libraries Add installation pointers for gnuradio-iio --- .../signal_source/adapters/CMakeLists.txt | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt index 822b483d4..870d6537b 100644 --- a/src/algorithms/signal_source/adapters/CMakeLists.txt +++ b/src/algorithms/signal_source/adapters/CMakeLists.txt @@ -21,34 +21,40 @@ list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS) # Optional drivers +if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + find_package(iio REQUIRED) + if(NOT IIO_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 required for building gnss-sdr with this option enabled") + endif(NOT IIO_FOUND) + set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) +endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) + if(ENABLE_PLUTOSDR) ############################################## # ADALM-PLUTO (Analog Devices Inc.) ############################################## - find_package(iio REQUIRED) - if(NOT IIO_FOUND) - message("gnuradio-iio not found, installation is required") - message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") - else(NOT IIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + if(IIO_FOUND) + #set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + #set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) - endif(NOT IIO_FOUND) + endif(IIO_FOUND) endif(ENABLE_PLUTOSDR) if(ENABLE_FMCOMMS2) ############################################### # FMCOMMS2 based SDR Hardware ############################################### - find_package(iio REQUIRED) - if(NOT IIO_FOUND) - message("gnuradio-iio not found, installation is required") - message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled") - else(NOT IIO_FOUND) - set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) - set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) + if(IIO_FOUND) + #set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) + #set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) - endif(NOT IIO_FOUND) + endif(IIO_FOUND) endif(ENABLE_FMCOMMS2) if(ENABLE_GN3S) @@ -134,7 +140,7 @@ set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc gen_signal_source.cc nsr_file_signal_source.cc spir_file_signal_source.cc - rtl_tcp_signal_source.cc + rtl_tcp_signal_source.cc ${OPT_DRIVER_SOURCES} )