1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 20:50:33 +00:00

Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into next

This commit is contained in:
Carles Fernandez 2018-11-21 08:40:10 +01:00
commit ac2bccf6c3
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
52 changed files with 1076 additions and 1150 deletions

View File

@ -509,7 +509,7 @@ endif(NOT Boost_FOUND)
# GNU Radio - https://gnuradio.org # GNU Radio - https://gnuradio.org
################################################################################ ################################################################################
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT) set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT)
find_package(Gnuradio) find_package(GNURADIO)
if(PC_GNURADIO_RUNTIME_VERSION) if(PC_GNURADIO_RUNTIME_VERSION)
if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION}) if(PC_GNURADIO_RUNTIME_VERSION VERSION_LESS ${GNSSSDR_GNURADIO_MIN_VERSION})
set(GNURADIO_RUNTIME_FOUND) set(GNURADIO_RUNTIME_FOUND)
@ -553,7 +553,7 @@ endif()
################################################################################ ################################################################################
# VOLK - Vector-Optimized Library of Kernels # VOLK - Vector-Optimized Library of Kernels
################################################################################ ################################################################################
find_package(Volk) find_package(VOLK)
if(NOT VOLK_FOUND) if(NOT VOLK_FOUND)
message(FATAL_ERROR "*** VOLK is required to build gnss-sdr") message(FATAL_ERROR "*** VOLK is required to build gnss-sdr")
endif() endif()
@ -563,7 +563,7 @@ endif()
################################################################################ ################################################################################
# Log4cpp - http://log4cpp.sourceforge.net/ # Log4cpp - http://log4cpp.sourceforge.net/
################################################################################ ################################################################################
find_package(Log4cpp) find_package(LOG4CPP)
if(NOT LOG4CPP_FOUND) if(NOT LOG4CPP_FOUND)
message(FATAL_ERROR "*** Log4cpp is required to build gnss-sdr") message(FATAL_ERROR "*** Log4cpp is required to build gnss-sdr")
endif() endif()
@ -573,9 +573,9 @@ endif()
################################################################################ ################################################################################
# volk_gnsssdr module - GNSS-SDR's own VOLK library # volk_gnsssdr module - GNSS-SDR's own VOLK library
################################################################################ ################################################################################
find_package(VolkGnssSdr) find_package(VOLKGNSSSDR)
if(NOT VOLK_GNSSSDR_FOUND) if(NOT VOLKGNSSSDR_FOUND)
message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'") message(STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'")
############################### ###############################
# Find Python required modules # Find Python required modules
@ -710,7 +710,7 @@ if(NOT VOLK_GNSSSDR_FOUND)
add_custom_command(TARGET volk_gnsssdr_module POST_BUILD add_custom_command(TARGET volk_gnsssdr_module POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/install/bin/volk_gnsssdr-config-info
${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info) ${CMAKE_SOURCE_DIR}/install/volk_gnsssdr-config-info)
endif(NOT VOLK_GNSSSDR_FOUND) endif(NOT VOLKGNSSSDR_FOUND)
@ -718,8 +718,8 @@ endif(NOT VOLK_GNSSSDR_FOUND)
# gflags - https://github.com/gflags/gflags # gflags - https://github.com/gflags/gflags
################################################################################ ################################################################################
set(LOCAL_GFLAGS false) set(LOCAL_GFLAGS false)
find_package(GFlags) find_package(GFLAGS)
if(NOT GFlags_FOUND) if(NOT GFLAGS_FOUND)
message(STATUS " gflags library has not been found.") message(STATUS " gflags library has not been found.")
message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically ") message(STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically ")
message(STATUS " when doing 'make'. ") message(STATUS " when doing 'make'. ")
@ -770,7 +770,7 @@ if(NOT GFlags_FOUND)
set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library") set(GFlags_lib ${GFlags_LIBS} CACHE FILEPATH "Local Gflags library")
set(GFlags_LIBRARY_PATH ${GFlags_LIBS}) set(GFlags_LIBRARY_PATH ${GFlags_LIBS})
set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE) set(LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE)
endif(NOT GFlags_FOUND) endif(NOT GFLAGS_FOUND)
@ -786,9 +786,9 @@ endif(NOT ${ENABLE_OWN_GLOG})
set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION}) set(glog_RELEASE ${GNSSSDR_GLOG_LOCAL_VERSION})
if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS}) if(NOT GLOG_FOUND OR ${LOCAL_GFLAGS})
message(STATUS " glog library has not been found") message(STATUS " glog library has not been found")
if(NOT GFlags_FOUND) if(NOT GFLAGS_FOUND)
message(STATUS " or it is likely not linked to gflags.") message(STATUS " or it is likely not linked to gflags.")
endif(NOT GFlags_FOUND) endif(NOT GFLAGS_FOUND)
message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ") message(STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically ")
message(STATUS " when doing 'make'. ") message(STATUS " when doing 'make'. ")
if(NOT ${LOCAL_GFLAGS}) if(NOT ${LOCAL_GFLAGS})
@ -1215,10 +1215,10 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V
################################################################################ ################################################################################
# PugiXML - https://pugixml.org/ # PugiXML - https://pugixml.org/
################################################################################ ################################################################################
find_package(PugiXML QUIET) find_package(PUGIXML QUIET)
if(PugiXML_FOUND) if(PUGIXML_FOUND)
message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.") message(STATUS "PugiXML has been found. Reading of GSA Galileo almanac XML files enabled.")
else(PugiXML_FOUND) else(PUGIXML_FOUND)
message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.") message(STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built automatically when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'.")
set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}) set(PUGIXML_COMPILER -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER})
set(TOOLCHAIN_ARG "") set(TOOLCHAIN_ARG "")
@ -1257,7 +1257,7 @@ else(PugiXML_FOUND)
set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX}) set(PUGIXML_LIBRARY ${CMAKE_CURRENT_BINARY_DIR}/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/${CMAKE_FIND_LIBRARY_PREFIXES}pugixml${CMAKE_STATIC_LIBRARY_SUFFIX})
set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src) set(PUGIXML_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/pugixml/pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION}/src)
set(PUGIXML_LOCAL true) set(PUGIXML_LOCAL true)
endif(PugiXML_FOUND) endif(PUGIXML_FOUND)
################################################################################ ################################################################################
@ -1345,7 +1345,7 @@ endif(DOXYGEN_FOUND)
# OpenCL (OPTIONAL) # OpenCL (OPTIONAL)
############################################################################### ###############################################################################
if(ENABLE_OPENCL) if(ENABLE_OPENCL)
find_package(OpenCL) find_package(OPENCL)
if($ENV{DISABLE_OPENCL}) if($ENV{DISABLE_OPENCL})
set(DISABLE_OPENCL TRUE) set(DISABLE_OPENCL TRUE)
endif($ENV{DISABLE_OPENCL}) endif($ENV{DISABLE_OPENCL})
@ -1455,7 +1455,7 @@ if($ENV{RTLSDR_DRIVER})
endif($ENV{RTLSDR_DRIVER}) endif($ENV{RTLSDR_DRIVER})
if(ENABLE_OSMOSDR) if(ENABLE_OSMOSDR)
find_package(GrOsmoSDR) find_package(GROSMOSDR)
if(GROSMOSDR_FOUND) if(GROSMOSDR_FOUND)
message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.") message(STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled.")
message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'") message(STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'")
@ -1494,7 +1494,7 @@ endif(ENABLE_FLEXIBAND)
# GPerftools - https://github.com/gperftools/gperftools (OPTIONAL) # GPerftools - https://github.com/gperftools/gperftools (OPTIONAL)
################################################################################ ################################################################################
if(ENABLE_GPERFTOOLS) if(ENABLE_GPERFTOOLS)
find_package(Gperftools) find_package(GPERFTOOLS)
if(NOT GPERFTOOLS_FOUND) if(NOT GPERFTOOLS_FOUND)
message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.") message(STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found.")
message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.") message(STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries.")

View File

@ -1,138 +0,0 @@
# CMAKE_PARSE_ARGUMENTS(<prefix> <options> <one_value_keywords> <multi_value_keywords> args...)
#
# CMAKE_PARSE_ARGUMENTS() is intended to be used in macros or functions for
# parsing the arguments given to that macro or function.
# It processes the arguments and defines a set of variables which hold the
# values of the respective options.
#
# The <options> argument contains all options for the respective macro,
# i.e. keywords which can be used when calling the macro without any value
# following, like e.g. the OPTIONAL keyword of the install() command.
#
# The <one_value_keywords> argument contains all keywords for this macro
# which are followed by one value, like e.g. DESTINATION keyword of the
# install() command.
#
# The <multi_value_keywords> argument contains all keywords for this macro
# which can be followed by more than one value, like e.g. the TARGETS or
# FILES keywords of the install() command.
#
# When done, CMAKE_PARSE_ARGUMENTS() will have defined for each of the
# keywords listed in <options>, <one_value_keywords> and
# <multi_value_keywords> a variable composed of the given <prefix>
# followed by "_" and the name of the respective keyword.
# These variables will then hold the respective value from the argument list.
# For the <options> keywords this will be TRUE or FALSE.
#
# All remaining arguments are collected in a variable
# <prefix>_UNPARSED_ARGUMENTS, this can be checked afterwards to see whether
# your macro was called with unrecognized parameters.
#
# As an example here a my_install() macro, which takes similar arguments as the
# real install() command:
#
# function(MY_INSTALL)
# set(options OPTIONAL FAST)
# set(oneValueArgs DESTINATION RENAME)
# set(multiValueArgs TARGETS CONFIGURATIONS)
# cmake_parse_arguments(MY_INSTALL "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
# ...
#
# Assume my_install() has been called like this:
# my_install(TARGETS foo bar DESTINATION bin OPTIONAL blub)
#
# After the cmake_parse_arguments() call the macro will have set the following
# variables:
# MY_INSTALL_OPTIONAL = TRUE
# MY_INSTALL_FAST = FALSE (this option was not used when calling my_install()
# MY_INSTALL_DESTINATION = "bin"
# MY_INSTALL_RENAME = "" (was not used)
# MY_INSTALL_TARGETS = "foo;bar"
# MY_INSTALL_CONFIGURATIONS = "" (was not used)
# MY_INSTALL_UNPARSED_ARGUMENTS = "blub" (no value expected after "OPTIONAL"
#
# You can the continue and process these variables.
#
# Keywords terminate lists of values, e.g. if directly after a one_value_keyword
# another recognized keyword follows, this is interpreted as the beginning of
# the new option.
# E.g. my_install(TARGETS foo DESTINATION OPTIONAL) would result in
# MY_INSTALL_DESTINATION set to "OPTIONAL", but MY_INSTALL_DESTINATION would
# be empty and MY_INSTALL_OPTIONAL would be set to TRUE therefor.
#=============================================================================
# Copyright 2010 Alexander Neundorf <neundorf@kde.org>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
if(__CMAKE_PARSE_ARGUMENTS_INCLUDED)
return()
endif()
set(__CMAKE_PARSE_ARGUMENTS_INCLUDED TRUE)
function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgNames)
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach(option)
set(${prefix}_UNPARSED_ARGUMENTS)
set(insideValues FALSE)
set(currentArgName)
# now iterate over all arguments and fill the result variables
foreach(currentArg ${ARGN})
list(FIND _optionNames "${currentArg}" optionIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _singleArgNames "${currentArg}" singleArgIndex) # ... then this marks the end of the arguments belonging to this keyword
list(FIND _multiArgNames "${currentArg}" multiArgIndex) # ... then this marks the end of the arguments belonging to this keyword
if(${optionIndex} EQUAL -1 AND ${singleArgIndex} EQUAL -1 AND ${multiArgIndex} EQUAL -1)
if(insideValues)
if("${insideValues}" STREQUAL "SINGLE")
set(${prefix}_${currentArgName} ${currentArg})
set(insideValues FALSE)
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
else(insideValues)
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif(insideValues)
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
set(insideValues FALSE)
elseif(NOT ${singleArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "SINGLE")
elseif(NOT ${multiArgIndex} EQUAL -1)
set(currentArgName ${currentArg})
set(${prefix}_${currentArgName})
set(insideValues "MULTI")
endif()
endif()
endforeach(currentArg)
# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name)
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs)

View File

@ -0,0 +1,102 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# - Try to find GFlags
#
# The following variables are optionally searched for defaults
# GFlags_ROOT_DIR: Base directory where all GFlags components are found
#
# The following are set after configuration is done:
# GFlags_FOUND
# GFlags_INCLUDE_DIRS
# GFlags_LIBS
# GFlags_LIBRARY_DIRS
if(APPLE)
find_path(GFlags_ROOT_DIR
libgflags.dylib
PATHS
/opt/local/lib
/usr/local/lib
)
else()
find_path(GFlags_ROOT_DIR
libgflags.so
HINTS
/usr/local/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/i386-linux-gnu
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabi
/usr/lib/aarch64-linux-gnu
/usr/lib/mipsel-linux-gnu
/usr/lib/mips-linux-gnu
/usr/lib/mips64el-linux-gnuabi64
/usr/lib/powerpc-linux-gnu
/usr/lib/powerpc64-linux-gnu
/usr/lib/powerpc64le-linux-gnu
/usr/lib/powerpc-linux-gnuspe
/usr/lib/hppa-linux-gnu
/usr/lib/s390x-linux-gnu
/usr/lib/i386-gnu
/usr/lib/hppa-linux-gnu
/usr/lib/x86_64-kfreebsd-gnu
/usr/lib/i386-kfreebsd-gnu
/usr/lib/m68k-linux-gnu
/usr/lib/sh4-linux-gnu
/usr/lib/sparc64-linux-gnu
/usr/lib/x86_64-linux-gnux32
/usr/lib/alpha-linux-gnu
/usr/lib64
/usr/lib
)
endif()
if(GFlags_ROOT_DIR)
# We are testing only a couple of files in the include directories
find_path(GFlags_INCLUDE_DIRS
gflags/gflags.h
HINTS
/opt/local/include
/usr/local/include
/usr/include
${GFlags_ROOT_DIR}/src
)
# Find the libraries
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()
set(GFLAGS_GREATER_20 FALSE)
endif()
# set up include and link directory
include_directories(${GFlags_INCLUDE_DIRS})
link_directories(${GFlags_LIBRARY_DIRS})
message(STATUS "gflags library found at ${GFlags_lib}")
set(GFlags_LIBS ${GFlags_lib})
set(GFlags_FOUND true)
mark_as_advanced(GFlags_INCLUDE_DIRS)
else()
message(STATUS "Cannot find gflags")
set(GFlags_FOUND false)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS)

