1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-09-28 07:08:24 +00:00

Improve detection of gr-iio

This commit is contained in:
Carles Fernandez 2019-05-26 20:28:53 +02:00
parent 09109b903d
commit f6838a2561
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
4 changed files with 33 additions and 1 deletions

View File

@ -35,6 +35,22 @@ find_path(IIO_INCLUDE_DIRS
$ENV{GRIIO_ROOT}/include
)
if(IIO_INCLUDE_DIRS)
set(GR_IIO_INCLUDE_HAS_GNURADIO TRUE)
else()
find_path(IIO_INCLUDE_DIRS
NAMES iio/api.h
HINTS $ENV{IIO_DIR}/include
${PC_IIO_INCLUDEDIR}
PATHS ${CMAKE_INSTALL_PREFIX}/include
/usr/local/include
/usr/include
${GRIIO_ROOT}/include
$ENV{GRIIO_ROOT}/include
)
set(GR_IIO_INCLUDE_HAS_GNURADIO FALSE)
endif()
find_library(IIO_LIBRARIES
NAMES gnuradio-iio
HINTS $ENV{IIO_DIR}/lib
@ -86,4 +102,4 @@ if(GRIIO_FOUND AND NOT TARGET Gnuradio::iio)
)
endif()
mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS)
mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS GR_IIO_INCLUDE_HAS_GNURADIO)

View File

@ -238,6 +238,14 @@ 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)
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

View File

@ -36,7 +36,11 @@
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#if GRIIO_INCLUDE_HAS_GNURADIO
#include <gnuradio/iio/fmcomms2_source.h>
#else
#include <iio/fmcomms2_source.h>
#endif
#include <gnuradio/msg_queue.h>
#include <string>

View File

@ -35,7 +35,11 @@
#include "gnss_block_interface.h"
#include <boost/shared_ptr.hpp>
#include <gnuradio/blocks/file_sink.h>
#if GRIIO_INCLUDE_HAS_GNURADIO
#include <gnuradio/iio/pluto_source.h>
#else
#include <iio/pluto_source.h>
#endif
#include <gnuradio/msg_queue.h>
#include <string>