mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 02:10:34 +00:00
Improve detection of gr-iio
This commit is contained in:
parent
09109b903d
commit
f6838a2561
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user