View File

@ -15,7 +15,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
find_library(GFORTRAN NAMES gfortran find_library(GFORTRAN NAMES gfortran
PATHS /usr/lib PATHS /usr/lib
/usr/lib64 /usr/lib64
/usr/local/lib /usr/local/lib
@ -142,7 +142,7 @@
/usr/lib/gcc/powerpc64le-linux-gnu/8 /usr/lib/gcc/powerpc64le-linux-gnu/8
/usr/lib/gcc/s390x-linux-gnu/8 /usr/lib/gcc/s390x-linux-gnu/8
/usr/lib/gcc/alpha-linux-gnu/8 /usr/lib/gcc/alpha-linux-gnu/8
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN) find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN)

View File

@ -1,101 +0,0 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# - Try to find GFlags
#
# The following variables are optionally searched for defaults
# GFlags_ROOT_DIR: Base directory where all GFlags components are found
#
# The following are set after configuration is done:
# GFlags_FOUND
# GFlags_INCLUDE_DIRS
# GFlags_LIBS
# GFlags_LIBRARY_DIRS
cmake_minimum_required(VERSION 2.6)
if(APPLE)
FIND_PATH(GFlags_ROOT_DIR
libgflags.dylib
PATHS
/opt/local/lib
/usr/local/lib
)
else(APPLE)
FIND_PATH(GFlags_ROOT_DIR
libgflags.so
HINTS
/usr/local/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/i386-linux-gnu
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabi
/usr/lib/aarch64-linux-gnu
/usr/lib/mipsel-linux-gnu
/usr/lib/mips-linux-gnu
/usr/lib/mips64el-linux-gnuabi64
/usr/lib/powerpc-linux-gnu
/usr/lib/powerpc64-linux-gnu
/usr/lib/powerpc64le-linux-gnu
/usr/lib/powerpc-linux-gnuspe
/usr/lib/hppa-linux-gnu
/usr/lib/s390x-linux-gnu
/usr/lib/i386-gnu
/usr/lib/hppa-linux-gnu
/usr/lib/x86_64-kfreebsd-gnu
/usr/lib/i386-kfreebsd-gnu
/usr/lib/m68k-linux-gnu
/usr/lib/sh4-linux-gnu
/usr/lib/sparc64-linux-gnu
/usr/lib/x86_64-linux-gnux32
/usr/lib/alpha-linux-gnu
/usr/lib64
/usr/lib
)
endif(APPLE)
IF(GFlags_ROOT_DIR)
# We are testing only a couple of files in the include directories
FIND_PATH(GFlags_INCLUDE_DIRS
gflags/gflags.h
HINTS
/opt/local/include
/usr/local/include
/usr/include
${GFlags_ROOT_DIR}/src
)
# Find the libraries
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})
message(STATUS "gflags library found at ${GFlags_lib}")
SET(GFlags_LIBS ${GFlags_lib})
SET(GFlags_FOUND true)
MARK_AS_ADVANCED(GFlags_INCLUDE_DIRS)
ELSE(GFlags_ROOT_DIR)
MESSAGE(STATUS "Cannot find gflags")
SET(GFlags_FOUND false)
ENDIF(GFlags_ROOT_DIR)

View File

@ -28,15 +28,15 @@
# GLOG_ROOT - Can be set to Glog install path or Windows build path # GLOG_ROOT - Can be set to Glog install path or Windows build path
# #
if (NOT DEFINED GLOG_ROOT) if(NOT DEFINED GLOG_ROOT)
set (GLOG_ROOT /usr /usr/local) set(GLOG_ROOT /usr /usr/local)
endif (NOT DEFINED GLOG_ROOT) endif()
if(MSVC) if(MSVC)
set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release) set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release)
else(MSVC) else()
set (LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib) set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib)
endif(MSVC) endif()
macro(_FIND_GLOG_LIBRARIES _var) macro(_FIND_GLOG_LIBRARIES _var)
find_library(${_var} find_library(${_var}
@ -88,7 +88,7 @@ if(MSVC)
${GLOG_ROOT}/src/windows ${GLOG_ROOT}/src/windows
${GLOG_ROOT}/src/windows/glog ${GLOG_ROOT}/src/windows/glog
) )
else(MSVC) else()
# Linux/OS X builds # Linux/OS X builds
find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h
PATHS PATHS
@ -96,20 +96,20 @@ else(MSVC)
/usr/include/glog /usr/include/glog
/opt/local/include/glog # default location in Macports /opt/local/include/glog # default location in Macports
) )
endif(MSVC) endif()
# Find the libraries # Find the libraries
if(MSVC) if(MSVC)
_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.lib) _find_glog_libraries(GLOG_LIBRARIES libglog.lib)
else(MSVC) else()
# Linux/OS X builds # Linux/OS X builds
if(UNIX) if(UNIX)
_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.so) _find_glog_libraries(GLOG_LIBRARIES libglog.so)
endif(UNIX) endif()
if(APPLE) if(APPLE)
_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.dylib) _find_glog_libraries(GLOG_LIBRARIES libglog.dylib)
endif(APPLE) endif()
endif(MSVC) endif()
if(GLOG_FOUND) if(GLOG_FOUND)
message(STATUS "glog library found at ${GLOG_LIBRARIES}") message(STATUS "glog library found at ${GLOG_LIBRARIES}")
@ -117,20 +117,19 @@ endif()
# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake") include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glog DEFAULT_MSG find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES)
GLOG_LIBRARIES)
if(MSVC) if(MSVC)
string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR}) string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR})
string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT}) string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT})
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}") set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}")
string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
else(MSVC) else()
# Linux/OS X builds # Linux/OS X builds
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR}) set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES}) string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
endif(MSVC) endif()
if(GLOG_FOUND) if(GLOG_FOUND)
# _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES) # _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES)

View File

@ -15,14 +15,13 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
find_program(SW_GENERATOR_BIN gnss_sim find_program(SW_GENERATOR_BIN gnss_sim
PATHS /usr/bin PATHS /usr/bin
/usr/local/bin /usr/local/bin
/opt/local/bin /opt/local/bin
${CMAKE_INSTALL_PREFIX}/bin ${CMAKE_INSTALL_PREFIX}/bin
PATH_SUFFIXES bin ) PATH_SUFFIXES bin)
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNSS-SIMULATOR DEFAULT_MSG SW_GENERATOR_BIN) find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN)
MARK_AS_ADVANCED(SW_GENERATOR_BIN) mark_as_advanced(SW_GENERATOR_BIN)

View File

@ -19,15 +19,14 @@
# Find GNU Radio # Find GNU Radio
######################################################################## ########################################################################
INCLUDE(FindPkgConfig) include(FindPkgConfig)
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list # if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list
if(NOT GR_REQUIRED_COMPONENTS) if(NOT GR_REQUIRED_COMPONENTS)
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD) set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD)
endif() endif()
# Allows us to use all .cmake files in this directory # Allows us to use all .cmake files in this directory
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR}) list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR})
@ -35,18 +34,17 @@ list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR})
set(GNURADIO_ALL_LIBRARIES "") set(GNURADIO_ALL_LIBRARIES "")
set(GNURADIO_ALL_INCLUDE_DIRS "") set(GNURADIO_ALL_INCLUDE_DIRS "")
MACRO(LIST_CONTAINS var value) macro(LIST_CONTAINS var value)
SET(${var}) set(${var})
FOREACH(value2 ${ARGN}) foreach(value2 ${ARGN})
IF (${value} STREQUAL ${value2}) if(${value} STREQUAL ${value2})
SET(${var} TRUE) set(${var} TRUE)
ENDIF(${value} STREQUAL ${value2}) endif()
ENDFOREACH(value2) endforeach()
ENDMACRO(LIST_CONTAINS) endmacro()
function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE) function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
list_contains(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS})
LIST_CONTAINS(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS})
if(NOT REQUIRED_MODULE) if(NOT REQUIRED_MODULE)
#message("Ignoring GNU Radio Module ${EXTVAR}") #message("Ignoring GNU Radio Module ${EXTVAR}")
return() return()
@ -55,7 +53,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
message(STATUS "Checking for GNU Radio Module: ${EXTVAR}") message(STATUS "Checking for GNU Radio Module: ${EXTVAR}")
# check for .pc hints # check for .pc hints
PKG_CHECK_MODULES(PC_GNURADIO_${EXTVAR} ${PCNAME}) pkg_check_modules(PC_GNURADIO_${EXTVAR} ${PCNAME})
if(NOT PC_GNURADIO_${EXTVAR}_FOUND) if(NOT PC_GNURADIO_${EXTVAR}_FOUND)
set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE}) set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE})
@ -67,7 +65,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR}) set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR})
# look for include files # look for include files
FIND_PATH( find_path(
${INCVAR_NAME} ${INCVAR_NAME}
NAMES ${INCFILE} NAMES ${INCFILE}
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
@ -81,7 +79,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
# look for libs # look for libs
foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES}) foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES})
FIND_LIBRARY( find_library(
${LIBVAR_NAME}_${libname} ${LIBVAR_NAME}_${libname}
NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION} NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION}
HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib
@ -119,7 +117,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
${GNURADIO_INSTALL_PREFIX}/lib ${GNURADIO_INSTALL_PREFIX}/lib
) )
list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}}) list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}})
endforeach(libname) endforeach()
set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE) set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE)
@ -131,7 +129,7 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE) set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE)
set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_${EXTVAR}_LIBRARIES} PARENT_SCOPE) set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_${EXTVAR}_LIBRARIES} PARENT_SCOPE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) find_package_handle_standard_args(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS)
message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}") message(STATUS "GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}")
set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE) set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE)
@ -140,34 +138,33 @@ function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!") message(STATUS "Required GNU Radio Component: ${EXTVAR} missing!")
endif() endif()
MARK_AS_ADVANCED(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS) mark_as_advanced(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS)
endfunction() endfunction()
GR_MODULE(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime) gr_module(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime)
GR_MODULE(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog) gr_module(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
GR_MODULE(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio) gr_module(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
GR_MODULE(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks) gr_module(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks)
GR_MODULE(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels) gr_module(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels)
GR_MODULE(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital) gr_module(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital)
GR_MODULE(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd) gr_module(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd)
GR_MODULE(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec) gr_module(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec)
GR_MODULE(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft) gr_module(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft)
GR_MODULE(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter) gr_module(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter)
GR_MODULE(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa) gr_module(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa)
GR_MODULE(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager) gr_module(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager)
GR_MODULE(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui) gr_module(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui)
GR_MODULE(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis) gr_module(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis)
GR_MODULE(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd) gr_module(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd)
GR_MODULE(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder) gr_module(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder)
GR_MODULE(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet) gr_module(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet)
GR_MODULE(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui) gr_module(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui)
GR_MODULE(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt) gr_module(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS) list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS)
list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES) list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES)
# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present # Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present
if(NOT PC_GNURADIO_RUNTIME_VERSION) if(NOT PC_GNURADIO_RUNTIME_VERSION)
find_file(GNURADIO_VERSION_GREATER_THAN_373 find_file(GNURADIO_VERSION_GREATER_THAN_373
NAMES gnuradio/blocks/tsb_vector_sink_f.h NAMES gnuradio/blocks/tsb_vector_sink_f.h
@ -180,7 +177,7 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION)
) )
if(GNURADIO_VERSION_GREATER_THAN_373) if(GNURADIO_VERSION_GREATER_THAN_373)
set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+") set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+")
endif(GNURADIO_VERSION_GREATER_THAN_373) endif()
find_file(GNURADIO_VERSION_GREATER_THAN_38 find_file(GNURADIO_VERSION_GREATER_THAN_38
NAMES gnuradio/filter/mmse_resampler_cc.h NAMES gnuradio/filter/mmse_resampler_cc.h
@ -193,5 +190,5 @@ if(NOT PC_GNURADIO_RUNTIME_VERSION)
) )
if(GNURADIO_VERSION_GREATER_THAN_38) if(GNURADIO_VERSION_GREATER_THAN_38)
set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+") set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+")
endif(GNURADIO_VERSION_GREATER_THAN_38) endif()
endif(NOT PC_GNURADIO_RUNTIME_VERSION) endif()

View File

@ -19,7 +19,7 @@
# #
# Usage of this module as follows: # Usage of this module as follows:
# #
# find_package(Gperftools) # find_package(GPERFTOOLS)
# #
# Variables used by this module, they can change the default behaviour and need # Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package: # to be set before calling find_package:
@ -54,7 +54,7 @@ set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( find_package_handle_standard_args(
Gperftools GPERFTOOLS
DEFAULT_MSG DEFAULT_MSG
GPERFTOOLS_LIBRARIES GPERFTOOLS_LIBRARIES
GPERFTOOLS_INCLUDE_DIR GPERFTOOLS_INCLUDE_DIR

View File

@ -19,29 +19,22 @@
# Find the native gpstk includes and library # Find the native gpstk includes and library
# This module defines # This module defines
# GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc. # GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
# GPSTK_LIBRARIES, libraries to link against to use GPSTK.
# GPSTK_FOUND, If false, do not try to use GPSTK. # GPSTK_FOUND, If false, do not try to use GPSTK.
# also defined, but not for general use are
# GPSTK_LIBRARY, where to find the GPSTK library. # GPSTK_LIBRARY, where to find the GPSTK library.
FIND_PATH(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
HINTS /usr/include HINTS /usr/include
/usr/local/include /usr/local/include
/opt/local/include ) /opt/local/include)
SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk) set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES} find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
HINTS /usr/lib HINTS /usr/lib
/usr/local/lib /usr/local/lib
/opt/local/lib ) /opt/local/lib)
# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR) find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
IF(GPSTK_FOUND)
SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} )
ENDIF(GPSTK_FOUND)
MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY)

View File

