mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-19 16:45:17 +00:00
Make use of target_sources(), make use of target propagation to reduce redundancy in dependencies, some fixes for Clang and CMake < 3.11. Use generic lambdas with auto
This commit is contained in:
@@ -8,22 +8,22 @@
|
||||
#
|
||||
|
||||
|
||||
set(PVT_ADAPTER_SOURCES
|
||||
rtklib_pvt.cc
|
||||
)
|
||||
|
||||
set(PVT_ADAPTER_HEADERS
|
||||
rtklib_pvt.h
|
||||
)
|
||||
|
||||
source_group(Headers FILES ${PVT_ADAPTER_HEADERS})
|
||||
|
||||
add_library(pvt_adapters ${PVT_ADAPTER_SOURCES} ${PVT_ADAPTER_HEADERS})
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.13)
|
||||
add_library(pvt_adapters STATIC)
|
||||
target_sources(pvt_adapters
|
||||
PRIVATE
|
||||
rtklib_pvt.cc
|
||||
PUBLIC
|
||||
rtklib_pvt.h
|
||||
)
|
||||
else()
|
||||
source_group(Headers FILES rtklib_pvt.h)
|
||||
add_library(pvt_adapters rtklib_pvt.cc rtklib_pvt.h)
|
||||
endif()
|
||||
|
||||
target_link_libraries(pvt_adapters
|
||||
PUBLIC
|
||||
pvt_gr_blocks
|
||||
algorithms_libs_rtklib
|
||||
PRIVATE
|
||||
gnss_sdr_flags
|
||||
Glog::glog
|
||||
|
||||
@@ -7,17 +7,18 @@
|
||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||
#
|
||||
|
||||
set(PVT_GR_BLOCKS_SOURCES
|
||||
rtklib_pvt_gs.cc
|
||||
)
|
||||
|
||||
set(PVT_GR_BLOCKS_HEADERS
|
||||
rtklib_pvt_gs.h
|
||||
)
|
||||
|
||||
source_group(Headers FILES ${PVT_GR_BLOCKS_HEADERS})
|
||||
|
||||
add_library(pvt_gr_blocks ${PVT_GR_BLOCKS_SOURCES} ${PVT_GR_BLOCKS_HEADERS})
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.13)
|
||||
add_library(pvt_gr_blocks STATIC)
|
||||
target_sources(pvt_gr_blocks
|
||||
PRIVATE
|
||||
rtklib_pvt_gs.cc
|
||||
PUBLIC
|
||||
rtklib_pvt_gs.h
|
||||
)
|
||||
else()
|
||||
source_group(Headers FILES rtklib_pvt_gs.h)
|
||||
add_library(pvt_gr_blocks rtklib_pvt_gs.cc rtklib_pvt_gs.h)
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(pvt_gr_blocks PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
@@ -32,7 +33,6 @@ endif()
|
||||
target_link_libraries(pvt_gr_blocks
|
||||
PUBLIC
|
||||
algorithms_libs_rtklib
|
||||
core_system_parameters
|
||||
Boost::date_time
|
||||
Gnuradio::pmt
|
||||
Gnuradio::runtime
|
||||
@@ -49,7 +49,7 @@ if(GNURADIO_USES_STD_POINTERS)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.1)
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0)))
|
||||
set(has_generic_lambdas HAS_GENERIC_LAMBDA=1)
|
||||
set(no_has_generic_lambdas HAS_GENERIC_LAMBDA=0)
|
||||
target_compile_definitions(pvt_gr_blocks
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
#else
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/bind/bind.hpp>
|
||||
#endif
|
||||
|
||||
#if HAS_STD_FILESYSTEM
|
||||
@@ -192,7 +192,7 @@ rtklib_pvt_gs::rtklib_pvt_gs(uint32_t nchannels,
|
||||
this->message_port_register_in(pmt::mp("telemetry"));
|
||||
this->set_msg_handler(pmt::mp("telemetry"),
|
||||
#if HAS_GENERIC_LAMBDA
|
||||
[this](pmt::pmt_t&& PH1) { msg_handler_telemetry(PH1); });
|
||||
[this](auto&& PH1) { msg_handler_telemetry(PH1); });
|
||||
#else
|
||||
#if BOOST_173_OR_GREATER
|
||||
boost::bind(&rtklib_pvt_gs::msg_handler_telemetry, this, boost::placeholders::_1));
|
||||
|
||||
@@ -23,7 +23,6 @@ set(PVT_LIB_SOURCES
|
||||
rtklib_solver.cc
|
||||
pvt_conf.cc
|
||||
monitor_pvt_udp_sink.cc
|
||||
${PROTO_SRCS}
|
||||
)
|
||||
|
||||
set(PVT_LIB_HEADERS
|
||||
@@ -42,15 +41,25 @@ set(PVT_LIB_HEADERS
|
||||
monitor_pvt_udp_sink.h
|
||||
monitor_pvt.h
|
||||
serdes_monitor_pvt.h
|
||||
${PROTO_HDRS}
|
||||
)
|
||||
|
||||
list(SORT PVT_LIB_HEADERS)
|
||||
list(SORT PVT_LIB_SOURCES)
|
||||
|
||||
source_group(Headers FILES ${PVT_LIB_HEADERS})
|
||||
|
||||
add_library(pvt_libs ${PVT_LIB_SOURCES} ${PVT_LIB_HEADERS})
|
||||
if(CMAKE_VERSION VERSION_GREATER 3.13)
|
||||
add_library(pvt_libs STATIC)
|
||||
target_sources(pvt_libs
|
||||
PRIVATE
|
||||
${PROTO_SRCS}
|
||||
${PROTO_HDRS}
|
||||
${PVT_LIB_SOURCES}
|
||||
PUBLIC
|
||||
${PVT_LIB_HEADERS}
|
||||
)
|
||||
else()
|
||||
source_group(Headers FILES ${PVT_LIB_HEADERS} ${PROTO_HDRS})
|
||||
add_library(pvt_libs ${PVT_LIB_SOURCES} ${PROTO_SRCS} ${PVT_LIB_HEADERS} ${PROTO_HDRS})
|
||||
endif()
|
||||
|
||||
if(${FILESYSTEM_FOUND})
|
||||
target_compile_definitions(pvt_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
|
||||
|
||||
Reference in New Issue
Block a user