mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-07 02:33:03 +00:00
Improve handling of the filesystem library
This commit is contained in:
@@ -18,16 +18,6 @@ else()
|
||||
add_library(pvt_gr_blocks rtklib_pvt_gs.cc rtklib_pvt_gs.h)
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(pvt_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(pvt_gr_blocks PRIVATE Boost::filesystem Boost::system)
|
||||
endif()
|
||||
|
||||
target_link_libraries(pvt_gr_blocks
|
||||
PUBLIC
|
||||
algorithms_libs_rtklib
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include "gnss_frequencies.h"
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_sdr_make_unique.h"
|
||||
#include "gps_almanac.h"
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
@@ -79,23 +80,6 @@
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
|
||||
#if USE_OLD_BOOST_MATH_COMMON_FACTOR
|
||||
#include <boost/math/common_factor_rt.hpp>
|
||||
namespace bc = boost::math;
|
||||
|
||||
@@ -54,16 +54,6 @@ else()
|
||||
add_library(pvt_libs ${PVT_LIB_SOURCES} ${PROTO_SRCS} ${PVT_LIB_HEADERS} ${PROTO_HDRS})
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(pvt_libs PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(pvt_libs PRIVATE Boost::filesystem Boost::system)
|
||||
endif()
|
||||
|
||||
target_link_libraries(pvt_libs
|
||||
PUBLIC
|
||||
Boost::date_time
|
||||
@@ -71,6 +61,7 @@ target_link_libraries(pvt_libs
|
||||
core_system_parameters
|
||||
algorithms_libs_rtklib
|
||||
PRIVATE
|
||||
algorithms_libs
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Matio::matio
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
|
||||
#include "geojson_printer.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "pvt_solution.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <glog/logging.h>
|
||||
@@ -26,26 +27,6 @@
|
||||
#include <iostream> // for cout, cerr
|
||||
#include <sstream> // for stringstream
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
GeoJSON_Printer::GeoJSON_Printer(const std::string& base_path)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
|
||||
#include "gpx_printer.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "pvt_solution.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <glog/logging.h>
|
||||
@@ -26,27 +27,6 @@
|
||||
#include <iostream> // for cout, cerr
|
||||
#include <sstream> // for stringstream
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
Gpx_Printer::Gpx_Printer(const std::string& base_path)
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
*/
|
||||
|
||||
#include "kml_printer.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "pvt_solution.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <glog/logging.h>
|
||||
@@ -28,27 +29,6 @@
|
||||
#include <sys/stat.h> // for S_IXUSR | S_IRWXG | S_IRWXO
|
||||
#include <sys/types.h> // for mode_t
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
Kml_Printer::Kml_Printer(const std::string& base_path)
|
||||
{
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "nmea_printer.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "rtklib_solution.h"
|
||||
#include "rtklib_solver.h"
|
||||
#include <glog/logging.h>
|
||||
@@ -31,27 +32,6 @@
|
||||
#include <termios.h>
|
||||
#include <utility>
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
Nmea_Printer::Nmea_Printer(const std::string& filename, bool flag_nmea_output_file, bool flag_nmea_tty_port, std::string nmea_dump_devname, const std::string& base_path)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "glonass_gnav_almanac.h"
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
#include "gps_cnav_iono.h"
|
||||
@@ -54,27 +55,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
Rinex_Printer::Rinex_Printer(int32_t conf_version, const std::string& base_path, const std::string& base_name)
|
||||
{
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "galileo_ephemeris.h"
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_sdr_make_unique.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_cnav_ephemeris.h"
|
||||
@@ -36,27 +37,6 @@
|
||||
#include <termios.h> // for tcgetattr
|
||||
#include <unistd.h> // for close, write
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format off
|
||||
|
||||
|
||||
Rtcm_Printer::Rtcm_Printer(const std::string& filename, bool flag_rtcm_file_dump, bool flag_rtcm_server, bool flag_rtcm_tty_port, uint16_t rtcm_tcp_port, uint16_t rtcm_station_id, const std::string& rtcm_dump_devname, bool time_tag_name, const std::string& base_path)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
#include "rtklib_solver.h"
|
||||
#include "Beidou_DNAV.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "rtklib_conversions.h"
|
||||
#include "rtklib_rtkpos.h"
|
||||
#include "rtklib_solution.h"
|
||||
@@ -41,27 +42,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
Rtklib_Solver::Rtklib_Solver(const rtk_t &rtk, int nchannels, const std::string &dump_filename, bool flag_dump_to_file, bool flag_dump_to_mat)
|
||||
{
|
||||
|
||||
@@ -53,16 +53,6 @@ else()
|
||||
add_library(acquisition_gr_blocks ${ACQ_GR_BLOCKS_SOURCES} ${ACQ_GR_BLOCKS_HEADERS})
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(acquisition_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(acquisition_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(acquisition_gr_blocks PRIVATE Boost::filesystem)
|
||||
endif()
|
||||
|
||||
target_link_libraries(acquisition_gr_blocks
|
||||
PUBLIC
|
||||
algorithms_libs
|
||||
|
||||
@@ -24,16 +24,8 @@
|
||||
#include "MATH_CONSTANTS.h" // for TWO_PI
|
||||
#include "gnss_frequencies.h"
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_synchro.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#endif
|
||||
#include <boost/math/special_functions/gamma.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <matio.h>
|
||||
@@ -48,16 +40,6 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
pcps_acquisition_sptr pcps_make_acquisition(const Acq_Conf& conf_)
|
||||
{
|
||||
|
||||
@@ -19,16 +19,8 @@
|
||||
#include "pcps_acquisition_fine_doppler_cc.h"
|
||||
#include "GPS_L1_CA.h" // for GPS_L1_CA_CHIP_PERIOD_S
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
#else
|
||||
#include <filesystem>
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#endif
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <matio.h>
|
||||
@@ -38,16 +30,6 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
pcps_acquisition_fine_doppler_cc_sptr pcps_make_acquisition_fine_doppler_cc(const Acq_Conf &conf_)
|
||||
{
|
||||
|
||||
@@ -54,6 +54,7 @@ set(GNSS_SPLIBS_HEADERS
|
||||
cshort_to_float_x2.h
|
||||
gnss_sdr_create_directory.h
|
||||
gnss_sdr_fft.h
|
||||
gnss_sdr_filesystem.h
|
||||
gnss_sdr_make_unique.h
|
||||
gnss_circular_deque.h
|
||||
geofunctions.h
|
||||
@@ -86,16 +87,6 @@ else()
|
||||
add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(algorithms_libs PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
|
||||
endif()
|
||||
|
||||
if(NOT has_span)
|
||||
target_include_directories(algorithms_libs
|
||||
PUBLIC
|
||||
@@ -124,6 +115,16 @@ if(GNURADIO_USES_STD_POINTERS)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(FILESYSTEM_FOUND)
|
||||
target_compile_definitions(algorithms_libs PUBLIC -DHAS_STD_FILESYSTEM=1)
|
||||
if(find_experimental)
|
||||
target_compile_definitions(algorithms_libs PUBLIC -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(algorithms_libs PUBLIC std::filesystem)
|
||||
else()
|
||||
target_link_libraries(algorithms_libs PUBLIC Boost::filesystem Boost::system)
|
||||
endif()
|
||||
|
||||
if(has_span)
|
||||
target_compile_definitions(algorithms_libs
|
||||
PUBLIC -DHAS_STD_SPAN=1
|
||||
@@ -193,14 +194,14 @@ else()
|
||||
add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
if(FILESYSTEM_FOUND)
|
||||
target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
if(find_experimental)
|
||||
target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(gnss_sdr_flags PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(gnss_sdr_flags PRIVATE Boost::filesystem)
|
||||
target_link_libraries(gnss_sdr_flags PRIVATE Boost::filesystem Boost::system)
|
||||
endif()
|
||||
|
||||
target_link_libraries(gnss_sdr_flags
|
||||
|
||||
@@ -16,30 +16,10 @@
|
||||
*/
|
||||
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include <exception> // for exception
|
||||
#include <fstream> // for ofstream
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
bool gnss_sdr_create_directory(const std::string& foldername)
|
||||
{
|
||||
std::string new_folder;
|
||||
|
||||
43
src/algorithms/libs/gnss_sdr_filesystem.h
Normal file
43
src/algorithms/libs/gnss_sdr_filesystem.h
Normal file
@@ -0,0 +1,43 @@
|
||||
/*!
|
||||
* \file gnss_sdr_filesystem.h
|
||||
* \brief Helper file for fylesystem library interface
|
||||
* \author Carles Fernandez Prades, 2021. cfernandez(at)cttc.es
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GNSS_SDR_GNSS_SDR_FILESYSTEM_H
|
||||
#define GNSS_SDR_GNSS_SDR_FILESYSTEM_H
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
#endif // GNSS_SDR_GNSS_SDR_FILESYSTEM_H
|
||||
@@ -17,22 +17,10 @@
|
||||
|
||||
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for exists
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file).");
|
||||
|
||||
|
||||
@@ -18,16 +18,6 @@ else()
|
||||
add_library(obs_gr_blocks hybrid_observables_gs.cc hybrid_observables_gs.h)
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(obs_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(obs_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(obs_gr_blocks PRIVATE Boost::filesystem)
|
||||
endif()
|
||||
|
||||
target_include_directories(obs_gr_blocks
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "gnss_circular_deque.h"
|
||||
#include "gnss_frequencies.h"
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_sdr_make_unique.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include <glog/logging.h>
|
||||
@@ -38,27 +39,6 @@
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for create_directories, exists
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
|
||||
hybrid_observables_gs_sptr hybrid_observables_gs_make(const Obs_Conf &conf_)
|
||||
{
|
||||
|
||||
@@ -43,21 +43,12 @@ target_link_libraries(telemetry_decoder_libs
|
||||
PUBLIC
|
||||
Volkgnsssdr::volkgnsssdr
|
||||
PRIVATE
|
||||
algorithms_libs
|
||||
Gflags::gflags
|
||||
Glog::glog
|
||||
Matio::matio
|
||||
)
|
||||
|
||||
if(FILESYSTEM_FOUND)
|
||||
target_compile_definitions(telemetry_decoder_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(find_experimental)
|
||||
target_compile_definitions(telemetry_decoder_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(telemetry_decoder_libs PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(telemetry_decoder_libs PRIVATE Boost::filesystem Boost::system)
|
||||
endif()
|
||||
|
||||
target_include_directories(telemetry_decoder_libs
|
||||
PUBLIC
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
#include "tlm_utils.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include <matio.h>
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
@@ -22,26 +23,6 @@
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
// clang-format off
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#include <system_error>
|
||||
namespace errorlib = std;
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/operations.hpp> // for remove
|
||||
#include <boost/filesystem/path.hpp> // for path, operator<<
|
||||
#include <boost/filesystem/path_traits.hpp> // for filesystem
|
||||
#include <boost/system/error_code.hpp> // for error_code
|
||||
namespace fs = boost::filesystem;
|
||||
namespace errorlib = boost::system;
|
||||
#endif
|
||||
// clang-format on
|
||||
|
||||
int save_tlm_matfile(const std::string &dumpfile)
|
||||
{
|
||||
|
||||
@@ -75,21 +75,12 @@ else()
|
||||
)
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
if(${find_experimental})
|
||||
target_compile_definitions(tracking_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
||||
endif()
|
||||
target_link_libraries(tracking_gr_blocks PRIVATE std::filesystem)
|
||||
else()
|
||||
target_link_libraries(tracking_gr_blocks PRIVATE Boost::filesystem)
|
||||
endif()
|
||||
|
||||
target_link_libraries(tracking_gr_blocks
|
||||
PUBLIC
|
||||
Gnuradio::blocks
|
||||
tracking_libs
|
||||
PRIVATE
|
||||
algorithms_libs
|
||||
Matio::matio
|
||||
gnss_sdr_flags
|
||||
Glog::glog
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "galileo_e6_signal_replica.h"
|
||||
#include "gnss_satellite.h"
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_l2c_signal_replica.h"
|
||||
#include "gps_l5_signal_replica.h"
|
||||
@@ -64,19 +65,6 @@
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
|
||||
dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(const Dll_Pll_Conf &conf_)
|
||||
{
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "fpga_multicorrelator.h"
|
||||
#include "gnss_satellite.h"
|
||||
#include "gnss_sdr_create_directory.h"
|
||||
#include "gnss_sdr_filesystem.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "gps_sdr_signal_replica.h"
|
||||
#include "lock_detectors.h"
|
||||
@@ -53,18 +54,6 @@
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
#if HAS_STD_FILESYSTEM_EXPERIMENTAL
|
||||
#include <experimental/filesystem>
|
||||
namespace fs = std::experimental::filesystem;
|
||||
#else
|
||||
#include <filesystem>
|
||||
namespace fs = std::filesystem;
|
||||
#endif
|
||||
#else
|
||||
#include <boost/filesystem/path.hpp>
|
||||
namespace fs = boost::filesystem;
|
||||
#endif
|
||||
|
||||
dll_pll_veml_tracking_fpga_sptr dll_pll_veml_make_tracking_fpga(const Dll_Pll_Conf_Fpga &conf_)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user