@ -19,10 +19,10 @@
# Find GR-DBFCTTC Module # Find GR-DBFCTTC Module
######################################################################## ########################################################################
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_GR_DBFCTTC gr-dbfcttc) pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc)
FIND_PATH( find_path(
GR_DBFCTTC_INCLUDE_DIRS GR_DBFCTTC_INCLUDE_DIRS
NAMES dbfcttc/api.h NAMES dbfcttc/api.h
HINTS $ENV{GR_DBFCTTC_DIR}/include HINTS $ENV{GR_DBFCTTC_DIR}/include
@ -32,7 +32,7 @@ FIND_PATH(
/usr/local/include /usr/local/include
) )
FIND_LIBRARY( find_library(
GR_DBFCTTC_LIBRARIES GR_DBFCTTC_LIBRARIES
NAMES gnuradio-dbfcttc NAMES gnuradio-dbfcttc
HINTS $ENV{GR_DBFCTTC_DIR}/lib HINTS $ENV{GR_DBFCTTC_DIR}/lib
@ -45,6 +45,6 @@ FIND_LIBRARY(
/usr/local/lib64 /usr/local/lib64
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_DBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)
MARK_AS_ADVANCED(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS) mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)

View File

@ -19,10 +19,10 @@
# Find GR-GN3S Module # Find GR-GN3S Module
######################################################################## ########################################################################
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_GR_GN3S gr-gn3s) pkg_check_modules(PC_GR_GN3S gr-gn3s)
FIND_PATH( find_path(
GR_GN3S_INCLUDE_DIRS GR_GN3S_INCLUDE_DIRS
NAMES gn3s/gn3s_api.h NAMES gn3s/gn3s_api.h
HINTS $ENV{GR_GN3S_DIR}/include HINTS $ENV{GR_GN3S_DIR}/include
@ -32,7 +32,7 @@ FIND_PATH(
/usr/include /usr/include
) )
FIND_LIBRARY( find_library(
GR_GN3S_LIBRARIES GR_GN3S_LIBRARIES
NAMES gr-gn3s NAMES gr-gn3s
HINTS $ENV{GR_GN3S_DIR}/lib HINTS $ENV{GR_GN3S_DIR}/lib
@ -45,6 +45,6 @@ FIND_LIBRARY(
/usr/lib64 /usr/lib64
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GR_GN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)
MARK_AS_ADVANCED(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS) mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)

View File

@ -15,10 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_IIO gnuradio-iio) pkg_check_modules(PC_IIO gnuradio-iio)
FIND_PATH( find_path(
IIO_INCLUDE_DIRS IIO_INCLUDE_DIRS
NAMES gnuradio/iio/api.h NAMES gnuradio/iio/api.h
HINTS $ENV{IIO_DIR}/include HINTS $ENV{IIO_DIR}/include
@ -28,7 +28,7 @@ FIND_PATH(
/usr/include /usr/include
) )
FIND_LIBRARY( find_library(
IIO_LIBRARIES IIO_LIBRARIES
NAMES gnuradio-iio NAMES gnuradio-iio
HINTS $ENV{IIO_DIR}/lib HINTS $ENV{IIO_DIR}/lib
@ -63,6 +63,6 @@ FIND_LIBRARY(
/usr/lib/sh4-linux-gnu /usr/lib/sh4-linux-gnu
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(IIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS) find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
MARK_AS_ADVANCED(IIO_LIBRARIES IIO_INCLUDE_DIRS) mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS)

View File

@ -19,7 +19,7 @@
# #
# Usage of this module as follows: # Usage of this module as follows:
# #
# find_package(GrOsmoSDR) # find_package(GROSMOSDR)
# #
# Variables used by this module, they can change the default behaviour and need # Variables used by this module, they can change the default behaviour and need
# to be set before calling find_package: # to be set before calling find_package:
@ -34,18 +34,17 @@
# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr) # GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr)
# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers # GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers
if(NOT GROSMOSDR_FOUND) pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr)
pkg_check_modules (GROSMOSDR_PKG gnuradio-osmosdr) find_path(GROSMOSDR_INCLUDE_DIR
find_path(GROSMOSDR_INCLUDE_DIR
NAMES osmosdr/source.h NAMES osmosdr/source.h
osmosdr/api.h osmosdr/api.h
PATHS PATHS
${GROSMOSDR_PKG_INCLUDE_DIRS} ${GROSMOSDR_PKG_INCLUDE_DIRS}
/usr/include /usr/include
/usr/local/include /usr/local/include
) )
find_library(GROSMOSDR_LIBRARIES find_library(GROSMOSDR_LIBRARIES
NAMES gnuradio-osmosdr NAMES gnuradio-osmosdr
PATHS PATHS
${GROSMOSDR_PKG_LIBRARY_DIRS} ${GROSMOSDR_PKG_LIBRARY_DIRS}
@ -75,16 +74,8 @@ if(NOT GROSMOSDR_FOUND)
/usr/lib/x86_64-linux-gnux32 /usr/lib/x86_64-linux-gnux32
/usr/lib/alpha-linux-gnu /usr/lib/alpha-linux-gnu
/usr/lib64 /usr/lib64
) )
if(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES) include(FindPackageHandleStandardArgs)
set(GROSMOSDR_FOUND TRUE CACHE INTERNAL "gnuradio-osmosdr found") find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
message(STATUS "Found gnuradio-osmosdr: ${GROSMOSDR_INCLUDE_DIR}, ${GROSMOSDR_LIBRARIES}") mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
else(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES)
set(GROSMOSDR_FOUND FALSE CACHE INTERNAL "gnuradio-osmosdr found")
message(STATUS "gnuradio-osmosdr not found.")
endif(GROSMOSDR_INCLUDE_DIR AND GROSMOSDR_LIBRARIES)
mark_as_advanced(GROSMOSDR_INCLUDE_DIR GROSMOSDR_LIBRARIES)
endif(NOT GROSMOSDR_FOUND)

View File

@ -15,10 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_LIBIIO libiio) pkg_check_modules(PC_LIBIIO libiio)
FIND_PATH( find_path(
LIBIIO_INCLUDE_DIRS LIBIIO_INCLUDE_DIRS
NAMES iio.h NAMES iio.h
HINTS $ENV{LIBIIO_DIR}/include HINTS $ENV{LIBIIO_DIR}/include
@ -29,7 +29,7 @@ FIND_PATH(
/opt/local/include /opt/local/include
) )
FIND_LIBRARY( find_library(
LIBIIO_LIBRARIES LIBIIO_LIBRARIES
NAMES iio libiio.so.0 NAMES iio libiio.so.0
HINTS $ENV{LIBIIO_DIR}/lib HINTS $ENV{LIBIIO_DIR}/lib
@ -65,6 +65,6 @@ FIND_LIBRARY(
/Library/Frameworks/iio.framework/ /Library/Frameworks/iio.framework/
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
MARK_AS_ADVANCED(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS) mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)

View File

@ -19,7 +19,7 @@
# #
# Usage of this module as follows: # Usage of this module as follows:
# #
# find_package(LibOsmoSDR) # find_package(LIBOSMOSDR)
# #
# #
# Variables defined by this module: # Variables defined by this module:
@ -28,17 +28,15 @@
# LIBOSMOSDR_LIBRARIES The libosmosdr libraries # LIBOSMOSDR_LIBRARIES The libosmosdr libraries
# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers # LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers
pkg_check_modules(LIBOSMOSDR_PKG libosmosdr)
if(NOT LIBOSMOSDR_FOUND) find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h
pkg_check_modules (LIBOSMOSDR_PKG libosmosdr)
find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h
PATHS PATHS
${LIBOSMOSDR_PKG_INCLUDE_DIRS} ${LIBOSMOSDR_PKG_INCLUDE_DIRS}
/usr/include /usr/include
/usr/local/include /usr/local/include
) )
find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr
PATHS PATHS
${LIBOSMOSDR_PKG_LIBRARY_DIRS} ${LIBOSMOSDR_PKG_LIBRARY_DIRS}
/usr/lib /usr/lib
@ -69,14 +67,6 @@ if(NOT LIBOSMOSDR_FOUND)
/usr/lib64 /usr/lib64
) )
if(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES) include(FindPackageHandleStandardArgs)
set(LIBOSMOSDR_FOUND TRUE CACHE INTERNAL "libosmosdr found") find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
message(STATUS "Found libosmosdr: ${LIBOSMOSDR_INCLUDE_DIR}, ${LIBOSMOSDR_LIBRARIES}")
else(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES)
set(LIBOSMOSDR_FOUND FALSE CACHE INTERNAL "libosmosdr found")
message(STATUS "libosmosdr not found.")
endif(LIBOSMOSDR_INCLUDE_DIR AND LIBOSMOSDR_LIBRARIES)
mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES) mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
endif(NOT LIBOSMOSDR_FOUND)

View File

@ -23,10 +23,10 @@
# LOG4CPP_FOUND - True if LOG4CPP found. # LOG4CPP_FOUND - True if LOG4CPP found.
if (LOG4CPP_INCLUDE_DIR) if(LOG4CPP_INCLUDE_DIR)
# Already in cache, be silent # Already in cache, be silent
set(LOG4CPP_FIND_QUIETLY TRUE) set(LOG4CPP_FIND_QUIETLY TRUE)
endif () endif()
find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh
/opt/local/include /opt/local/include
@ -70,26 +70,17 @@ find_library(LOG4CPP_LIBRARY
/opt/local/lib /opt/local/lib
) )
if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY)
if (LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY)
set(LOG4CPP_FOUND TRUE) set(LOG4CPP_FOUND TRUE)
set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE) set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE)
set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE) set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE)
else () else()
set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE) set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE)
set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE) set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE)
set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE) set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE) set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE)
set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE) set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
endif () endif()
if (LOG4CPP_FOUND) include(FindPackageHandleStandardArgs)
if (NOT LOG4CPP_FIND_QUIETLY) find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES)
message(STATUS "Found LOG4CPP: ${LOG4CPP_LIBRARIES}")
endif ()
else ()
if (LOG4CPP_FIND_REQUIRED)
message(STATUS "Looked for LOG4CPP libraries named ${LOG4CPPS_NAMES}.")
message(FATAL_ERROR "Could NOT find LOG4CPP library")
endif ()
endif ()

View File

@ -97,21 +97,19 @@ if(MATIO_INCLUDE_DIR)
endif() endif()
set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}") set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}")
endif () endif()
#==================
mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY) mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY)
# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING) find_package_handle_standard_args(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING)
if(MATIO_FOUND) if(MATIO_FOUND)
set(MATIO_LIBRARIES ${MATIO_LIBRARY}) set(MATIO_LIBRARIES ${MATIO_LIBRARY})
set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR}) set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR})
else(MATIO_FOUND) else()
set(MATIO_LIBRARIES) set(MATIO_LIBRARIES)
set(MATIO_INCLUDE_DIRS) set(MATIO_INCLUDE_DIRS)
endif(MATIO_FOUND) endif()

View File

@ -20,7 +20,7 @@
# The following environment variable is optionally searched # The following environment variable is optionally searched
# OPENBLAS_HOME: Base directory where all OpenBlas components are found # OPENBLAS_HOME: Base directory where all OpenBlas components are found
SET(OPEN_BLAS_SEARCH_PATHS /lib/ set(OPEN_BLAS_SEARCH_PATHS /lib/
/lib64/ /lib64/
/usr/lib /usr/lib
/usr/lib64 /usr/lib64
@ -32,11 +32,13 @@ SET(OPEN_BLAS_SEARCH_PATHS /lib/
$ENV{OPENBLAS_HOME}/lib $ENV{OPENBLAS_HOME}/lib
) )
FIND_LIBRARY(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS}) find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS})
IF (OPENBLAS) if(OPENBLAS)
SET(OPENBLAS_FOUND ON) set(OPENBLAS_FOUND ON)
MESSAGE(STATUS "Found OpenBLAS") message(STATUS "Found OpenBLAS")
ENDIF (OPENBLAS) endif()
MARK_AS_ADVANCED(OPENBLAS) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS)
mark_as_advanced(OPENBLAS)

View File

@ -0,0 +1,110 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# This file taken from FindOpenCL project @ http://gitorious.com/findopencl
#
# - Try to find OpenCL
# This module tries to find an OpenCL implementation on your system. It supports
# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too.
#
# Once done this will define
# OPENCL_FOUND - system has OpenCL
# OPENCL_INCLUDE_DIRS - the OpenCL include directory
# OPENCL_LIBRARIES - link these to use OpenCL
#
# WIN32 should work, but is untested
include(FindPackageHandleStandardArgs)
set(OPENCL_VERSION_STRING "0.1.0")
set(OPENCL_VERSION_MAJOR 0)
set(OPENCL_VERSION_MINOR 1)
set(OPENCL_VERSION_PATCH 0)
if(APPLE)
find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX")
find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX")
find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX")
else()
if(WIN32)
find_path(OPENCL_INCLUDE_DIRS CL/cl.h)
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp)
# The AMD SDK currently installs both x86 and x86_64 libraries
# This is only a hack to find out architecture
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64")
else()
set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86")
endif()
# find out if the user asked for a 64-bit build, and use the corresponding
# 64 or 32 bit NVIDIA library paths to the search:
string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR})
if("${ISWIN64}" STREQUAL "Win64")
find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64)
else()
find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32)
endif()
get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
# On Win32 search relative to the library
find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
else()
# Unix style platforms
find_library(OPENCL_LIBRARIES OpenCL
ENV LD_LIBRARY_PATH
)
get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH)
get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
# The AMD SDK currently does not place its headers
# in /usr/include, therefore also search relative
# to the library
find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
endif()
endif()
find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS)
if(_OPENCL_CPP_INCLUDE_DIRS)
set(OPENCL_HAS_CPP_BINDINGS TRUE)
list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS})
# This is often the same, so clean up
list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS)
endif()
mark_as_advanced(
OPENCL_INCLUDE_DIRS
)
if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES)
set( OPENCL_FOUND TRUE )
add_definitions( -DOPENCL=1 )
else()
set( OPENCL_FOUND FALSE )
add_definitions( -DOPENCL=0 )
endif()

View File

@ -15,19 +15,19 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
FIND_PACKAGE(PkgConfig) find_package(PkgConfig)
PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22") pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22")
FIND_PROGRAM(ORCC_EXECUTABLE orcc find_program(ORCC_EXECUTABLE orcc
HINTS ${PC_ORC_TOOLSDIR} HINTS ${PC_ORC_TOOLSDIR}
PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin) PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin)
FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h find_path(ORC_INCLUDE_DIR NAMES orc/orc.h
HINTS ${PC_ORC_INCLUDEDIR} HINTS ${PC_ORC_INCLUDEDIR}
PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4) PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4)
FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX} find_path(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX}
HINTS ${PC_ORC_LIBDIR} HINTS ${PC_ORC_LIBDIR}
/usr/local/lib /usr/local/lib
/usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
@ -47,20 +47,20 @@ FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHA
/usr/lib /usr/lib
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
FIND_LIBRARY(ORC_LIB orc-0.4 find_library(ORC_LIB orc-0.4
HINTS ${PC_ORC_LIBRARY_DIRS} HINTS ${PC_ORC_LIBRARY_DIRS}
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}) PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
LIST(APPEND ORC_LIBRARY list(APPEND ORC_LIBRARY
${ORC_LIB} ${ORC_LIB}
) )
SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR}) set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR})
SET(ORC_LIBRARIES ${ORC_LIBRARY}) set(ORC_LIBRARIES ${ORC_LIBRARY})
SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR}) set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR})
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE) find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE) mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE)

