gnss-sdr/src/core/monitor/CMakeLists.txt

104 lines
2.7 KiB
CMake
Raw Permalink Normal View History

# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
# This file is part of GNSS-SDR.
#
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
# SPDX-License-Identifier: BSD-3-Clause
protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS ${GNSSSDR_SOURCE_DIR}/docs/protobuf/gnss_synchro.proto)
2018-11-18 20:24:54 +00:00
set(CORE_MONITOR_LIBS_SOURCES
gnss_synchro_monitor.cc
gnss_synchro_udp_sink.cc
)
2018-11-18 20:24:54 +00:00
set(CORE_MONITOR_LIBS_HEADERS
gnss_synchro_monitor.h
gnss_synchro_udp_sink.h
2019-04-20 20:07:35 +00:00
serdes_gnss_synchro.h
)
list(SORT CORE_MONITOR_LIBS_HEADERS)
list(SORT CORE_MONITOR_LIBS_SOURCES)
if(USE_CMAKE_TARGET_SOURCES)
add_library(core_monitor STATIC)
target_sources(core_monitor
PRIVATE
${PROTO_SRCS}
${PROTO_HDRS}
${CORE_MONITOR_LIBS_SOURCES}
PUBLIC
${CORE_MONITOR_LIBS_HEADERS}
)
else()
source_group(Headers FILES ${CORE_MONITOR_LIBS_HEADERS})
add_library(core_monitor
${CORE_MONITOR_LIBS_SOURCES}
${PROTO_SRCS}
${CORE_MONITOR_LIBS_HEADERS}
${PROTO_HDRS}
)
endif()
target_link_libraries(core_monitor
2019-02-03 18:24:44 +00:00
PUBLIC
2020-02-11 23:04:29 +00:00
Boost::headers
2019-02-04 07:12:55 +00:00
Boost::system
2019-02-03 18:24:44 +00:00
Gnuradio::runtime
2019-04-20 20:07:35 +00:00
protobuf::libprotobuf
core_system_parameters
2019-02-03 18:24:44 +00:00
PRIVATE
2020-02-11 23:04:29 +00:00
Boost::serialization
2019-02-03 18:24:44 +00:00
)
get_filename_component(PROTO_INCLUDE_HEADERS_DIR ${PROTO_HDRS} DIRECTORY)
2019-04-20 20:07:35 +00:00
target_include_directories(core_monitor
PUBLIC
${GNSSSDR_SOURCE_DIR}/src/core/interfaces
2020-06-30 08:29:39 +00:00
PRIVATE
${GNSSSDR_SOURCE_DIR}/src/algorithms/libs # for gnss_sdr_make_unique
)
# Do not apply clang-tidy fixes to protobuf generated headers
target_include_directories(core_monitor
SYSTEM PUBLIC
${PROTO_INCLUDE_HEADERS_DIR}
2019-04-20 20:07:35 +00:00
)
if(GNURADIO_USES_STD_POINTERS)
target_compile_definitions(core_monitor
PUBLIC -DGNURADIO_USES_STD_POINTERS=1
)
endif()
2019-05-08 14:15:59 +00:00
if(USE_BOOST_ASIO_IO_CONTEXT)
2019-05-08 14:15:59 +00:00
target_compile_definitions(core_monitor
PUBLIC
2020-06-14 11:00:36 +00:00
-DUSE_BOOST_ASIO_IO_CONTEXT=1
2019-05-08 14:15:59 +00:00
)
endif()
2019-05-26 09:44:17 +00:00
# Fix for Boost Asio < 1.70
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") AND (Boost_VERSION_STRING VERSION_LESS 1.70.0))
if(${has_string_view})
target_compile_definitions(core_monitor
PUBLIC
-DBOOST_ASIO_HAS_STD_STRING_VIEW=1
)
else()
target_compile_definitions(core_monitor
PUBLIC
-DBOOST_ASIO_HAS_STD_STRING_VIEW=0
)
endif()
endif()
endif()
set_property(TARGET core_monitor
2019-02-03 18:24:44 +00:00
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)