1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-16 05:00:35 +00:00
gnss-sdr/src/algorithms/libs/CMakeLists.txt

198 lines
5.4 KiB
CMake
Raw Normal View History

2019-02-03 18:24:44 +00:00
# Copyright (C) 2012-2019 (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/>.
#
add_subdirectory(rtklib)
set(GNSS_SPLIBS_SOURCES
gps_l2c_signal.cc
gps_l5_signal.cc
galileo_e1_signal_processing.cc
gnss_signal_processing.cc
gps_sdr_signal_processing.cc
glonass_l1_signal_processing.cc
glonass_l2_signal_processing.cc
pass_through.cc
galileo_e5_signal_processing.cc
beidou_b1i_signal_processing.cc
beidou_b3i_signal_processing.cc
complex_byte_to_float_x2.cc
byte_x2_to_complex_byte.cc
cshort_to_float_x2.cc
short_x2_to_cshort.cc
complex_float_to_complex_byte.cc
conjugate_cc.cc
conjugate_sc.cc
conjugate_ic.cc
gnss_sdr_create_directory.cc
geofunctions.cc
)
set(GNSS_SPLIBS_HEADERS
gps_l2c_signal.h
gps_l5_signal.h
galileo_e1_signal_processing.h
gnss_signal_processing.h
gps_sdr_signal_processing.h
glonass_l1_signal_processing.h
glonass_l2_signal_processing.h
pass_through.h
galileo_e5_signal_processing.h
beidou_b1i_signal_processing.h
2019-03-18 18:28:35 +00:00
beidou_b3i_signal_processing.h
complex_byte_to_float_x2.h
byte_x2_to_complex_byte.h
cshort_to_float_x2.h
short_x2_to_cshort.h
complex_float_to_complex_byte.h
conjugate_cc.h
conjugate_sc.h
conjugate_ic.h
gnss_sdr_create_directory.h
gnss_circular_deque.h
geofunctions.h
)
if(OPENCL_FOUND)
2018-04-30 18:15:00 +00:00
set(GNSS_SPLIBS_SOURCES ${GNSS_SPLIBS_SOURCES}
opencl/fft_execute.cc # Needs OpenCL
opencl/fft_setup.cc # Needs OpenCL
opencl/fft_kernelstring.cc # Needs OpenCL
)
2018-11-24 17:40:34 +00:00
endif()
list(SORT GNSS_SPLIBS_HEADERS)
list(SORT GNSS_SPLIBS_SOURCES)
source_group(Headers FILES ${GNSS_SPLIBS_HEADERS})
add_library(algorithms_libs ${GNSS_SPLIBS_SOURCES} ${GNSS_SPLIBS_HEADERS})
2019-02-04 21:44:45 +00:00
if(${FILESYSTEM_FOUND})
target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
target_compile_definitions(algorithms_libs PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(algorithms_libs PRIVATE std::filesystem)
else()
target_link_libraries(algorithms_libs PRIVATE Boost::filesystem Boost::system)
endif()
include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <span>
int main()
{ std::span<float> sv; }"
has_span
)
if(${has_span})
target_compile_definitions(algorithms_libs PUBLIC -DHAS_SPAN=1)
else()
target_include_directories(algorithms_libs
PUBLIC
${CMAKE_SOURCE_DIR}/src/algorithms/libs/gsl/include
)
endif()
target_link_libraries(algorithms_libs
2019-02-03 18:24:44 +00:00
PUBLIC
2019-02-07 20:31:40 +00:00
Armadillo::armadillo
2019-02-03 18:24:44 +00:00
Boost::boost
Gflags::gflags
Gnuradio::runtime
Gnuradio::blocks
PRIVATE
core_system_parameters
Volk::volk ${ORC_LIBRARIES}
Volkgnsssdr::volkgnsssdr
2019-02-03 18:24:44 +00:00
Glog::glog
)
2019-06-24 09:25:18 +00:00
if(OPENCL_FOUND)
target_link_libraries(algorithms_libs PUBLIC OpenCL::OpenCL)
target_include_directories(algorithms_libs PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/opencl
)
endif()
target_include_directories(algorithms_libs
2019-02-10 00:13:02 +00:00
PUBLIC
${CMAKE_SOURCE_DIR}/src/core/interfaces
)
target_compile_definitions(algorithms_libs
2019-02-04 21:44:45 +00:00
PUBLIC -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
)
set_property(TARGET algorithms_libs
2019-02-03 18:24:44 +00:00
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(algorithms_libs
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
2019-02-04 21:44:45 +00:00
###############################################################################
source_group(Headers FILES gnss_sdr_flags.h)
2019-02-03 18:24:44 +00:00
2019-02-04 21:44:45 +00:00
add_library(gnss_sdr_flags gnss_sdr_flags.cc gnss_sdr_flags.h)
if(${FILESYSTEM_FOUND})
target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
2019-06-24 09:25:18 +00:00
target_compile_definitions(gnss_sdr_flags PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(gnss_sdr_flags PRIVATE std::filesystem)
else()
target_link_libraries(gnss_sdr_flags PRIVATE Boost::filesystem)
endif()
2019-02-03 18:24:44 +00:00
target_link_libraries(gnss_sdr_flags
PUBLIC
Gflags::gflags
)
2018-02-18 21:48:47 +00:00
if(${GFLAGS_GREATER_20})
target_compile_definitions(gnss_sdr_flags PRIVATE -DGFLAGS_GREATER_2_0=1)
2018-11-24 17:40:34 +00:00
endif()
2018-02-18 21:48:47 +00:00
2019-02-04 21:44:45 +00:00
target_compile_definitions(gnss_sdr_flags
PRIVATE -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}"
2019-02-04 21:44:45 +00:00
)
2019-02-03 18:24:44 +00:00
if(ENABLE_CLANG_TIDY)
if(CLANG_TIDY_EXE)
set_target_properties(gnss_sdr_flags
PROPERTIES
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
)
endif()
endif()
2019-02-03 18:24:44 +00:00
set_property(TARGET gnss_sdr_flags
APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)