View File

@ -1,116 +0,0 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
#
# This file taken from FindOpenCL project @ http://gitorious.com/findopencl
#
# - Try to find OpenCL
# This module tries to find an OpenCL implementation on your system. It supports
# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too.
#
# Once done this will define
# OPENCL_FOUND - system has OpenCL
# OPENCL_INCLUDE_DIRS - the OpenCL include directory
# OPENCL_LIBRARIES - link these to use OpenCL
#
# WIN32 should work, but is untested
FIND_PACKAGE( PackageHandleStandardArgs )
SET (OPENCL_VERSION_STRING "0.1.0")
SET (OPENCL_VERSION_MAJOR 0)
SET (OPENCL_VERSION_MINOR 1)
SET (OPENCL_VERSION_PATCH 0)
IF (APPLE)
FIND_LIBRARY(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX")
FIND_PATH(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX")
FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX")
ELSE (APPLE)
IF (WIN32)
FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h)
FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp)
# The AMD SDK currently installs both x86 and x86_64 libraries
# This is only a hack to find out architecture
IF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64")
ELSE (${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
SET(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
SET(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86")
ENDIF( ${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64" )
# find out if the user asked for a 64-bit build, and use the corresponding
# 64 or 32 bit NVIDIA library paths to the search:
STRING(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR})
IF("${ISWIN64}" STREQUAL "Win64")
FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64)
ELSE("${ISWIN64}" STREQUAL "Win64")
FIND_LIBRARY(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32)
ENDIF("${ISWIN64}" STREQUAL "Win64")
GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
# On Win32 search relative to the library
FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
ELSE (WIN32)
# Unix style platforms
FIND_LIBRARY(OPENCL_LIBRARIES OpenCL
ENV LD_LIBRARY_PATH
)
GET_FILENAME_COMPONENT(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH)
GET_FILENAME_COMPONENT(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
# The AMD SDK currently does not place its headers
# in /usr/include, therefore also search relative
# to the library
FIND_PATH(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
FIND_PATH(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
ENDIF (WIN32)
ENDIF (APPLE)
FIND_PACKAGE_HANDLE_STANDARD_ARGS( OpenCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS )
IF( _OPENCL_CPP_INCLUDE_DIRS )
SET( OPENCL_HAS_CPP_BINDINGS TRUE )
LIST( APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS} )
# This is often the same, so clean up
LIST( REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS )
ENDIF( _OPENCL_CPP_INCLUDE_DIRS )
MARK_AS_ADVANCED(
OPENCL_INCLUDE_DIRS
)
IF( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES )
SET( OPENCL_FOUND TRUE )
add_definitions( -DOPENCL=1 )
ELSE( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES )
SET( OPENCL_FOUND FALSE )
add_definitions( -DOPENCL=0 )
ENDIF( OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES )

View File

@ -45,8 +45,8 @@
# PCAP_FOUND - True if pcap found. # PCAP_FOUND - True if pcap found.
IF(EXISTS $ENV{PCAPDIR}) if(EXISTS $ENV{PCAPDIR})
FIND_PATH(PCAP_INCLUDE_DIR find_path(PCAP_INCLUDE_DIR
NAMES NAMES
pcap/pcap.h pcap/pcap.h
pcap.h pcap.h
@ -54,68 +54,60 @@ IF(EXISTS $ENV{PCAPDIR})
$ENV{PCAPDIR} $ENV{PCAPDIR}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
find_library(PCAP_LIBRARY
FIND_LIBRARY(PCAP_LIBRARY
NAMES NAMES
pcap pcap
PATHS PATHS
$ENV{PCAPDIR} $ENV{PCAPDIR}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
else()
find_path(PCAP_INCLUDE_DIR
ELSE(EXISTS $ENV{PCAPDIR})
FIND_PATH(PCAP_INCLUDE_DIR
NAMES NAMES
pcap/pcap.h pcap/pcap.h
pcap.h pcap.h
) )
FIND_LIBRARY(PCAP_LIBRARY find_library(PCAP_LIBRARY
NAMES NAMES
pcap pcap
) )
endif()
ENDIF(EXISTS $ENV{PCAPDIR}) set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR})
set(PCAP_LIBRARIES ${PCAP_LIBRARY})
SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR}) if(PCAP_INCLUDE_DIRS)
SET(PCAP_LIBRARIES ${PCAP_LIBRARY}) message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}")
else()
message(FATAL " Pcap include dirs cannot be found")
endif()
IF(PCAP_INCLUDE_DIRS) if(PCAP_LIBRARIES)
MESSAGE(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}") message(STATUS "Pcap library set to ${PCAP_LIBRARIES}")
ELSE(PCAP_INCLUDE_DIRS) else()
MESSAGE(FATAL " Pcap include dirs cannot be found") message(FATAL "Pcap library cannot be found")
ENDIF(PCAP_INCLUDE_DIRS) endif()
IF(PCAP_LIBRARIES)
MESSAGE(STATUS "Pcap library set to ${PCAP_LIBRARIES}")
ELSE(PCAP_LIBRARIES)
MESSAGE(FATAL "Pcap library cannot be found")
ENDIF(PCAP_LIBRARIES)
#Functions #Functions
INCLUDE(CheckFunctionExists) include(CheckFunctionExists)
SET(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS}) set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS})
SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES}) set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES})
CHECK_FUNCTION_EXISTS("pcap_breakloop" HAVE_PCAP_BREAKLOOP) check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP)
CHECK_FUNCTION_EXISTS("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL) check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL)
CHECK_FUNCTION_EXISTS("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME) check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME)
CHECK_FUNCTION_EXISTS("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS) check_function_exists("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS)
CHECK_FUNCTION_EXISTS("pcap_freecode" HAVE_PCAP_FREECODE) check_function_exists("pcap_freecode" HAVE_PCAP_FREECODE)
CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD) check_function_exists("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD)
CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION) check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION)
CHECK_FUNCTION_EXISTS("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS) check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS)
CHECK_FUNCTION_EXISTS("pcap_open_dead" HAVE_PCAP_OPEN_DEAD) check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD)
CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK) check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK)
mark_as_advanced(
#Is pcap found ?
IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES)
SET( PCAP_FOUND true )
ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES)
MARK_AS_ADVANCED(
PCAP_LIBRARIES PCAP_LIBRARIES
PCAP_INCLUDE_DIRS PCAP_INCLUDE_DIRS
) )
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)

View File

@ -0,0 +1,67 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# Find the pugixml XML parsing library.
#
# Sets the usual variables expected for find_package scripts:
#
# PUGIXML_INCLUDE_DIR - header location
# PUGIXML_LIBRARIES - library to link against
# PUGIXML_FOUND - true if pugixml was found.
find_path(PUGIXML_INCLUDE_DIR
NAMES pugixml.hpp
PATHS ${PUGIXML_HOME}/include
/usr/include
/usr/local/include
/opt/local/include)
find_library(PUGIXML_LIBRARY
NAMES pugixml
PATHS ${PUGIXML_HOME}/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/aarch64-linux-gnu
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/i386-linux-gnu
/usr/lib/mips-linux-gnu
/usr/lib/mips64el-linux-gnuabi64
/usr/lib/mipsel-linux-gnu
/usr/lib/powerpc64le-linux-gnu
/usr/lib/s390x-linux-gnu
/usr/local/lib
/opt/local/lib
/usr/lib
/usr/lib64
/usr/local/lib64)
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_LIBRARY
PUGIXML_INCLUDE_DIR)
if(PUGIXML_FOUND)
set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
if(NOT PUGIXML_FIND_QUIETLY)
message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
endif()
else()
message(STATUS "PugiXML not found.")
endif()
mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)

View File

@ -1,69 +0,0 @@
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
# Find the pugixml XML parsing library.
#
# Sets the usual variables expected for find_package scripts:
#
# PUGIXML_INCLUDE_DIR - header location
# PUGIXML_LIBRARIES - library to link against
# PUGIXML_FOUND - true if pugixml was found.
find_path (PUGIXML_INCLUDE_DIR
NAMES pugixml.hpp
PATHS ${PUGIXML_HOME}/include
/usr/include
/usr/local/include
/opt/local/include)
find_library (PUGIXML_LIBRARY
NAMES pugixml
PATHS ${PUGIXML_HOME}/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/aarch64-linux-gnu
/usr/lib/arm-linux-gnueabi
/usr/lib/arm-linux-gnueabihf
/usr/lib/i386-linux-gnu
/usr/lib/mips-linux-gnu
/usr/lib/mips64el-linux-gnuabi64
/usr/lib/mipsel-linux-gnu
/usr/lib/powerpc64le-linux-gnu
/usr/lib/s390x-linux-gnu
/usr/local/lib
/opt/local/lib
/usr/lib
/usr/lib64
/usr/local/lib64 )
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
include (FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS (PugiXML DEFAULT_MSG PUGIXML_LIBRARY
PUGIXML_INCLUDE_DIR)
if (PUGIXML_FOUND)
set (PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
if (NOT PugiXML_FIND_QUIETLY)
message (STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
message (STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
endif (NOT PugiXML_FIND_QUIETLY)
else (PUGIXML_FOUND)
message (STATUS "PugiXML not found.")
endif(PUGIXML_FOUND)
mark_as_advanced (PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)

View File

@ -15,10 +15,10 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>. # along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_TELEORBIT teleorbit) pkg_check_modules(PC_TELEORBIT teleorbit)
FIND_PATH( find_path(
TELEORBIT_INCLUDE_DIRS TELEORBIT_INCLUDE_DIRS
NAMES teleorbit/api.h NAMES teleorbit/api.h
HINTS $ENV{TELEORBIT_DIR}/include HINTS $ENV{TELEORBIT_DIR}/include
@ -28,7 +28,7 @@ FIND_PATH(
/usr/include /usr/include
) )
FIND_LIBRARY( find_library(
TELEORBIT_LIBRARIES TELEORBIT_LIBRARIES
NAMES gnuradio-teleorbit NAMES gnuradio-teleorbit
HINTS $ENV{TELEORBIT_DIR}/lib HINTS $ENV{TELEORBIT_DIR}/lib
@ -41,6 +41,6 @@ FIND_LIBRARY(
/usr/lib64 /usr/lib64
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)
MARK_AS_ADVANCED(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS) mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)

View File

@ -19,10 +19,10 @@
# Find the library for the USRP Hardware Driver # Find the library for the USRP Hardware Driver
######################################################################## ########################################################################
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_UHD uhd) pkg_check_modules(PC_UHD uhd)
FIND_PATH( find_path(
UHD_INCLUDE_DIRS UHD_INCLUDE_DIRS
NAMES uhd/config.hpp NAMES uhd/config.hpp
HINTS $ENV{UHD_DIR}/include HINTS $ENV{UHD_DIR}/include
@ -32,7 +32,7 @@ FIND_PATH(
${GNURADIO_INSTALL_PREFIX}/include ${GNURADIO_INSTALL_PREFIX}/include
) )
FIND_LIBRARY( find_library(
UHD_LIBRARIES UHD_LIBRARIES
NAMES uhd NAMES uhd
HINTS $ENV{UHD_DIR}/lib HINTS $ENV{UHD_DIR}/lib
@ -66,6 +66,6 @@ FIND_LIBRARY(
${GNURADIO_INSTALL_PREFIX}/lib ${GNURADIO_INSTALL_PREFIX}/lib
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS) find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS) mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)

View File

@ -19,10 +19,10 @@
# Find VOLK (Vector-Optimized Library of Kernels) # Find VOLK (Vector-Optimized Library of Kernels)
######################################################################## ########################################################################
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_VOLK volk) pkg_check_modules(PC_VOLK volk)
FIND_PATH( find_path(
VOLK_INCLUDE_DIRS VOLK_INCLUDE_DIRS
NAMES volk/volk.h NAMES volk/volk.h
HINTS $ENV{VOLK_DIR}/include HINTS $ENV{VOLK_DIR}/include
@ -32,7 +32,7 @@ FIND_PATH(
${CMAKE_INSTALL_PREFIX}/include ${CMAKE_INSTALL_PREFIX}/include
) )
FIND_LIBRARY( find_library(
VOLK_LIBRARIES VOLK_LIBRARIES
NAMES volk NAMES volk
HINTS $ENV{VOLK_DIR}/lib HINTS $ENV{VOLK_DIR}/lib
@ -67,7 +67,6 @@ FIND_LIBRARY(
${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_INSTALL_PREFIX}/lib
) )
include(FindPackageHandleStandardArgs)
INCLUDE(FindPackageHandleStandardArgs) find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS) mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION)
MARK_AS_ADVANCED(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION)

View File

@ -19,10 +19,10 @@
# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library # Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library
######################################################################## ########################################################################
INCLUDE(FindPkgConfig) include(FindPkgConfig)
PKG_CHECK_MODULES(PC_VOLK_GNSSSDR volk_gnsssdr) pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr)
FIND_PATH( find_path(
VOLK_GNSSSDR_INCLUDE_DIRS VOLK_GNSSSDR_INCLUDE_DIRS
NAMES volk_gnsssdr/volk_gnsssdr.h NAMES volk_gnsssdr/volk_gnsssdr.h
HINTS $ENV{VOLK_GNSSSDR_DIR}/include HINTS $ENV{VOLK_GNSSSDR_DIR}/include
@ -32,7 +32,7 @@ FIND_PATH(
${GNURADIO_INSTALL_PREFIX}/include ${GNURADIO_INSTALL_PREFIX}/include
) )
FIND_LIBRARY( find_library(
VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_LIBRARIES
NAMES volk_gnsssdr NAMES volk_gnsssdr
HINTS $ENV{VOLK_GNSSSDR_DIR}/lib HINTS $ENV{VOLK_GNSSSDR_DIR}/lib
@ -44,6 +44,6 @@ FIND_LIBRARY(
${GNURADIO_INSTALL_PREFIX}/lib ${GNURADIO_INSTALL_PREFIX}/lib
) )
INCLUDE(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(VOLK_GNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
MARK_AS_ADVANCED(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS) mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)

View File

@ -56,11 +56,11 @@ function(GNSSSDR_CHECK_BUILD_TYPE settype)
string(TOUPPER ${btype} _btype) string(TOUPPER ${btype} _btype)
if(${_settype} STREQUAL ${_btype}) if(${_settype} STREQUAL ${_btype})
return() # found it; exit cleanly return() # found it; exit cleanly
endif(${_settype} STREQUAL ${_btype}) endif()
endforeach(btype) endforeach()
# Build type not found; error out # Build type not found; error out
message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}") message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}")
endfunction(GNSSSDR_CHECK_BUILD_TYPE) endfunction()
######################################################################## ########################################################################
@ -86,12 +86,12 @@ if(NOT WIN32)
"-W" CACHE STRING "-W" CACHE STRING
"Flags used by the shared lib linker during Coverage builds." FORCE) "Flags used by the shared lib linker during Coverage builds." FORCE)
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_CXX_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE
CMAKE_C_FLAGS_COVERAGE CMAKE_C_FLAGS_COVERAGE
CMAKE_EXE_LINKER_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE
CMAKE_SHARED_LINKER_FLAGS_COVERAGE) CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
endif(NOT WIN32) endif()
######################################################################## ########################################################################
@ -117,12 +117,12 @@ if(NOT WIN32)
"-W" CACHE STRING "-W" CACHE STRING
"Flags used by the shared lib linker during NoOptWithASM builds." FORCE) "Flags used by the shared lib linker during NoOptWithASM builds." FORCE)
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_CXX_FLAGS_NOOPTWITHASM CMAKE_CXX_FLAGS_NOOPTWITHASM
CMAKE_C_FLAGS_NOOPTWITHASM CMAKE_C_FLAGS_NOOPTWITHASM
CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM) CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM)
endif(NOT WIN32) endif()
@ -150,12 +150,12 @@ if(NOT WIN32)
"-W" CACHE STRING "-W" CACHE STRING
"Flags used by the shared lib linker during O2WithASM builds." FORCE) "Flags used by the shared lib linker during O2WithASM builds." FORCE)
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_CXX_FLAGS_O2WITHASM CMAKE_CXX_FLAGS_O2WITHASM
CMAKE_C_FLAGS_O2WITHASM CMAKE_C_FLAGS_O2WITHASM
CMAKE_EXE_LINKER_FLAGS_O2WITHASM CMAKE_EXE_LINKER_FLAGS_O2WITHASM
CMAKE_SHARED_LINKER_FLAGS_O2WITHASM) CMAKE_SHARED_LINKER_FLAGS_O2WITHASM)
endif(NOT WIN32) endif()
######################################################################## ########################################################################
@ -182,12 +182,12 @@ if(NOT WIN32)
"-W" CACHE STRING "-W" CACHE STRING
"Flags used by the shared lib linker during O3WithASM builds." FORCE) "Flags used by the shared lib linker during O3WithASM builds." FORCE)
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_CXX_FLAGS_O3WITHASM CMAKE_CXX_FLAGS_O3WITHASM
CMAKE_C_FLAGS_O3WITHASM CMAKE_C_FLAGS_O3WITHASM
CMAKE_EXE_LINKER_FLAGS_O3WITHASM CMAKE_EXE_LINKER_FLAGS_O3WITHASM
CMAKE_SHARED_LINKER_FLAGS_O3WITHASM) CMAKE_SHARED_LINKER_FLAGS_O3WITHASM)
endif(NOT WIN32) endif()
######################################################################## ########################################################################
@ -211,9 +211,9 @@ if(NOT WIN32)
"-W" CACHE STRING "-W" CACHE STRING
"Flags used by the shared lib linker during Address Sanitized builds." FORCE) "Flags used by the shared lib linker during Address Sanitized builds." FORCE)
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_CXX_FLAGS_ASAN CMAKE_CXX_FLAGS_ASAN
CMAKE_C_FLAGS_ASAN CMAKE_C_FLAGS_ASAN
CMAKE_EXE_LINKER_FLAGS_ASAN CMAKE_EXE_LINKER_FLAGS_ASAN
CMAKE_SHARED_LINKER_ASAN) CMAKE_SHARED_LINKER_ASAN)
endif(NOT WIN32) endif()

