1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-06-25 22:43:14 +00:00

Fix for gflags 2.0

This commit is contained in:
Carles Fernandez 2018-02-18 22:48:47 +01:00
parent e18ea91fd1
commit ee18aee92a
3 changed files with 39 additions and 24 deletions

View File

@ -74,7 +74,11 @@ IF(GFlags_ROOT_DIR)
SET(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR})
FIND_LIBRARY(GFlags_lib gflags ${GFlags_LIBRARY_DIRS})
if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
set(GFLAGS_GREATER_20 TRUE)
else(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
set(GFLAGS_GREATER_20 FALSE)
endif(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
# set up include and link directory
include_directories(${GFlags_INCLUDE_DIRS})
link_directories(${GFlags_LIBRARY_DIRS})

View File

@ -93,6 +93,10 @@ if(NOT VOLK_GNSSSDR_FOUND)
add_dependencies(gnss_sp_libs volk_gnsssdr_module)
endif(NOT VOLK_GNSSSDR_FOUND)
if(${GFLAGS_GREATER_20})
add_definitions(-DGFLAGS_GREATER_2_0=1)
endif(${GFLAGS_GREATER_20})
add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
source_group(Headers FILES gnss_sdr_flags.h)
target_link_libraries(gnss_sdr_flags ${GFlags_LIBS})

View File

@ -33,6 +33,32 @@
#include <cstdint>
#include <iostream>
DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)");
DEFINE_string(s, "-",
"If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)");
DEFINE_string(signal_source, "-",
"If defined, path to the file containing the signal samples (overrides the configuration file)");
DEFINE_int32(doppler_max, 0, "If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)");
DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation");
DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)");
DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite");
DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)");
DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)");
DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)");
DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)");
#if GFLAGS_GREATER_2_0
static bool ValidateDopplerMax(const char* flagname, int32_t value)
{
@ -91,33 +117,14 @@ static bool ValidatePllBw(const char* flagname, double value)
}
DEFINE_string(c, "-", "Path to the configuration file (if set, overrides --config_file)");
DEFINE_string(s, "-",
"If defined, path to the file containing the signal samples (overrides the configuration file and --signal_source)");
DEFINE_string(signal_source, "-",
"If defined, path to the file containing the signal samples (overrides the configuration file)");
DEFINE_int32(doppler_max, 0, "If defined, maximum Doppler value in the search grid, in Hz (overrides the configuration file)");
DEFINE_validator(doppler_max, &ValidateDopplerMax);
DEFINE_int32(cn0_samples, 20, "Number of correlator outputs used for CN0 estimation");
DEFINE_validator(cn0_samples, &ValidateCn0Samples);
DEFINE_int32(cn0_min, 25, "Minimum valid CN0 (in dB-Hz)");
DEFINE_validator(cn0_min, &ValidateCn0Min);
DEFINE_int32(max_lock_fail, 50, "Number number of lock failures before dropping satellite");
DEFINE_validator(max_lock_fail, &ValidateMaxLockFail);
DEFINE_double(carrier_lock_th, 0.85, "Carrier lock threshold (in rad)");
DEFINE_validator(carrier_lock_th, &ValidateCarrierLockTh);
DEFINE_string(RINEX_version, "3.02", "Specifies the RINEX version (2.11 or 3.02)");
DEFINE_double(dll_bw_hz, 0.0, "If defined, bandwidth of the DLL low pass filter, in Hz (overrides the configuration file)");
DEFINE_validator(dll_bw_hz, &ValidateDllBw);
DEFINE_double(pll_bw_hz, 0.0, "If defined, bandwidth of the PLL low pass filter, in Hz (overrides the configuration file)");
DEFINE_validator(pll_bw_hz, &ValidatePllBw);
#endif