Update to modern CMake usage

This commit is contained in:
Carles Fernandez
2019-02-03 19:24:44 +01:00
parent f3eef2f513
commit 8ae72fe458
72 changed files with 1387 additions and 1258 deletions
+20 -22
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -18,10 +18,6 @@
add_subdirectory(supl)
if(OPENSSL_FOUND)
add_definitions(-DUSE_OPENSSL_FALLBACK=1)
endif()
set(CORE_LIBS_SOURCES
ini.cc
INIReader.cc
@@ -36,25 +32,27 @@ set(CORE_LIBS_HEADERS
gnss_sdr_supl_client.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/libs/supl
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${PUGIXML_INCLUDE_DIR}
)
list(SORT CORE_LIBS_HEADERS)
list(SORT CORE_LIBS_SOURCES)
add_library(rx_core_lib ${CORE_LIBS_SOURCES} ${CORE_LIBS_HEADERS})
source_group(Headers FILES ${CORE_LIBS_HEADERS})
target_link_libraries(rx_core_lib supl_library ${PUGIXML_LIBRARY})
if(PUGIXML_LOCAL)
add_dependencies(rx_core_lib pugixml-${GNSSSDR_PUGIXML_LOCAL_VERSION})
endif()
source_group(Headers FILES ${CORE_LIBS_HEADERS})
target_link_libraries(rx_core_lib
PUBLIC
supl_library
gnss_system_parameters
Boost::boost
Glog::glog
PRIVATE
Boost::serialization
Pugixml::pugixml
Gflags::gflags
)
set_property(TARGET rx_core_lib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/interfaces>
)
+18 -15
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -25,25 +25,28 @@ set(SUPL_SOURCES
supl.c
)
if(OPENSSL_FOUND)
add_definitions(-DUSE_OPENSSL_FALLBACK=1)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/libs/supl
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
${GNUTLS_INCLUDE_DIR}
)
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
if(CMAKE_BUILD_TYPE MATCHES "Release")
set(MY_C_FLAGS "${MY_C_FLAGS} -Wno-parentheses-equality")
endif()
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}")
add_library(supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES})
target_link_libraries(supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters)
set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C)
target_link_libraries(supl_library
PUBLIC
${GNUTLS_LIBRARIES}
${GNUTLS_OPENSSL_LIBRARY}
gnss_system_parameters
)
set_target_properties(supl_library PROPERTIES
LINKER_LANGUAGE C
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl;${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp;${GNUTLS_INCLUDE_DIR}"
)
if(OPENSSL_FOUND)
target_compile_definitions(supl_library PUBLIC -DUSE_OPENSSL_FALLBACK=1)
endif()
+13 -12
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -27,15 +27,6 @@ set(CORE_MONITOR_LIBS_HEADERS
gnss_synchro_udp_sink.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
list(SORT CORE_MONITOR_LIBS_HEADERS)
list(SORT CORE_MONITOR_LIBS_SOURCES)
@@ -46,6 +37,16 @@ add_library(core_monitor_lib
source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS})
target_link_libraries(core_monitor_lib ${Boost_LIBRARIES})
target_link_libraries(core_monitor_lib
PUBLIC
Boost::serialization
gnss_system_parameters
Gnuradio::runtime
PRIVATE
Glog::glog
)
add_dependencies(core_monitor_lib glog-${glog_RELEASE})
set_property(TARGET core_monitor_lib
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
+104 -135
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -40,137 +40,31 @@ set(GNSS_RECEIVER_HEADERS
control_message.h
)
if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3)
add_definitions(-DMODERN_GNURADIO=1)
endif()
if(ENABLE_CUDA)
add_definitions(-DCUDA_GPU_ACCEL=1)
set(OPT_RECEIVER_INCLUDE_DIRS
${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}
)
endif()
if(ENABLE_FPGA)
add_definitions(-DENABLE_FPGA=1)
endif()
if(ENABLE_RAW_UDP)
add_definitions(-DRAW_UDP=1)
endif()
if(Boost_VERSION LESS 105000)
add_definitions(-DOLD_BOOST=1)
endif()
if(OPENSSL_FOUND)
add_definitions(-DUSE_OPENSSL_FALLBACK=1)
endif()
if(ENABLE_GN3S)
add_definitions(-DGN3S_DRIVER=1)
endif()
if(ENABLE_ARRAY)
add_definitions(-DRAW_ARRAY_DRIVER=1)
endif()
if(ENABLE_FLEXIBAND)
add_definitions(-DFLEXIBAND_DRIVER=1)
endif()
if(ENABLE_OSMOSDR)
if(GROSMOSDR_FOUND)
add_definitions(-DOSMOSDR_DRIVER=1)
endif()
endif()
if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
add_definitions(-DUHD_DRIVER=1)
endif()
#Enable OpenCL if found in the system
if(OPENCL_FOUND)
message(STATUS "Adding processing blocks implemented using OpenCL")
add_definitions(-DOPENCL_BLOCKS=1)
else()
add_definitions(-DOPENCL_BLOCKS=0)
endif()
#enable SDR Hardware based on fmcomms2
if(ENABLE_PLUTOSDR)
add_definitions(-DPLUTOSDR_DRIVER=1)
set(OPT_RECEIVER_INCLUDE_DIRS
${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}
)
endif()
if(ENABLE_FMCOMMS2)
add_definitions(-DFMCOMMS2_DRIVER=1)
set(OPT_RECEIVER_INCLUDE_DIRS
${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}
)
endif()
if(ENABLE_AD9361)
add_definitions(-DAD9361_DRIVER=1)
set(OPT_RECEIVER_INCLUDE_DIRS
${OPT_RECEIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS}
)
endif()
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4")
add_definitions(-DGR_GREATER_38=1)
if(ENABLE_CUDA)
set(OPT_RECEIVER_INCLUDE_DIRS
${OPT_RECEIVER_INCLUDE_DIRS} ${CUDA_INCLUDE_DIRS}
)
endif()
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/system_parameters
${CMAKE_SOURCE_DIR}/src/core/interfaces
${CMAKE_SOURCE_DIR}/src/core/libs
${CMAKE_SOURCE_DIR}/src/core/libs/supl
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
${CMAKE_SOURCE_DIR}/src/core/monitor
${CMAKE_SOURCE_DIR}/src/algorithms/libs
${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/libs
${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/channel/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/channel/libs
${CMAKE_SOURCE_DIR}/src/algorithms/conditioner/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/data_type_adapter/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/resampler/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/input_filter/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/libs
${CMAKE_SOURCE_DIR}/src/algorithms/tracking/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/tracking/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/tracking/libs
${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs
${CMAKE_SOURCE_DIR}/src/algorithms/telemetry_decoder/libs/libswiftcnav
${CMAKE_SOURCE_DIR}/src/algorithms/observables/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/observables/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/adapters
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/gnuradio_blocks
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${ARMADILLO_INCLUDE_DIRS}
${GLOG_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GNURADIO_RUNTIME_INCLUDE_DIRS}
${PUGIXML_INCLUDE_DIR}
${OPT_RECEIVER_INCLUDE_DIRS}
${VOLK_GNSSSDR_INCLUDE_DIRS}
)
list(SORT GNSS_RECEIVER_HEADERS)
list(SORT GNSS_RECEIVER_SOURCES)
@@ -196,29 +90,104 @@ add_library(gnss_rx
source_group(Headers FILES ${GNSS_RECEIVER_HEADERS}
${GNSS_RECEIVER_INTERFACE_HEADERS})
if(ENABLE_FPGA)
target_compile_definitions(gnss_rx PUBLIC -DENABLE_FPGA=1)
endif()
if(ENABLE_RAW_UDP)
target_compile_definitions(gnss_rx PUBLIC -DRAW_UDP=1)
endif()
if(Boost_VERSION LESS 105000)
target_compile_definitions(gnss_rx PUBLIC -DOLD_BOOST=1)
endif()
if(OPENSSL_FOUND)
target_compile_definitions(gnss_rx PUBLIC -DUSE_OPENSSL_FALLBACK=1)
endif()
if(PC_GNURADIO_RUNTIME_VERSION VERSION_GREATER 3.7.3)
target_compile_definitions(gnss_rx PUBLIC -DMODERN_GNURADIO=1)
endif()
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13.4")
target_compile_definitions(gnss_rx PUBLIC -DGR_GREATER_38=1)
endif()
if(ENABLE_UHD AND GNURADIO_UHD_LIBRARIES_gnuradio-uhd)
target_compile_definitions(gnss_rx PUBLIC -DUHD_DRIVER=1)
endif()
if(ENABLE_PLUTOSDR)
target_compile_definitions(gnss_rx PUBLIC -DPLUTOSDR_DRIVER=1)
endif()
if(ENABLE_FMCOMMS2)
target_compile_definitions(gnss_rx PUBLIC -DFMCOMMS2_DRIVER=1)
endif()
if(ENABLE_AD9361)
target_compile_definitions(gnss_rx PUBLIC -DAD9361_DRIVER=1)
endif()
if(ENABLE_OSMOSDR)
if(GROSMOSDR_FOUND)
target_compile_definitions(gnss_rx PUBLIC -DOSMOSDR_DRIVER=1)
endif()
endif()
if(ENABLE_GN3S)
target_compile_definitions(gnss_rx PUBLIC -DGN3S_DRIVER=1)
endif()
if(ENABLE_ARRAY)
target_compile_definitions(gnss_rx PUBLIC -DRAW_ARRAY_DRIVER=1)
endif()
if(ENABLE_FLEXIBAND)
target_compile_definitions(gnss_rx PUBLIC -DFLEXIBAND_DRIVER=1)
endif()
if(OPENCL_FOUND)
message(STATUS "Adding processing blocks implemented using OpenCL")
target_compile_definitions(gnss_rx PUBLIC -DOPENCL_BLOCKS=1)
else()
target_compile_definitions(gnss_rx PUBLIC -DOPENCL_BLOCKS=0)
endif()
if(ENABLE_CUDA)
target_compile_definitions(gnss_rx PUBLIC -DCUDA_GPU_ACCEL=1)
endif()
target_link_libraries(gnss_rx
${Boost_LIBRARIES}
${ARMADILLO_LIBRARIES}
${GNURADIO_RUNTIME_LIBRARIES}
${GNURADIO_BLOCKS_LIBRARIES}
${GNURADIO_FFT_LIBRARIES}
${GNURADIO_FILTER_LIBRARIES}
gnss_system_parameters
gnss_sp_libs
signal_source_adapters
datatype_adapters
input_filter_adapters
conditioner_adapters
resampler_adapters
acq_adapters
tracking_adapters
channel_adapters
telemetry_decoder_libswiftcnav
telemetry_decoder_lib
telemetry_decoder_adapters
obs_adapters
pvt_adapters
pvt_lib
rx_core_lib
core_monitor_lib
PUBLIC
Boost::boost
Boost::thread
Gnuradio::runtime
gnss_system_parameters
rx_core_lib
core_monitor_lib
gnss_sp_libs
PRIVATE
Glog::glog
signal_source_adapters
datatype_adapters
input_filter_adapters
conditioner_adapters
resampler_adapters
acq_adapters
tracking_adapters
channel_adapters
telemetry_decoder_adapters
obs_adapters
pvt_adapters
Volkgnsssdr::volkgnsssdr
)
set_property(TARGET gnss_rx APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/receiver>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/core/interfaces>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/algorithms/libs>
$<BUILD_INTERFACE:${OPT_RECEIVER_INCLUDE_DIRS}>
)
+2 -1
View File
@@ -289,7 +289,8 @@ void GNSSFlowgraph::connect()
std::cout << "Set GNSS-SDR.internal_fs_sps in configuration file" << std::endl;
throw(std::invalid_argument("Set GNSS-SDR.internal_fs_sps in configuration"));
}
ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0));
int observable_interval_ms = static_cast<double>(configuration_->property("GNSS-SDR.observable_interval_ms", 20));
ch_out_sample_counter = gnss_sdr_make_sample_counter(fs, observable_interval_ms, sig_conditioner_.at(0)->get_right_block()->output_signature()->sizeof_stream_item(0));
top_block_->connect(sig_conditioner_.at(0)->get_right_block(), 0, ch_out_sample_counter, 0);
top_block_->connect(ch_out_sample_counter, 0, observables_->get_left_block(), channels_count_); //extra port for the sample counter pulse
}
+15 -13
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2012-2018 (see AUTHORS file for a list of contributors)
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
#
# This file is part of GNSS-SDR.
#
@@ -100,16 +100,6 @@ set(SYSTEM_PARAMETERS_HEADERS
MATH_CONSTANTS.h
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src/core/receiver
${CMAKE_SOURCE_DIR}/src/algorithms/PVT/libs
${CMAKE_SOURCE_DIR}/src/algorithms/libs/rtklib
${GLOG_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${GFlags_INCLUDE_DIRS}
)
list(SORT SYSTEM_PARAMETERS_HEADERS)
list(SORT SYSTEM_PARAMETERS_SOURCES)
@@ -120,6 +110,18 @@ add_library(gnss_system_parameters
source_group(Headers FILES ${SYSTEM_PARAMETERS_HEADERS})
add_dependencies(gnss_system_parameters rtklib_lib glog-${glog_RELEASE})
target_link_libraries(gnss_system_parameters
PUBLIC
Boost::date_time
Boost::serialization
gnss_rx
rtklib_lib
PRIVATE
Gflags::gflags
Glog::glog
)
target_link_libraries(gnss_system_parameters rtklib_lib ${Boost_LIBRARIES})
set_property(TARGET gnss_system_parameters
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
@@ -30,12 +30,12 @@
*/
#include "beidou_dnav_navigation_message.h"
#include "gnss_satellite.h"
#include <boost/crc.hpp> // for boost::crc_basic, boost::crc_optimal
#include <boost/dynamic_bitset.hpp>
#include <glog/logging.h>
#include <cmath>
#include <cstring>
#include <gnss_satellite.h>
#include <iostream>
#include <string>