View File

@ -36,10 +36,10 @@ macro(GNSSSDR_PYTHON_CHECK_MODULE_RAW desc python_code have)
message(STATUS "Python checking for ${desc} - not found") message(STATUS "Python checking for ${desc} - not found")
set(${have} FALSE) set(${have} FALSE)
endif() endif()
endmacro(GNSSSDR_PYTHON_CHECK_MODULE_RAW) endmacro()
macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have) macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have)
GNSSSDR_PYTHON_CHECK_MODULE_RAW( gnsssdr_python_check_module_raw(
"${desc}" " "${desc}" "
######################################### #########################################
try: try:
@ -49,7 +49,7 @@ except (ImportError, AssertionError): exit(-1)
except: pass except: pass
#########################################" #########################################"
"${have}") "${have}")
endmacro(GNSSSDR_PYTHON_CHECK_MODULE) endmacro()
######################################################################## ########################################################################
@ -64,58 +64,56 @@ if(CMAKE_VERSION VERSION_LESS 3.12)
string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3) string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3)
if(IS_PYTHON3 EQUAL -1) if(IS_PYTHON3 EQUAL -1)
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED) find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED)
else(IS_PYTHON3 EQUAL -1) else()
find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
endif(IS_PYTHON3 EQUAL -1) endif()
GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
else(PYTHON_EXECUTABLE) else()
message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2") message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2")
message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.") message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.")
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION}) find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION})
if(NOT PYTHONINTERP_FOUND) if(NOT PYTHONINTERP_FOUND)
message(STATUS "python2 not found - trying with python3") message(STATUS "python2 not found - trying with python3")
find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED) find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
endif(NOT PYTHONINTERP_FOUND) endif()
GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
endif(PYTHON_EXECUTABLE) endif()
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT) find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
else(CMAKE_VERSION VERSION_LESS 3.12) else()
find_package (Python3 COMPONENTS Interpreter) find_package(Python3 COMPONENTS Interpreter)
if(Python3_FOUND) if(Python3_FOUND)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE}) set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR}) set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
endif(Python3_FOUND) endif()
if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND)
find_package(Python2 COMPONENTS Interpreter) find_package(Python2 COMPONENTS Interpreter)
if(Python2_FOUND) if(Python2_FOUND)
set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE}) set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR}) set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR})
GNSSSDR_PYTHON_CHECK_MODULE("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND) gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND) gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
GNSSSDR_PYTHON_CHECK_MODULE("six - python 2 and 3 compatibility library" six "True" SIX_FOUND) gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
endif(Python2_FOUND) endif()
endif(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND) endif()
endif(CMAKE_VERSION VERSION_LESS 3.12) endif()
if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
set(PYTHON3 TRUE) set(PYTHON3 TRUE)
endif(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3) endif()
if(CMAKE_CROSSCOMPILING) if(CMAKE_CROSSCOMPILING)
set(QA_PYTHON_EXECUTABLE "/usr/bin/python") set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
else(CMAKE_CROSSCOMPILING) else()
set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE}) set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
endif(CMAKE_CROSSCOMPILING) endif()
# make the path to the executable appear in the cmake gui
#make the path to the executable appear in the cmake gui
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter") set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests") set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")

View File

@ -22,8 +22,8 @@
# - Anthony Arnold # - Anthony Arnold
############################################################################## ##############################################################################
if (__TEST_FOR_ARM_INCLUDED) if(__TEST_FOR_ARM_INCLUDED)
return () return()
endif() endif()
set(__TEST_FOR_ARM_INCLUDED TRUE) set(__TEST_FOR_ARM_INCLUDED TRUE)
@ -31,17 +31,17 @@ set(__TEST_FOR_ARM_INCLUDED TRUE)
# output variable if found. # output variable if found.
function(check_arm_version ppdef input_string version output_var) function(check_arm_version ppdef input_string version output_var)
string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}") string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}")
if (NOT _VERSION_MATCH STREQUAL "") if(NOT _VERSION_MATCH STREQUAL "")
set(${output_var} "${version}" PARENT_SCOPE) set(${output_var} "${version}" PARENT_SCOPE)
endif(NOT _VERSION_MATCH STREQUAL "") endif()
endfunction() endfunction()
message(STATUS "Checking for ARM") message(STATUS "Checking for ARM")
set (IS_ARM NO) set(IS_ARM NO)
set (ARM_VERSION "") set(ARM_VERSION "")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
execute_process(COMMAND echo "int main(){}" execute_process(COMMAND echo "int main(){}"
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E -
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS) OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
@ -49,9 +49,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
if(ARM_FOUND STREQUAL "") if(ARM_FOUND STREQUAL "")
string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}") string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
endif(ARM_FOUND STREQUAL "") endif()
if (NOT ARM_FOUND STREQUAL "") if(NOT ARM_FOUND STREQUAL "")
set(IS_ARM YES) set(IS_ARM YES)
message(STATUS "ARM system detected") message(STATUS "ARM system detected")
@ -83,22 +83,21 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
check_arm_version("__ARM_ARCH_8A" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION) check_arm_version("__ARM_ARCH_8A" ${TEST_FOR_ARM_RESULTS} "armv8-a" ARM_VERSION)
# anything else just define as arm # anything else just define as arm
if (ARM_VERSION STREQUAL "") if(ARM_VERSION STREQUAL "")
message(STATUS "Couldn't detect ARM version. Setting to 'arm'") message(STATUS "Couldn't detect ARM version. Setting to 'arm'")
set(ARM_VERSION "arm") set(ARM_VERSION "arm")
else (ARM_VERSION STREQUAL "") else()
message(STATUS "ARM version ${ARM_VERSION} detected") message(STATUS "ARM version ${ARM_VERSION} detected")
endif (ARM_VERSION STREQUAL "") endif()
else()
else (NOT ARM_FOUND STREQUAL "")
message(STATUS "System is not ARM") message(STATUS "System is not ARM")
endif(NOT ARM_FOUND STREQUAL "") endif()
else (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") else()
# TODO: Other compilers # TODO: Other compilers
message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false") message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false")
message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually") message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually")
endif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif()
set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM") set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM")
set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version") set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version")

View File

@ -22,21 +22,20 @@
# - Anthony Arnold # - Anthony Arnold
############################################################################### ###############################################################################
function(test_for_sse h_file result_var name)
function (test_for_sse h_file result_var name) if(NOT DEFINED ${result_var})
if (NOT DEFINED ${result_var})
execute_process(COMMAND echo "#include <${h_file}>" execute_process(COMMAND echo "#include <${h_file}>"
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ - COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -c -x c++ -
RESULT_VARIABLE COMPILE_RESULT RESULT_VARIABLE COMPILE_RESULT
OUTPUT_QUIET ERROR_QUIET) OUTPUT_QUIET ERROR_QUIET)
set(detected 0) set(detected 0)
if (COMPILE_RESULT EQUAL 0) if(COMPILE_RESULT EQUAL 0)
message(STATUS "Detected ${name}") message(STATUS "Detected ${name}")
set(detected 1) set(detected 1)
endif(COMPILE_RESULT EQUAL 0) endif()
set(${result_var} ${detected} CACHE INTERNAL "${name} Available") set(${result_var} ${detected} CACHE INTERNAL "${name} Available")
endif (NOT DEFINED ${result_var}) endif()
endfunction(test_for_sse) endfunction()
message(STATUS "Testing for SIMD extensions") message(STATUS "Testing for SIMD extensions")

View File

@ -63,6 +63,17 @@ MmseResamplerConditioner::MmseResamplerConditioner(
if (item_type_.compare("gr_complex") == 0) if (item_type_.compare("gr_complex") == 0)
{ {
item_size_ = sizeof(gr_complex); item_size_ = sizeof(gr_complex);
//create a FIR low pass filter
std::vector<float> taps = gr::filter::firdes::low_pass(1.0,
sample_freq_in_,
sample_freq_out_ / 2.1,
sample_freq_out_ / 10,
gr::filter::firdes::win_type::WIN_HAMMING);
std::cout << "Enabled fractional resampler low pass filter with " << taps.size() << " taps" << std::endl;
fir_filter_ccf_ = gr::filter::fir_filter_ccf::make(1, taps);
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_); resampler_ = gr::filter::mmse_resampler_cc::make(0.0, sample_freq_in_ / sample_freq_out_);
#else #else
@ -96,18 +107,17 @@ MmseResamplerConditioner::MmseResamplerConditioner(
MmseResamplerConditioner::~MmseResamplerConditioner() {} MmseResamplerConditioner::~MmseResamplerConditioner() {}
void MmseResamplerConditioner::connect(gr::top_block_sptr top_block) void MmseResamplerConditioner::connect(gr::top_block_sptr top_block)
{ {
if (dump_) if (dump_)
{ {
top_block->connect(fir_filter_ccf_, 0, resampler_, 0);
top_block->connect(resampler_, 0, file_sink_, 0); top_block->connect(resampler_, 0, file_sink_, 0);
DLOG(INFO) << "connected resampler to file sink"; DLOG(INFO) << "connected resampler to file sink";
} }
else else
{ {
DLOG(INFO) << "nothing to connect internally"; top_block->connect(fir_filter_ccf_, 0, resampler_, 0);
} }
} }
@ -116,14 +126,19 @@ void MmseResamplerConditioner::disconnect(gr::top_block_sptr top_block)
{ {
if (dump_) if (dump_)
{ {
top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0);
top_block->disconnect(resampler_, 0, file_sink_, 0); top_block->disconnect(resampler_, 0, file_sink_, 0);
} }
else
{
top_block->disconnect(fir_filter_ccf_, 0, resampler_, 0);
}
} }
gr::basic_block_sptr MmseResamplerConditioner::get_left_block() gr::basic_block_sptr MmseResamplerConditioner::get_left_block()
{ {
return resampler_; return fir_filter_ccf_;
} }

View File

@ -36,9 +36,13 @@
#include "gnss_block_interface.h" #include "gnss_block_interface.h"
#ifdef GR_GREATER_38 #ifdef GR_GREATER_38
#include <gnuradio/filter/mmse_resampler_cc.h> #include <gnuradio/filter/mmse_resampler_cc.h>
#include <gnuradio/filter/fir_filter_blk.h>
#else #else
#include <gnuradio/filter/fractional_resampler_cc.h> #include <gnuradio/filter/fractional_resampler_cc.h>
#include <gnuradio/filter/fir_filter_ccf.h>
#endif #endif
#include <gnuradio/filter/firdes.h>
#include <string> #include <string>
class ConfigurationInterface; class ConfigurationInterface;
@ -91,6 +95,7 @@ private:
#else #else
gr::filter::fractional_resampler_cc::sptr resampler_; gr::filter::fractional_resampler_cc::sptr resampler_;
#endif #endif
gr::filter::fir_filter_ccf::sptr fir_filter_ccf_;
gr::block_sptr file_sink_; gr::block_sptr file_sink_;
}; };

