diff --git a/CMakeLists.txt b/CMakeLists.txt
index 30bc7ce8c..7959951bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1488,6 +1488,17 @@ if(ENABLE_UHD)
else()
set(GR_REQUIRED_COMPONENTS UHD)
find_package(Gnuradio)
+ if(NOT TARGET Gnuradio::uhd)
+ add_library(Gnuradio::uhd SHARED IMPORTED)
+ list(GET GNURADIO_UHD_LIBRARIES 0 FIRST_DIR)
+ get_filename_component(GNURADIO_UHD_DIR ${FIRST_DIR} ABSOLUTE)
+ set_target_properties(Gnuradio::uhd PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${GNURADIO_UHD_DIR}"
+ INTERFACE_INCLUDE_DIRECTORIES "${GNURADIO_UHD_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES "${GNURADIO_UHD_LIBRARIES}"
+ )
+ endif()
endif()
endif()
diff --git a/cmake/Modules/FindGRIIO.cmake b/cmake/Modules/FindGRIIO.cmake
index 6d341e7fd..8cb8e9efc 100644
--- a/cmake/Modules/FindGRIIO.cmake
+++ b/cmake/Modules/FindGRIIO.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
+# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -15,6 +15,12 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see .
+#
+# Provides the following imported target:
+# Gnuradio::iio
+#
+
+
include(FindPkgConfig)
pkg_check_modules(PC_IIO gnuradio-iio)
@@ -69,4 +75,15 @@ find_library(IIO_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
+
+if(GRIIO_FOUND AND NOT TARGET Gnuradio::iio)
+ add_library(Gnuradio::iio SHARED IMPORTED)
+ set_target_properties(Gnuradio::iio PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${IIO_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${IIO_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES "${IIO_LIBRARIES}"
+ )
+endif()
+
mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindGROSMOSDR.cmake b/cmake/Modules/FindGROSMOSDR.cmake
index 48379ed76..99f29208d 100644
--- a/cmake/Modules/FindGROSMOSDR.cmake
+++ b/cmake/Modules/FindGROSMOSDR.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
+# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -33,6 +33,11 @@
# GROSMOSDR_FOUND System has gr-osmosdr libs/headers
# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr)
# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers
+#
+# Provides the following imported target:
+# Gnuradio::osmosdr
+#
+
include(FindPkgConfig)
pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr)
@@ -89,4 +94,15 @@ find_library(GROSMOSDR_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
+
+if(GROSMOSDR_FOUND AND NOT TARGET Gnuradio:osmosdr)
+ add_library(Gnuradio:osmosdr SHARED IMPORTED)
+ set_target_properties(Gnuradio:osmosdr PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${GROSMOSDR_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${GROSMOSDR_INCLUDE_DIR};${GROSMOSDR_INCLUDE_DIR}/osmosdr"
+ INTERFACE_LINK_LIBRARIES "${GROSMOSDR_LIBRARIES}"
+ )
+endif()
+
mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
diff --git a/cmake/Modules/FindLIBIIO.cmake b/cmake/Modules/FindLIBIIO.cmake
index a76180ca2..642af5216 100644
--- a/cmake/Modules/FindLIBIIO.cmake
+++ b/cmake/Modules/FindLIBIIO.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
+# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -15,6 +15,11 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see .
+#
+# Provides the following imported target:
+# Iio::iio
+#
+
include(FindPkgConfig)
pkg_check_modules(PC_LIBIIO libiio)
@@ -73,4 +78,15 @@ find_library(
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
+
+if(LIBIIO_FOUND AND NOT TARGET Iio:iio)
+ add_library(Iio:iio SHARED IMPORTED)
+ set_target_properties(Iio:iio PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${LIBIIO_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBIIO_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES "${LIBIIO_LIBRARIES}"
+ )
+endif()
+
mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
diff --git a/cmake/Modules/FindLIBOSMOSDR.cmake b/cmake/Modules/FindLIBOSMOSDR.cmake
index 1e3aaf5e0..1fe3e6493 100644
--- a/cmake/Modules/FindLIBOSMOSDR.cmake
+++ b/cmake/Modules/FindLIBOSMOSDR.cmake
@@ -27,6 +27,10 @@
# LIBOSMOSDR_FOUND System has libosmosdr libs/headers
# LIBOSMOSDR_LIBRARIES The libosmosdr libraries
# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers
+#
+# Provides the following imported target:
+# Osmosdr::osmosdr
+#
include(FindPkgConfig)
pkg_check_modules(LIBOSMOSDR_PKG libosmosdr)
@@ -77,4 +81,15 @@ find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
+
+if(LIBOSMOSDR_FOUND AND NOT TARGET Osmosdr:osmosdr)
+ add_library(Osmosdr:osmosdr SHARED IMPORTED)
+ set_target_properties(Osmosdr:osmosdr PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${LIBOSMOSDR_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${LIBOSMOSDR_INCLUDE_DIR}"
+ INTERFACE_LINK_LIBRARIES "${LIBOSMOSDR_LIBRARIES}"
+ )
+endif()
+
mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
diff --git a/cmake/Modules/FindPCAP.cmake b/cmake/Modules/FindPCAP.cmake
index af746c852..6c8e52f8f 100644
--- a/cmake/Modules/FindPCAP.cmake
+++ b/cmake/Modules/FindPCAP.cmake
@@ -43,7 +43,10 @@
# PCAP_INCLUDE_DIRS - where to find pcap.h, etc.
# PCAP_LIBRARIES - List of libraries when using pcap.
# PCAP_FOUND - True if pcap found.
-
+#
+# Provides the following imported target:
+# Pcap::pcap
+#
if(EXISTS $ENV{PCAPDIR})
find_path(PCAP_INCLUDE_DIR
@@ -113,10 +116,20 @@ check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS)
check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD)
check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK)
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)
+
+if(PCAP_FOUND AND NOT TARGET Pcap::pcap)
+ add_library(Pcap::pcap SHARED IMPORTED)
+ set_target_properties(Pcap::pcap PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${PCAP_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${PCAP_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES "${PCAP_LIBRARIES}"
+ )
+endif()
+
mark_as_advanced(
PCAP_LIBRARIES
PCAP_INCLUDE_DIRS
)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)
diff --git a/cmake/Modules/FindUHD.cmake b/cmake/Modules/FindUHD.cmake
index 31d299937..e0d6d77e0 100644
--- a/cmake/Modules/FindUHD.cmake
+++ b/cmake/Modules/FindUHD.cmake
@@ -1,4 +1,4 @@
-# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
+# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -15,10 +15,14 @@
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see .
+#
+# Provides the following imported target:
+# Iio::iio
+#
+
########################################################################
# Find the library for the USRP Hardware Driver
########################################################################
-
include(FindPkgConfig)
pkg_check_modules(PC_UHD uhd)
@@ -72,4 +76,15 @@ find_library(UHD_LIBRARIES
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
+
+if(UHD_FOUND AND NOT TARGET Uhd::uhd)
+ add_library(Uhd::uhd SHARED IMPORTED)
+ set_target_properties(Uhd::uhd PROPERTIES
+ IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
+ IMPORTED_LOCATION "${UHD_LIBRARIES}"
+ INTERFACE_INCLUDE_DIRECTORIES "${UHD_INCLUDE_DIRS}"
+ INTERFACE_LINK_LIBRARIES "${UHD_LIBRARIES}"
+ )
+endif()
+
mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)
diff --git a/src/algorithms/libs/rtklib/rtklib_stream.cc b/src/algorithms/libs/rtklib/rtklib_stream.cc
index 7b1de5e12..53635b2ea 100644
--- a/src/algorithms/libs/rtklib/rtklib_stream.cc
+++ b/src/algorithms/libs/rtklib/rtklib_stream.cc
@@ -50,6 +50,9 @@
*
*----------------------------------------------------------------------------*/
+#include "rtklib_stream.h"
+#include "rtklib_rtkcmn.h"
+#include "rtklib_solution.h"
#include
#include
#include
@@ -57,9 +60,6 @@
#include
#include
#include
-#include
-#include
-#include
#include
#include
#include
diff --git a/src/algorithms/signal_source/adapters/CMakeLists.txt b/src/algorithms/signal_source/adapters/CMakeLists.txt
index ae0ee65e1..b1850f529 100644
--- a/src/algorithms/signal_source/adapters/CMakeLists.txt
+++ b/src/algorithms/signal_source/adapters/CMakeLists.txt
@@ -24,9 +24,6 @@ if(ENABLE_RAW_UDP)
if(NOT PCAP_FOUND)
message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source (ENABLE_RAW_UDP)")
endif()
- get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE)
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS})
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} custom_udp_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} custom_udp_signal_source.h)
endif()
@@ -41,8 +38,6 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
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()
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
endif()
if(ENABLE_AD9361)
@@ -55,8 +50,6 @@ if(ENABLE_AD9361)
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.")
endif()
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
endif()
@@ -154,15 +147,8 @@ if(ENABLE_OSMOSDR)
list(REMOVE_ITEM SIGNAL_SOURCE_ADAPTER_HEADERS ${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters/osmosdr_signal_source.h)
endif()
else()
- # set OSMO include dirs
- set(OSMO_DRIVER_INCLUDE_DIRS
- ${OPT_DRIVER_INCLUDE_DIRS}
- ${GROSMOSDR_INCLUDE_DIR}/osmosdr
- )
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} osmosdr_signal_source.h)
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS})
endif()
endif()
@@ -170,8 +156,6 @@ endif()
if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} uhd_signal_source.h)
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS})
endif()
@@ -206,14 +190,13 @@ if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3)
two_bit_packed_file_signal_source.h)
endif()
-add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
-
list(SORT SIGNAL_SOURCE_ADAPTER_HEADERS)
list(SORT SIGNAL_SOURCE_ADAPTER_SOURCES)
-add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS})
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
+add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS})
+
target_include_directories(signal_source_adapters PUBLIC ${CMAKE_SOURCE_DIR}/src/algorithms/libs)
target_link_libraries(signal_source_adapters
@@ -232,6 +215,38 @@ target_link_libraries(signal_source_adapters
Volk::volk
)
+if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
+ target_link_libraries(signal_source_adapters
+ PUBLIC
+ Gnuradio::uhd
+ PRIVATE
+ Uhd::uhd
+ )
+endif()
+
+if(ENABLE_OSMOSDR AND GROSMOSDR_FOUND)
+ target_link_libraries(signal_source_adapters
+ PUBLIC
+ Gnuradio::osmosdr
+ PRIVATE
+ Osmosdr::osmosdr
+ )
+endif()
+
+if(ENABLE_AD9361 AND LIBIIO_FOUND)
+ target_link_libraries(signal_source_adapters
+ PRIVATE
+ Osmosdr::osmosdr
+ )
+endif()
+
+if(ENABLE_RAW_UDP AND PCAP_FOUND)
+ target_link_libraries(signal_source_adapters
+ PRIVATE
+ Pcap::pcap
+ )
+endif()
+
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/gnuradio_blocks/CMakeLists.txt b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt
index 5cc96054c..3d1b342f1 100644
--- a/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt
+++ b/src/algorithms/signal_source/gnuradio_blocks/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
+# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -22,9 +22,6 @@ if(ENABLE_RAW_UDP)
if(NOT PCAP_FOUND)
message(FATAL_ERROR "PCAP required to compile custom UDP packet sample source")
endif()
- get_filename_component(PCAP_LIBRARY_DIRS ${PCAP_LIBRARY} DIRECTORY CACHE)
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${PCAP_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${PCAP_INCLUDE_DIRS})
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gr_complex_ip_packet_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} gr_complex_ip_packet_source.h)
endif()
@@ -55,11 +52,6 @@ set(SIGNAL_SOURCE_GR_BLOCKS_HEADERS
${OPT_DRIVER_HEADERS}
)
-
-include_directories(
- ${OPT_DRIVER_INCLUDE_DIRS}
-)
-
list(SORT SIGNAL_SOURCE_GR_BLOCKS_HEADERS)
list(SORT SIGNAL_SOURCE_GR_BLOCKS_SOURCES)
@@ -75,15 +67,18 @@ target_link_libraries(signal_source_gr_blocks
signal_source_lib
Gnuradio::runtime
Boost::thread
- ${OPT_LIBRARIES}
PRIVATE
Gflags::gflags
Glog::glog
)
-target_include_directories(signal_source_gr_blocks PUBLIC ${OPT_DRIVER_INCLUDE_DIRS})
+if(ENABLE_RAW_UDP AND PCAP_FOUND)
+ target_link_libraries(signal_source_gr_blocks
+ PUBLIC
+ Pcap::pcap
+ )
+endif()
set_property(TARGET signal_source_gr_blocks APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$
- $
)
diff --git a/src/algorithms/signal_source/libs/CMakeLists.txt b/src/algorithms/signal_source/libs/CMakeLists.txt
index 73a4170ff..e05db43f7 100644
--- a/src/algorithms/signal_source/libs/CMakeLists.txt
+++ b/src/algorithms/signal_source/libs/CMakeLists.txt
@@ -26,27 +26,18 @@ if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
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()
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
endif()
if(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
find_package(LIBIIO REQUIRED)
- 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")
- endif()
- set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
- set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
-
- ###############################################
- # FMCOMMS2 based SDR Hardware
- ###############################################
- if(LIBIIO_FOUND)
+ 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()
@@ -79,14 +70,26 @@ source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS})
target_link_libraries(signal_source_lib
PUBLIC
Boost::boost
- ${OPT_LIBRARIES}
PRIVATE
Glog::glog
)
-target_include_directories(signal_source_lib PUBLIC ${OPT_DRIVER_INCLUDE_DIRS})
+if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
+ target_link_libraries(signal_source_lib
+ PUBLIC
+ Gnuradio::iio
+ PRIVATE
+ Iio::iio
+ )
+endif()
+
+if(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
+ target_link_libraries(signal_source_lib
+ PUBLIC
+ Iio::iio
+ )
+endif()
set_property(TARGET signal_source_lib APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$
- $
)
diff --git a/src/core/libs/CMakeLists.txt b/src/core/libs/CMakeLists.txt
index d8dbb577e..5088bc944 100644
--- a/src/core/libs/CMakeLists.txt
+++ b/src/core/libs/CMakeLists.txt
@@ -44,11 +44,10 @@ target_link_libraries(rx_core_lib
supl_library
gnss_system_parameters
Boost::boost
- Glog::glog
PRIVATE
+ Glog::glog
Boost::serialization
Pugixml::pugixml
- Gflags::gflags
)
set_property(TARGET rx_core_lib
diff --git a/src/core/libs/gnss_sdr_supl_client.cc b/src/core/libs/gnss_sdr_supl_client.cc
index 0311892bd..7f211aa86 100644
--- a/src/core/libs/gnss_sdr_supl_client.cc
+++ b/src/core/libs/gnss_sdr_supl_client.cc
@@ -32,6 +32,7 @@
*/
#include "gnss_sdr_supl_client.h"
+#include
#include
#include
#include
diff --git a/src/core/libs/gnss_sdr_supl_client.h b/src/core/libs/gnss_sdr_supl_client.h
index 281d2a82d..3e0a72a3f 100644
--- a/src/core/libs/gnss_sdr_supl_client.h
+++ b/src/core/libs/gnss_sdr_supl_client.h
@@ -57,7 +57,6 @@ extern "C"
#include
#include
#include
-#include
#include
#include