1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-07-04 11:02:57 +00:00

Fixes for building against GNU Radio master

Log4cpp has been replaced by spdlog
This commit is contained in:
Carles Fernandez 2021-11-23 13:30:48 +01:00
parent c2a23dd372
commit cc38d6bc08
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
5 changed files with 32 additions and 9 deletions

View File

@ -609,13 +609,12 @@ endif()
################################################################################ ################################################################################
# Log4cpp - http://log4cpp.sourceforge.net/ # Log4cpp - http://log4cpp.sourceforge.net/
################################################################################ ################################################################################
if(GNURADIO_USES_LOG4CPP)
find_package(LOG4CPP) find_package(LOG4CPP)
set_package_properties(LOG4CPP PROPERTIES set_package_properties(LOG4CPP PROPERTIES
PURPOSE "Required by GNU Radio." PURPOSE "Required by GNU Radio."
TYPE REQUIRED TYPE OPTIONAL
) )
if(NOT LOG4CPP_FOUND)
message(FATAL_ERROR "*** Log4cpp is required to build gnss-sdr")
endif() endif()

View File

@ -392,6 +392,23 @@ if(GNURADIO_PMT_INCLUDE_DIRS)
endif() endif()
endif() endif()
# Check if GNU Radio uses log4cpp or spdlog
if(GNURADIO_RUNTIME_INCLUDE_DIRS)
if(EXISTS "${GNURADIO_RUNTIME_INCLUDE_DIRS}/gnuradio/logger.h")
file(STRINGS ${GNURADIO_RUNTIME_INCLUDE_DIRS}/gnuradio/logger.h _logger_content)
set(_uses_log4cpp FALSE)
foreach(_loop_var IN LISTS _logger_content)
string(STRIP "${_loop_var}" _file_line)
if("#include <log4cpp/Category.hh>" STREQUAL "${_file_line}")
set(_uses_log4cpp TRUE)
endif()
endforeach()
if(${_uses_log4cpp})
set(GNURADIO_USES_LOG4CPP TRUE)
endif()
endif()
endif()
set_package_properties(GNURADIO PROPERTIES set_package_properties(GNURADIO PROPERTIES
URL "https://www.gnuradio.org/" URL "https://www.gnuradio.org/"
) )

View File

@ -46,8 +46,14 @@ target_link_libraries(input_filter_gr_blocks
algorithms_libs algorithms_libs
PRIVATE PRIVATE
Volk::volk Volk::volk
)
if(LOG4CPP_FOUND)
target_link_libraries(input_filter_gr_blocks
PRIVATE
Log4cpp::log4cpp Log4cpp::log4cpp
) )
endif()
target_include_directories(input_filter_gr_blocks target_include_directories(input_filter_gr_blocks
PUBLIC PUBLIC

View File

@ -21,12 +21,12 @@
#include "INIReader.h" #include "INIReader.h"
#include "command_event.h" #include "command_event.h"
#include "gnss_sdr_make_unique.h" #include "gnss_sdr_make_unique.h"
#include <boost/any.hpp>
#include <gnuradio/io_signature.h> #include <gnuradio/io_signature.h>
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <bitset> #include <bitset>
#include <exception> #include <exception>
#include <iomanip>
#include <iostream> #include <iostream>
#include <memory> #include <memory>
#include <sstream> #include <sstream>

View File

@ -53,6 +53,7 @@
#include <algorithm> #include <algorithm>
#include <array> #include <array>
#include <fstream> #include <fstream>
#include <iomanip>
#include <map> #include <map>
#include <set> #include <set>
#include <stdexcept> #include <stdexcept>