View File

@ -32,21 +32,21 @@ if(ENABLE_RAW_UDP)
endif(ENABLE_RAW_UDP) endif(ENABLE_RAW_UDP)
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
find_package(Griio REQUIRED) find_package(GRIIO REQUIRED)
if(NOT IIO_FOUND) if(NOT GRIIO_FOUND)
message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "gnuradio-iio not found, its installation is required.")
message(STATUS "Please build and install the following projects:") message(STATUS "Please build and install the following projects:")
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") 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.") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled.")
endif(NOT IIO_FOUND) endif(NOT GRIIO_FOUND)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
if(ENABLE_AD9361) if(ENABLE_AD9361)
find_package(libiio REQUIRED) find_package(LIBIIO REQUIRED)
if(NOT LIBIIO_FOUND) if(NOT LIBIIO_FOUND)
message(STATUS "libiio not found, its installation is required.") message(STATUS "libiio not found, its installation is required.")
message(STATUS "Please build and install the following projects:") message(STATUS "Please build and install the following projects:")
@ -64,10 +64,10 @@ if(ENABLE_PLUTOSDR)
############################################## ##############################################
# ADALM-PLUTO (Analog Devices Inc.) # ADALM-PLUTO (Analog Devices Inc.)
############################################## ##############################################
if(IIO_FOUND) if(GRIIO_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} plutosdr_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} plutosdr_signal_source.h)
endif(IIO_FOUND) endif(GRIIO_FOUND)
endif(ENABLE_PLUTOSDR) endif(ENABLE_PLUTOSDR)
@ -75,10 +75,10 @@ if(ENABLE_FMCOMMS2)
############################################### ###############################################
# FMCOMMS2 based SDR Hardware # FMCOMMS2 based SDR Hardware
############################################### ###############################################
if(IIO_FOUND) if(GRIIO_FOUND)
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} fmcomms2_signal_source.cc)
set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h) set(OPT_DRIVER_HEADERS ${OPT_DRIVER_HEADERS} fmcomms2_signal_source.h)
endif(IIO_FOUND) endif(GRIIO_FOUND)
endif(ENABLE_FMCOMMS2) endif(ENABLE_FMCOMMS2)
if(ENABLE_AD9361) if(ENABLE_AD9361)
@ -97,11 +97,11 @@ if(ENABLE_GN3S)
############################################## ##############################################
# GN3S (USB dongle) # GN3S (USB dongle)
############################################## ##############################################
find_package(GrGN3S REQUIRED) find_package(GRGN3S REQUIRED)
if(NOT GR_GN3S_FOUND) if(NOT GRGN3S_FOUND)
message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ") message(" gr-gn3s not found, install it from https://github.com/gnss-sdr/gr-gn3s ")
message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled") message(FATAL_ERROR "gr-gn3s required for building gnss-sdr with this option enabled")
endif(NOT GR_GN3S_FOUND) endif(NOT GRGN3S_FOUND)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES}) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_GN3S_LIBRARIES})
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_GN3S_INCLUDE_DIRS})
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc)
@ -113,7 +113,7 @@ if(ENABLE_FLEXIBAND)
############################################## ##############################################
# TELEORBIT FLEXIBAND FRONTEND ADAPTER # TELEORBIT FLEXIBAND FRONTEND ADAPTER
############################################## ##############################################
find_package(Teleorbit REQUIRED) find_package(TELEORBIT REQUIRED)
if(NOT TELEORBIT_FOUND) if(NOT TELEORBIT_FOUND)
message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter") message(FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter")
endif(NOT TELEORBIT_FOUND) endif(NOT TELEORBIT_FOUND)
@ -134,11 +134,11 @@ if(ENABLE_ARRAY)
############################################## ##############################################
# DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE # DBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
############################################## ##############################################
find_package(GrDbfcttc REQUIRED) find_package(GRDBFCTTC REQUIRED)
if(NOT GR_DBFCTTC_FOUND) if(NOT GRDBFCTTC_FOUND)
message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ") message(" gr-dbfcttc not found, install it from https://github.com/gnss-sdr/gr-dbfcttc ")
message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled") message(FATAL_ERROR "gr-dbfcttc required for building gnss-sdr with this option enabled")
endif(NOT GR_DBFCTTC_FOUND) endif(NOT GRDBFCTTC_FOUND)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES}) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GR_DBFCTTC_LIBRARIES})
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GR_DBFCTTC_INCLUDE_DIRS})
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc) set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc)

View File

@ -17,21 +17,21 @@
# #
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
find_package(Griio REQUIRED) find_package(GRIIO REQUIRED)
if(NOT IIO_FOUND) if(NOT GRIIO_FOUND)
message(STATUS "gnuradio-iio not found, its installation is required.") message(STATUS "gnuradio-iio not found, its installation is required.")
message(STATUS "Please build and install the following projects:") message(STATUS "Please build and install the following projects:")
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio") message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio") message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio") 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") message(FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with this option enabled")
endif(NOT IIO_FOUND) endif(NOT GRIIO_FOUND)
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES}) set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}) set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2) endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
if(ENABLE_FMCOMMS2 OR ENABLE_AD9361) if(ENABLE_FMCOMMS2 OR ENABLE_AD9361)
find_package(libiio REQUIRED) find_package(LIBIIO REQUIRED)
if(NOT LIBIIO_FOUND) if(NOT LIBIIO_FOUND)
message(STATUS "libiio not found, its installation is required.") message(STATUS "libiio not found, its installation is required.")
message(STATUS "Please build and install the following projects:") message(STATUS "Please build and install the following projects:")

View File

@ -877,7 +877,7 @@ bool gnss_sdr_supl_client::read_gal_almanac_from_gsa(const std::string file_name
gal_alm.i_WNa = std::stoi(almanac.child("almanac").child_value("wna")); gal_alm.i_WNa = std::stoi(almanac.child("almanac").child_value("wna"));
gal_alm.i_IODa = std::stoi(almanac.child("almanac").child_value("iod")); gal_alm.i_IODa = std::stoi(almanac.child("almanac").child_value("iod"));
gal_alm.d_Delta_i = std::stod(almanac.child("almanac").child_value("deltai")); gal_alm.d_Delta_i = std::stod(almanac.child("almanac").child_value("deltai"));
gal_alm.d_M_0 = std::stod(almanac.child("almanac").child_value("deltai")); gal_alm.d_M_0 = std::stod(almanac.child("almanac").child_value("m0"));
gal_alm.d_e_eccentricity = std::stod(almanac.child("almanac").child_value("ecc")); gal_alm.d_e_eccentricity = std::stod(almanac.child("almanac").child_value("ecc"));
gal_alm.d_Delta_sqrt_A = std::stod(almanac.child("almanac").child_value("aSqRoot")); gal_alm.d_Delta_sqrt_A = std::stod(almanac.child("almanac").child_value("aSqRoot"));
gal_alm.d_OMEGA0 = std::stod(almanac.child("almanac").child_value("omega0")); gal_alm.d_OMEGA0 = std::stod(almanac.child("almanac").child_value("omega0"));
@ -984,7 +984,7 @@ bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name)
{ {
ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in);
boost::archive::xml_iarchive xml(ifs); boost::archive::xml_iarchive xml(ifs);
xml >> boost::serialization::make_nvp("GNSS-SDR_ref_time_map", this->gps_time); xml >> boost::serialization::make_nvp("GNSS-SDR_ref_time", this->gps_time);
LOG(INFO) << "Loaded Ref Time data"; LOG(INFO) << "Loaded Ref Time data";
} }
catch (std::exception& e) catch (std::exception& e)
@ -996,17 +996,16 @@ bool gnss_sdr_supl_client::load_ref_time_xml(const std::string file_name)
} }
bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, std::map<int, Gps_Ref_Time> ref_time_map) bool gnss_sdr_supl_client::save_ref_time_xml(const std::string file_name, Agnss_Ref_Time& ref_time)
{ {
if (ref_time_map.empty() == false) if (ref_time.valid == true)
{ {
std::ofstream ofs; std::ofstream ofs;
try try
{ {
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs); boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_ref_time_map", ref_time_map); xml << boost::serialization::make_nvp("GNSS-SDR_ref_time", ref_time);
LOG(INFO) << "Saved Ref Time data"; LOG(INFO) << "Saved Ref Time data";
} }
catch (std::exception& e) catch (std::exception& e)
@ -1017,7 +1016,7 @@ bool gnss_sdr_supl_client::save_ref_time_map_xml(const std::string file_name, st
} }
else else
{ {
LOG(WARNING) << "Failed to save Ref Time, map is empty"; LOG(WARNING) << "Failed to save Ref Time";
return false; return false;
} }
return true; return true;
@ -1031,7 +1030,7 @@ bool gnss_sdr_supl_client::load_ref_location_xml(const std::string file_name)
{ {
ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in); ifs.open(file_name.c_str(), std::ifstream::binary | std::ifstream::in);
boost::archive::xml_iarchive xml(ifs); boost::archive::xml_iarchive xml(ifs);
xml >> boost::serialization::make_nvp("GNSS-SDR_ref_location_map", this->gps_ref_loc); xml >> boost::serialization::make_nvp("GNSS-SDR_ref_location", this->gps_ref_loc);
LOG(INFO) << "Loaded Ref Location data"; LOG(INFO) << "Loaded Ref Location data";
} }
catch (std::exception& e) catch (std::exception& e)
@ -1043,16 +1042,16 @@ bool gnss_sdr_supl_client::load_ref_location_xml(const std::string file_name)
} }
bool gnss_sdr_supl_client::save_ref_location_map_xml(const std::string file_name, std::map<int, Gps_Ref_Location> ref_location_map) bool gnss_sdr_supl_client::save_ref_location_xml(const std::string file_name, Agnss_Ref_Location& ref_location)
{ {
if (ref_location_map.empty() == false) if (ref_location.valid == true)
{ {
std::ofstream ofs; std::ofstream ofs;
try try
{ {
ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out); ofs.open(file_name.c_str(), std::ofstream::trunc | std::ofstream::out);
boost::archive::xml_oarchive xml(ofs); boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("GNSS-SDR_ref_location_map", ref_location_map); xml << boost::serialization::make_nvp("GNSS-SDR_ref_location", ref_location);
LOG(INFO) << "Saved Ref Location data"; LOG(INFO) << "Saved Ref Location data";
} }
catch (std::exception& e) catch (std::exception& e)
@ -1063,7 +1062,7 @@ bool gnss_sdr_supl_client::save_ref_location_map_xml(const std::string file_name
} }
else else
{ {
LOG(WARNING) << "Failed to save Ref Location, map is empty"; LOG(WARNING) << "Failed to save Ref Location";
return false; return false;
} }
return true; return true;

View File

@ -38,6 +38,8 @@ extern "C"
{ {
#include "supl.h" #include "supl.h"
} }
#include "agnss_ref_location.h"
#include "agnss_ref_time.h"
#include "GPS_L1_CA.h" #include "GPS_L1_CA.h"
#include "gps_ephemeris.h" #include "gps_ephemeris.h"
#include "gps_iono.h" #include "gps_iono.h"
@ -45,8 +47,6 @@ extern "C"
#include "gps_utc_model.h" #include "gps_utc_model.h"
#include "gps_cnav_utc_model.h" #include "gps_cnav_utc_model.h"
#include "gps_acq_assist.h" #include "gps_acq_assist.h"
#include "gps_ref_time.h"
#include "gps_ref_location.h"
#include "gps_cnav_ephemeris.h" #include "gps_cnav_ephemeris.h"
#include "galileo_ephemeris.h" #include "galileo_ephemeris.h"
#include "galileo_utc_model.h" #include "galileo_utc_model.h"
@ -98,14 +98,14 @@ public:
Gps_Iono gps_iono; Gps_Iono gps_iono;
Galileo_Iono gal_iono; Galileo_Iono gal_iono;
// reference time // reference time
Gps_Ref_Time gps_time; Agnss_Ref_Time gps_time;
// UTC model // UTC model
Gps_Utc_Model gps_utc; Gps_Utc_Model gps_utc;
Galileo_Utc_Model gal_utc; Galileo_Utc_Model gal_utc;
Gps_CNAV_Utc_Model gps_cnav_utc; Gps_CNAV_Utc_Model gps_cnav_utc;
Glonass_Gnav_Utc_Model glo_gnav_utc; Glonass_Gnav_Utc_Model glo_gnav_utc;
// reference location // reference location
Gps_Ref_Location gps_ref_loc; Agnss_Ref_Location gps_ref_loc;
// Acquisition Assistance map // Acquisition Assistance map
std::map<int, Gps_Acq_Assist> gps_acq_map; std::map<int, Gps_Acq_Assist> gps_acq_map;
@ -256,8 +256,8 @@ public:
/*! /*!
* \brief Save ref time map to XML file * \brief Save ref time map to XML file
*/ */
bool save_ref_time_map_xml(const std::string file_name, bool save_ref_time_xml(const std::string file_name,
std::map<int, Gps_Ref_Time> ref_time_map); Agnss_Ref_Time& ref_time_map);
/*! /*!
* \brief Read ref location from XML file * \brief Read ref location from XML file
@ -267,8 +267,8 @@ public:
/*! /*!
* \brief Save ref location map to XML file * \brief Save ref location map to XML file
*/ */
bool save_ref_location_map_xml(std::string file_name, bool save_ref_location_xml(std::string file_name,
std::map<int, Gps_Ref_Location> ref_location_map); Agnss_Ref_Location& ref_location);
/* /*
* Prints SUPL data to std::cout. Use it for debug purposes only. * Prints SUPL data to std::cout. Use it for debug purposes only.

View File

@ -422,7 +422,7 @@ bool ControlThread::read_assistance_from_XML()
if (supl_client_acquisition_.load_ref_time_xml(ref_time_xml_filename) == true) if (supl_client_acquisition_.load_ref_time_xml(ref_time_xml_filename) == true)
{ {
LOG(INFO) << "SUPL: Read XML Ref Time"; LOG(INFO) << "SUPL: Read XML Ref Time";
std::shared_ptr<Gps_Ref_Time> tmp_obj = std::make_shared<Gps_Ref_Time>(supl_client_acquisition_.gps_time); std::shared_ptr<Agnss_Ref_Time> tmp_obj = std::make_shared<Agnss_Ref_Time>(supl_client_acquisition_.gps_time);
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
} }
else else
@ -434,7 +434,7 @@ bool ControlThread::read_assistance_from_XML()
if (supl_client_acquisition_.load_ref_location_xml(ref_location_xml_filename) == true) if (supl_client_acquisition_.load_ref_location_xml(ref_location_xml_filename) == true)
{ {
LOG(INFO) << "SUPL: Read XML Ref Location"; LOG(INFO) << "SUPL: Read XML Ref Location";
std::shared_ptr<Gps_Ref_Location> tmp_obj = std::make_shared<Gps_Ref_Location>(supl_client_acquisition_.gps_ref_loc); std::shared_ptr<Agnss_Ref_Location> tmp_obj = std::make_shared<Agnss_Ref_Location>(supl_client_acquisition_.gps_ref_loc);
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
} }
else else
@ -563,6 +563,7 @@ void ControlThread::assist_GNSS()
std::shared_ptr<Gps_Almanac> tmp_obj = std::make_shared<Gps_Almanac>(gps_alm_iter->second); std::shared_ptr<Gps_Almanac> tmp_obj = std::make_shared<Gps_Almanac>(gps_alm_iter->second);
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
} }
supl_client_ephemeris_.save_gps_almanac_xml("gps_almanac_map.xml", supl_client_ephemeris_.gps_almanac_map);
if (supl_client_ephemeris_.gps_iono.valid == true) if (supl_client_ephemeris_.gps_iono.valid == true)
{ {
std::cout << "SUPL: Received GPS Ionosphere model parameters" << std::endl; std::cout << "SUPL: Received GPS Ionosphere model parameters" << std::endl;
@ -618,14 +619,18 @@ void ControlThread::assist_GNSS()
if (supl_client_acquisition_.gps_ref_loc.valid == true) if (supl_client_acquisition_.gps_ref_loc.valid == true)
{ {
std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)" << std::endl; std::cout << "SUPL: Received Ref Location data (Acquisition Assistance)" << std::endl;
std::shared_ptr<Gps_Ref_Location> tmp_obj = std::make_shared<Gps_Ref_Location>(supl_client_acquisition_.gps_ref_loc); agnss_ref_location_ = supl_client_acquisition_.gps_ref_loc;
std::shared_ptr<Agnss_Ref_Location> tmp_obj = std::make_shared<Agnss_Ref_Location>(agnss_ref_location_);
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
supl_client_acquisition_.save_ref_location_xml("agnss_ref_location.xml", agnss_ref_location_);
} }
if (supl_client_acquisition_.gps_time.valid == true) if (supl_client_acquisition_.gps_time.valid == true)
{ {
std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)" << std::endl; std::cout << "SUPL: Received Ref Time data (Acquisition Assistance)" << std::endl;
std::shared_ptr<Gps_Ref_Time> tmp_obj = std::make_shared<Gps_Ref_Time>(supl_client_acquisition_.gps_time); agnss_ref_time_ = supl_client_acquisition_.gps_time;
std::shared_ptr<Agnss_Ref_Time> tmp_obj = std::make_shared<Agnss_Ref_Time>(agnss_ref_time_);
flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj)); flowgraph_->send_telemetry_msg(pmt::make_any(tmp_obj));
supl_client_acquisition_.save_ref_time_xml("agnss_ref_time.xml", agnss_ref_time_);
} }
} }
else else
@ -645,6 +650,28 @@ void ControlThread::assist_GNSS()
std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl; std::cout << "GNSS assistance data loaded from local XML file(s)." << std::endl;
} }
} }
// If we have enough AGNSS data, make use of it
if (agnss_ref_location_.valid == true) // and agnss_ref_time_.valid == true and we have AGNSS data
{
// Get the list of visible satellites
arma::vec ref_LLH = arma::zeros(3, 1);
ref_LLH(0) = agnss_ref_location_.lat;
ref_LLH(1) = agnss_ref_location_.lon;
time_t ref_rx_utc_time = 0;
if (agnss_ref_time_.valid == true)
{
ref_rx_utc_time = agnss_ref_time_.d_tv_sec;
}
std::vector<std::pair<int, Gnss_Satellite>> visible_sats = get_visible_sats(ref_rx_utc_time, ref_LLH);
// Set the receiver in Standby mode
flowgraph_->apply_action(0, 10);
// Give priority to visible satellites in the search list
flowgraph_->priorize_satellites(visible_sats);
// Hot Start
flowgraph_->apply_action(0, 12);
}
} }
@ -670,6 +697,45 @@ void ControlThread::init()
supl_lac = 0; supl_lac = 0;
supl_ci = 0; supl_ci = 0;
msqid = -1; msqid = -1;
agnss_ref_location_ = Agnss_Ref_Location();
agnss_ref_time_ = Agnss_Ref_Time();
std::string empty_string = "";
std::string ref_location_str = configuration_->property("GNSS-SDR.AGNSS_ref_location", empty_string);
std::string ref_time_str = configuration_->property("GNSS-SDR.AGNSS_ref_utc_time", empty_string);
if (ref_location_str.compare(empty_string) != 0)
{
std::vector<double> vect;
std::stringstream ss(ref_location_str);
double d;
while (ss >> d)
{
vect.push_back(d);
if (ss.peek() == ',')
ss.ignore();
}
// fill agnss_ref_location_
if (vect.size() >= 2)
{
agnss_ref_location_.lat = vect[0];
agnss_ref_location_.lon = vect[1];
agnss_ref_location_.valid = true;
}
}
if (ref_time_str.compare(empty_string) == 0)
{
// Make an educated guess
time_t rawtime;
time(&rawtime);
agnss_ref_time_.d_tv_sec = rawtime;
agnss_ref_time_.valid = true;
}
else
{
// fill agnss_ref_time_
agnss_ref_time_.d_tv_sec = 0; // fill
agnss_ref_time_.valid = true;
}
} }
@ -744,7 +810,7 @@ void ControlThread::apply_action(unsigned int what)
visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); visible_satellites = get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH());
//reorder the satellite queue to acquire first those visible satellites //reorder the satellite queue to acquire first those visible satellites
flowgraph_->priorize_satellites(visible_satellites); flowgraph_->priorize_satellites(visible_satellites);
//start again the satellite acquisitions (done in chained applyaction to flowgraph) //start again the satellite acquisitions (done in chained apply_action to flowgraph)
break; break;
case 13: case 13:
LOG(INFO) << "Receiver action WARMSTART"; LOG(INFO) << "Receiver action WARMSTART";
@ -754,11 +820,11 @@ void ControlThread::apply_action(unsigned int what)
//load the ephemeris and the almanac from XML files (receiver assistance) //load the ephemeris and the almanac from XML files (receiver assistance)
read_assistance_from_XML(); read_assistance_from_XML();
//call here the function that computes the set of visible satellites and its elevation //call here the function that computes the set of visible satellites and its elevation
//for the date and time specified by the warmstart command and the assisted position //for the date and time specified by the warm start command and the assisted position
get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH()); get_visible_sats(cmd_interface_.get_utc_time(), cmd_interface_.get_LLH());
//reorder the satellite queue to acquire first those visible satellites //reorder the satellite queue to acquire first those visible satellites
flowgraph_->priorize_satellites(visible_satellites); flowgraph_->priorize_satellites(visible_satellites);
//start again the satellite acquisitions (done in chained applyaction to flowgraph) //start again the satellite acquisitions (done in chained apply_action to flowgraph)
break; break;
default: default:
LOG(INFO) << "Unrecognized action."; LOG(INFO) << "Unrecognized action.";
@ -872,11 +938,10 @@ std::vector<std::pair<int, Gnss_Satellite>> ControlThread::get_visible_sats(time
arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]}; arma::vec r_sat_eb_e = arma::vec{r_sat[0], r_sat[1], r_sat[2]};
arma::vec dx = r_sat_eb_e - r_eb_e; arma::vec dx = r_sat_eb_e - r_eb_e;
topocent(&Az, &El, &dist_m, r_eb_e, dx); topocent(&Az, &El, &dist_m, r_eb_e, dx);
std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl;
// push sat // push sat
if (El > 0) if (El > 0)
{ {
std::cout << "Using GPS Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl; std::cout << "Using Galileo Almanac: Sat " << it->second.i_satellite_PRN << " Az: " << Az << " El: " << El << std::endl;
available_satellites.push_back(std::pair<int, Gnss_Satellite>(floor(El), available_satellites.push_back(std::pair<int, Gnss_Satellite>(floor(El),
(Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN)))); (Gnss_Satellite(std::string("Galileo"), it->second.i_satellite_PRN))));
} }

View File

@ -41,6 +41,8 @@
#include "tcp_cmd_interface.h" #include "tcp_cmd_interface.h"
#include "gnss_flowgraph.h" #include "gnss_flowgraph.h"
#include "configuration_interface.h" #include "configuration_interface.h"
#include "agnss_ref_location.h"
#include "agnss_ref_time.h"
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <gnuradio/msg_queue.h> #include <gnuradio/msg_queue.h>
#include <memory> #include <memory>
@ -189,6 +191,9 @@ private:
const std::string glo_utc_default_xml_filename = "./glo_utc_model.xml"; const std::string glo_utc_default_xml_filename = "./glo_utc_model.xml";
const std::string gal_almanac_default_xml_filename = "./gal_almanac.xml"; const std::string gal_almanac_default_xml_filename = "./gal_almanac.xml";
const std::string gps_almanac_default_xml_filename = "./gps_almanac.xml"; const std::string gps_almanac_default_xml_filename = "./gps_almanac.xml";
Agnss_Ref_Location agnss_ref_location_;
Agnss_Ref_Time agnss_ref_time_;
}; };
#endif /*GNSS_SDR_CONTROL_THREAD_H_*/ #endif /*GNSS_SDR_CONTROL_THREAD_H_*/

View File

@ -1046,8 +1046,8 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
} }
} }
break; break;
case 10: //request stanby mode case 10: // request standby mode
LOG(INFO) << "TC request stanby mode"; LOG(INFO) << "TC request standby mode";
for (size_t n = 0; n < channels_.size(); n++) for (size_t n = 0; n < channels_.size(); n++)
{ {
if (channels_state_[n] == 1 or channels_state_[n] == 2) //channel in acquisition or in tracking if (channels_state_[n] == 1 or channels_state_[n] == 2) //channel in acquisition or in tracking
@ -1100,9 +1100,9 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
channels_state_[n] = 0; channels_state_[n] = 0;
} }
} }
acq_channels_count_ = 0; //all channels are in stanby now acq_channels_count_ = 0; // all channels are in standby now
break; break;
case 11: //request coldstart mode case 11: // request coldstart mode
LOG(INFO) << "TC request flowgraph coldstart"; LOG(INFO) << "TC request flowgraph coldstart";
//start again the satellite acquisitions //start again the satellite acquisitions
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)
@ -1131,7 +1131,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
} }
break; break;
case 12: //request hotstart mode case 12: // request hotstart mode
LOG(INFO) << "TC request flowgraph hotstart"; LOG(INFO) << "TC request flowgraph hotstart";
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)
{ {
@ -1159,7 +1159,7 @@ void GNSSFlowgraph::apply_action(unsigned int who, unsigned int what)
DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index]; DLOG(INFO) << "Channel " << ch_index << " in state " << channels_state_[ch_index];
} }
break; break;
case 13: //request warmstart mode case 13: // request warmstart mode
LOG(INFO) << "TC request flowgraph warmstart"; LOG(INFO) << "TC request flowgraph warmstart";
//start again the satellite acquisitions //start again the satellite acquisitions
for (unsigned int i = 0; i < channels_count_; i++) for (unsigned int i = 0; i < channels_count_; i++)

View File

@ -39,16 +39,21 @@ void TcpCmdInterface::set_pvt(std::shared_ptr<PvtInterface> PVT_sptr)
{ {
PVT_sptr_ = PVT_sptr; PVT_sptr_ = PVT_sptr;
} }
time_t TcpCmdInterface::get_utc_time() time_t TcpCmdInterface::get_utc_time()
{ {
return receiver_utc_time_; return receiver_utc_time_;
} }
arma::vec TcpCmdInterface::get_LLH() arma::vec TcpCmdInterface::get_LLH()
{ {
return arma::vec{rx_latitude_, rx_longitude_, rx_altitude_}; return arma::vec{rx_latitude_, rx_longitude_, rx_altitude_};
} }
std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine)
std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
@ -65,7 +70,8 @@ std::string TcpCmdInterface::reset(const std::vector<std::string> &commandLine)
return response; return response;
} }
std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine)
std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
@ -81,7 +87,8 @@ std::string TcpCmdInterface::standby(const std::vector<std::string> &commandLine
return response; return response;
} }
std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine)
std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::stringstream str_stream; std::stringstream str_stream;
//todo: implement the receiver status report //todo: implement the receiver status report
@ -130,18 +137,18 @@ std::string TcpCmdInterface::status(const std::vector<std::string> &commandLine)
return str_stream.str(); return str_stream.str();
} }
std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLine) std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLine)
{ {
std::string response; std::string response;
if (commandLine.size() > 5) if (commandLine.size() > 5)
{ {
//read commandline time parameter // Read commandline time parameter
struct tm tm; struct tm tm;
strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm); strptime(commandLine.at(1).c_str(), "%d/%m/%Y %H:%M:%S", &tm);
receiver_utc_time_ = timegm(&tm); receiver_utc_time_ = timegm(&tm);
// Read latitude, longitude, and height
//read latitude, longitude, and height
rx_latitude_ = std::stod(commandLine.at(3).c_str()); rx_latitude_ = std::stod(commandLine.at(3).c_str());
rx_longitude_ = std::stod(commandLine.at(4).c_str()); rx_longitude_ = std::stod(commandLine.at(4).c_str());
rx_altitude_ = std::stod(commandLine.at(5).c_str()); rx_altitude_ = std::stod(commandLine.at(5).c_str());
@ -166,24 +173,25 @@ std::string TcpCmdInterface::hotstart(const std::vector<std::string> &commandLin
} }
else else
{ {
response = "ERROR: time parameter not found, please use hotstart %d/%m/%Y %H:%M:%S\n"; response = "ERROR: time parameter not found, please use hotstart %d/%m/%Y %H:%M:%S Lat Long H\n";
} }
return response; return response;
} }
std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLine) std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLine)
{ {
std::string response; std::string response;
if (commandLine.size() > 5) if (commandLine.size() > 5)
{ {
std::string tmp_str; std::string tmp_str;
//read commandline time parameter // Read commandline time parameter
struct tm tm; struct tm tm;
tmp_str = commandLine.at(1) + commandLine.at(2); tmp_str = commandLine.at(1) + commandLine.at(2);
strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm); strptime(tmp_str.c_str(), "%d/%m/%Y %H:%M:%S", &tm);
receiver_utc_time_ = timegm(&tm); receiver_utc_time_ = timegm(&tm);
//read latitude, longitude, and height // Read latitude, longitude, and height
rx_latitude_ = std::stod(commandLine.at(3).c_str()); rx_latitude_ = std::stod(commandLine.at(3).c_str());
rx_longitude_ = std::stod(commandLine.at(4).c_str()); rx_longitude_ = std::stod(commandLine.at(4).c_str());
rx_altitude_ = std::stod(commandLine.at(5).c_str()); rx_altitude_ = std::stod(commandLine.at(5).c_str());
@ -196,7 +204,7 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) if (control_queue_ != nullptr)
{ {
control_queue_->handle(cmf->GetQueueMessage(300, 13)); //send the standby message (who=300,what=13) control_queue_->handle(cmf->GetQueueMessage(300, 13)); // send the warmstart message (who=300,what=13)
response = "OK\n"; response = "OK\n";
} }
else else
@ -213,13 +221,13 @@ std::string TcpCmdInterface::warmstart(const std::vector<std::string> &commandLi
} }
std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine) std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory()); std::unique_ptr<ControlMessageFactory> cmf(new ControlMessageFactory());
if (control_queue_ != nullptr) if (control_queue_ != nullptr)
{ {
control_queue_->handle(cmf->GetQueueMessage(300, 11)); //send the standby message (who=300,what=11) control_queue_->handle(cmf->GetQueueMessage(300, 11)); // send the coldstart message (who=300,what=11)
response = "OK\n"; response = "OK\n";
} }
else else
@ -229,7 +237,8 @@ std::string TcpCmdInterface::coldstart(const std::vector<std::string> &commandLi
return response; return response;
} }
std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &commandLine)
std::string TcpCmdInterface::set_ch_satellite(const std::vector<std::string> &commandLine __attribute__((unused)))
{ {
std::string response; std::string response;
//todo: implement the set satellite command //todo: implement the set satellite command
@ -266,6 +275,8 @@ void TcpCmdInterface::set_msg_queue(gr::msg_queue::sptr control_queue)
{ {
control_queue_ = control_queue; control_queue_ = control_queue;
} }
void TcpCmdInterface::run_cmd_server(int tcp_port) void TcpCmdInterface::run_cmd_server(int tcp_port)
{ {
// Get the port from the parameters // Get the port from the parameters
@ -315,7 +326,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port)
if (cmd_vector.at(0).compare("exit") == 0) if (cmd_vector.at(0).compare("exit") == 0)
{ {
error = boost::asio::error::eof; error = boost::asio::error::eof;
//send cmd response // send cmd response
socket.write_some(boost::asio::buffer("OK\n"), not_throw); socket.write_some(boost::asio::buffer("OK\n"), not_throw);
} }
else else
@ -337,7 +348,7 @@ void TcpCmdInterface::run_cmd_server(int tcp_port)
response = "ERROR: empty command\n"; response = "ERROR: empty command\n";
} }
//send cmd response // send cmd response
socket.write_some(boost::asio::buffer(response), not_throw); socket.write_some(boost::asio::buffer(response), not_throw);
if (not_throw) if (not_throw)
{ {

View File

@ -44,7 +44,7 @@
#include <gnuradio/message.h> #include <gnuradio/message.h>
#include <gnuradio/msg_queue.h> #include <gnuradio/msg_queue.h>
#include <armadillo> #include <armadillo>
#include <time.h> #include <ctime>
class TcpCmdInterface class TcpCmdInterface
{ {

View File

@ -25,8 +25,8 @@ set(SYSTEM_PARAMETERS_SOURCES
gps_almanac.cc gps_almanac.cc
gps_utc_model.cc gps_utc_model.cc
gps_acq_assist.cc gps_acq_assist.cc
gps_ref_time.cc agnss_ref_time.cc
gps_ref_location.cc agnss_ref_location.cc
galileo_utc_model.cc galileo_utc_model.cc
galileo_ephemeris.cc galileo_ephemeris.cc
galileo_almanac.cc galileo_almanac.cc
@ -55,8 +55,8 @@ set(SYSTEM_PARAMETERS_HEADERS
gps_almanac.h gps_almanac.h
gps_utc_model.h gps_utc_model.h
gps_acq_assist.h gps_acq_assist.h
gps_ref_time.h agnss_ref_time.h
gps_ref_location.h agnss_ref_location.h
galileo_utc_model.h galileo_utc_model.h
galileo_ephemeris.h galileo_ephemeris.h
galileo_almanac.h galileo_almanac.h

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gps_ref_location.cc * \file agnss_ref_location.cc
* \brief Interface of a GPS REFERENCE LOCATION storage * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage
* *
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
@ -29,9 +29,9 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "gps_ref_location.h" #include "agnss_ref_location.h"
Gps_Ref_Location::Gps_Ref_Location() Agnss_Ref_Location::Agnss_Ref_Location()
{ {
valid = false; valid = false;
lat = 0.0; lat = 0.0;

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gps_ref_location.h * \file agnss_ref_location.h
* \brief Interface of a GPS REFERENCE LOCATION storage * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
@ -29,18 +29,18 @@
*/ */
#ifndef GNSS_SDR_GPS_REF_LOCATION_H_ #ifndef GNSS_SDR_AGNSS_REF_LOCATION_H_
#define GNSS_SDR_GPS_REF_LOCATION_H_ #define GNSS_SDR_AGNSS_REF_LOCATION_H_
#include <boost/assign.hpp> #include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
/*! /*!
* \brief Interface of a GPS REFERENCE LOCATION storage * \brief Interface of an Assisted GNSS REFERENCE LOCATION storage
* *
*/ */
class Gps_Ref_Location class Agnss_Ref_Location
{ {
public: public:
bool valid; bool valid;
@ -50,7 +50,7 @@ public:
/*! /*!
* Default constructor * Default constructor
*/ */
Gps_Ref_Location(); Agnss_Ref_Location();
template <class Archive> template <class Archive>

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gps_ref_time.cc * \file agnss_ref_time.cc
* \brief Interface of a GPS REFERENCE TIME storage * \brief Interface of an Assisted GNSS REFERENCE TIME storage
* *
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
@ -29,9 +29,9 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "gps_ref_time.h" #include "agnss_ref_time.h"
Gps_Ref_Time::Gps_Ref_Time() Agnss_Ref_Time::Agnss_Ref_Time()
{ {
valid = false; valid = false;
d_TOW = 0.0; d_TOW = 0.0;

View File

@ -1,6 +1,6 @@
/*! /*!
* \file gps_ref_time.h * \file agnss_ref_time.h
* \brief Interface of a GPS REFERENCE TIME storage * \brief Interface of an Assisted GNSS REFERENCE TIME storage
* \author Javier Arribas, 2013. jarribas(at)cttc.es * \author Javier Arribas, 2013. jarribas(at)cttc.es
* *
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
@ -29,18 +29,18 @@
*/ */
#ifndef GNSS_SDR_GPS_REF_TIME_H_ #ifndef GNSS_SDR_AGNSS_REF_TIME_H_
#define GNSS_SDR_GPS_REF_TIME_H_ #define GNSS_SDR_AGNSS_REF_TIME_H_
#include <boost/assign.hpp> #include <boost/assign.hpp>
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
/*! /*!
* \brief Interface of a GPS REFERENCE TIME storage * \brief Interface of an Assisted GNSS REFERENCE TIME storage
* *
*/ */
class Gps_Ref_Time class Agnss_Ref_Time
{ {
public: public:
bool valid; bool valid;
@ -51,7 +51,7 @@ public:
/*! /*!
* Default constructor * Default constructor
*/ */
Gps_Ref_Time(); Agnss_Ref_Time();
template <class Archive> template <class Archive>

View File

@ -119,30 +119,54 @@ public:
*/ */
inline void serialize(Archive& archive, const uint32_t version) inline void serialize(Archive& archive, const uint32_t version)
{ {
using boost::serialization::make_nvp;
if (version) if (version)
{ {
}; };
archive& make_nvp("i_satellite_PRN", i_satellite_PRN);
archive& make_nvp("M0_1", M0_1); archive& BOOST_SERIALIZATION_NVP(flag_all_ephemeris);
archive& make_nvp("e_1", e_1); archive& BOOST_SERIALIZATION_NVP(IOD_ephemeris);
archive& make_nvp("A_1", A_1); archive& BOOST_SERIALIZATION_NVP(IOD_nav_1);
archive& make_nvp("OMEGA_0_2", OMEGA_0_2); archive& BOOST_SERIALIZATION_NVP(SV_ID_PRN_4);
archive& make_nvp("i_0_2", i_0_2);
archive& make_nvp("omega_2", omega_2); archive& BOOST_SERIALIZATION_NVP(M0_1);
archive& make_nvp("OMEGA_dot_3", OMEGA_dot_3); archive& BOOST_SERIALIZATION_NVP(delta_n_3);
archive& make_nvp("iDot_2", iDot_2); archive& BOOST_SERIALIZATION_NVP(e_1);
archive& make_nvp("C_uc_3", C_uc_3); archive& BOOST_SERIALIZATION_NVP(A_1);
archive& make_nvp("C_us_3", C_us_3); archive& BOOST_SERIALIZATION_NVP(OMEGA_0_2);
archive& make_nvp("C_rc_3", C_rc_3); archive& BOOST_SERIALIZATION_NVP(i_0_2);
archive& make_nvp("C_rs_3", C_rs_3); archive& BOOST_SERIALIZATION_NVP(omega_2);
archive& make_nvp("C_ic_4", C_ic_4); archive& BOOST_SERIALIZATION_NVP(OMEGA_dot_3);
archive& make_nvp("C_is_4", C_is_4); archive& BOOST_SERIALIZATION_NVP(iDot_2);
archive& make_nvp("t0e_1", t0e_1); archive& BOOST_SERIALIZATION_NVP(C_uc_3);
archive& make_nvp("t0c_4", t0c_4); archive& BOOST_SERIALIZATION_NVP(C_us_3);
archive& make_nvp("af0_4", af0_4); archive& BOOST_SERIALIZATION_NVP(C_rc_3);
archive& make_nvp("af1_4", af1_4); archive& BOOST_SERIALIZATION_NVP(C_rs_3);
archive& make_nvp("af2_4", af2_4); archive& BOOST_SERIALIZATION_NVP(C_ic_4);
archive& BOOST_SERIALIZATION_NVP(C_is_4);
archive& BOOST_SERIALIZATION_NVP(t0e_1);
archive& BOOST_SERIALIZATION_NVP(t0c_4);
archive& BOOST_SERIALIZATION_NVP(af0_4);
archive& BOOST_SERIALIZATION_NVP(af1_4);
archive& BOOST_SERIALIZATION_NVP(af2_4);
archive& BOOST_SERIALIZATION_NVP(WN_5);
archive& BOOST_SERIALIZATION_NVP(TOW_5);
archive& BOOST_SERIALIZATION_NVP(Galileo_satClkDrift);
archive& BOOST_SERIALIZATION_NVP(Galileo_dtr);
archive& BOOST_SERIALIZATION_NVP(SISA_3);
archive& BOOST_SERIALIZATION_NVP(E5a_HS);
archive& BOOST_SERIALIZATION_NVP(E5b_HS_5);
archive& BOOST_SERIALIZATION_NVP(E1B_HS_5);
archive& BOOST_SERIALIZATION_NVP(E5a_DVS);
archive& BOOST_SERIALIZATION_NVP(E5b_DVS_5);
archive& BOOST_SERIALIZATION_NVP(E1B_DVS_5);
archive& BOOST_SERIALIZATION_NVP(BGD_E1E5a_5);
archive& BOOST_SERIALIZATION_NVP(BGD_E1E5b_5);
archive& BOOST_SERIALIZATION_NVP(i_satellite_PRN);
} }
}; };

View File

@ -190,12 +190,12 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
else(ENABLE_FPGA) else(ENABLE_FPGA)
set(CROSS_INSTALL_DIR "") set(CROSS_INSTALL_DIR "")
endif(ENABLE_FPGA) endif(ENABLE_FPGA)
find_package(GnssSimulator QUIET) find_package(GNSSSIMULATOR QUIET)
if(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) if(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL)
add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}") add_definitions(-DSW_GENERATOR_BIN="${SW_GENERATOR_BIN}")
add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/brdc3540.14n")
add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_INSTALL_PREFIX}/share/gnss-sim/circle.csv")
else(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) else(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL)
ExternalProject_Add( ExternalProject_Add(
gnss-sim gnss-sim
GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator GIT_REPOSITORY https://bitbucket.org/jarribas/gnss-simulator
@ -221,7 +221,7 @@ if(ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA)
add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n") add_definitions(-DDEFAULT_RINEX_NAV="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/brdc3540.14n")
add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv") add_definitions(-DDEFAULT_POSITION_FILE="${CMAKE_CURRENT_BINARY_DIR}/../../../thirdparty/gnss-sim/circle.csv")
endif(ENABLE_INSTALL_TESTS) endif(ENABLE_INSTALL_TESTS)
endif(GNSS-SIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL) endif(GNSSSIMULATOR_FOUND OR NOT ENABLE_GNSS_SIM_INSTALL)
################################################################################ ################################################################################
# Local installation of GPSTk http://www.gpstk.org/ # Local installation of GPSTk http://www.gpstk.org/

View File

@ -29,6 +29,8 @@
* ------------------------------------------------------------------------- * -------------------------------------------------------------------------
*/ */
#include "agnss_ref_location.h"
#include "agnss_ref_time.h"
#include "concurrent_queue.h" #include "concurrent_queue.h"
#include "concurrent_map.h" #include "concurrent_map.h"
#include "gps_navigation_message.h" #include "gps_navigation_message.h"
@ -36,8 +38,6 @@
#include "gps_cnav_ephemeris.h" #include "gps_cnav_ephemeris.h"
#include "gps_cnav_iono.h" #include "gps_cnav_iono.h"
#include "gps_acq_assist.h" #include "gps_acq_assist.h"
#include "gps_ref_location.h"
#include "gps_ref_time.h"
#include "galileo_navigation_message.h" #include "galileo_navigation_message.h"
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>