2020-01-13 00:49:00 +00:00
|
|
|
# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
2020-02-11 23:04:29 +00:00
|
|
|
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
|
|
|
#
|
2012-12-24 02:33:50 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
2020-02-08 00:20:02 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
|
|
|
|
2016-10-23 09:12:13 +00:00
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
2013-11-13 21:07:33 +00:00
|
|
|
|
2019-06-10 19:41:13 +00:00
|
|
|
if(${FILESYSTEM_FOUND})
|
|
|
|
target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM=1)
|
2019-06-12 18:39:29 +00:00
|
|
|
if(${find_experimental})
|
|
|
|
target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
|
|
|
|
endif()
|
2019-06-10 19:41:13 +00:00
|
|
|
target_link_libraries(gnss-sdr PRIVATE std::filesystem)
|
|
|
|
else()
|
|
|
|
target_link_libraries(gnss-sdr PRIVATE Boost::filesystem Boost::system)
|
|
|
|
endif()
|
|
|
|
|
2018-11-21 23:35:21 +00:00
|
|
|
target_link_libraries(gnss-sdr
|
2019-02-03 18:24:44 +00:00
|
|
|
PUBLIC
|
2019-08-03 17:51:50 +00:00
|
|
|
core_receiver
|
2019-09-07 10:36:19 +00:00
|
|
|
Boost::headers
|
2019-08-03 17:51:50 +00:00
|
|
|
Boost::thread
|
2019-02-03 18:24:44 +00:00
|
|
|
Gflags::gflags
|
|
|
|
Glog::glog
|
2019-02-07 08:34:32 +00:00
|
|
|
Threads::Threads
|
2018-11-21 23:35:21 +00:00
|
|
|
)
|
2013-01-03 01:48:34 +00:00
|
|
|
|
2019-02-07 19:31:40 +00:00
|
|
|
target_compile_definitions(gnss-sdr PRIVATE -DGNSS_SDR_VERSION="${VERSION}")
|
|
|
|
|
2019-02-06 17:36:31 +00:00
|
|
|
# Disable internal logging
|
|
|
|
if(NOT ENABLE_LOG)
|
2019-02-10 00:13:02 +00:00
|
|
|
target_compile_definitions(gnss-sdr PUBLIC -DGOOGLE_STRIP_LOG=1)
|
2019-02-06 17:36:31 +00:00
|
|
|
endif()
|
|
|
|
|
2019-02-04 21:44:45 +00:00
|
|
|
if(ENABLE_CUDA)
|
2019-06-24 18:02:19 +00:00
|
|
|
if(NOT CMAKE_VERSION VERSION_GREATER 3.11)
|
|
|
|
target_link_libraries(gnss-sdr
|
|
|
|
PUBLIC
|
|
|
|
${CUDA_LIBRARIES}
|
|
|
|
)
|
|
|
|
target_include_directories(gnss-sdr
|
|
|
|
PUBLIC
|
|
|
|
${CUDA_INCLUDE_DIRS}
|
|
|
|
)
|
|
|
|
endif()
|
2019-02-04 21:44:45 +00:00
|
|
|
target_compile_definitions(gnss-sdr PRIVATE -DCUDA_GPU_ACCEL=1)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(ENABLE_GPERFTOOLS)
|
|
|
|
if(GPERFTOOLS_FOUND)
|
|
|
|
target_link_libraries(gnss-sdr
|
|
|
|
PUBLIC
|
2019-02-07 19:31:40 +00:00
|
|
|
Gperftools::profiler
|
|
|
|
Gperftools::tcmalloc
|
2019-02-04 21:44:45 +00:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-01-13 00:49:00 +00:00
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
2019-02-07 08:28:20 +00:00
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
target_link_libraries(gnss-sdr
|
|
|
|
PUBLIC
|
|
|
|
"-lc++"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-02-21 08:59:06 +00:00
|
|
|
if(ENABLE_CLANG_TIDY)
|
|
|
|
if(CLANG_TIDY_EXE)
|
|
|
|
set_target_properties(gnss-sdr
|
|
|
|
PROPERTIES
|
|
|
|
CXX_CLANG_TIDY "${DO_CLANG_TIDY}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2019-02-04 21:44:45 +00:00
|
|
|
add_custom_command(TARGET gnss-sdr
|
|
|
|
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:gnss-sdr>
|
|
|
|
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:gnss-sdr>
|
|
|
|
)
|
2019-02-03 18:24:44 +00:00
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
install(TARGETS gnss-sdr
|
2018-11-21 23:35:21 +00:00
|
|
|
RUNTIME DESTINATION bin
|
2019-09-07 11:37:16 +00:00
|
|
|
COMPONENT "gnss-sdr"
|
|
|
|
)
|
2015-04-30 07:18:15 +00:00
|
|
|
|
2019-09-07 11:37:16 +00:00
|
|
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf
|
|
|
|
DESTINATION share/gnss-sdr
|
|
|
|
FILES_MATCHING PATTERN "*.conf"
|
|
|
|
)
|
2014-11-07 17:23:59 +00:00
|
|
|
|
2019-09-07 11:37:16 +00:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf
|
|
|
|
DESTINATION share/gnss-sdr/conf
|
|
|
|
RENAME default.conf
|
|
|
|
)
|
2014-11-05 22:26:31 +00:00
|
|
|
|
2018-11-24 17:40:34 +00:00
|
|
|
if(NOT VOLKGNSSSDR_FOUND)
|
2019-09-07 11:37:16 +00:00
|
|
|
install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr_profile
|
|
|
|
DESTINATION bin
|
|
|
|
COMPONENT "volk_gnsssdr"
|
|
|
|
)
|
|
|
|
|
|
|
|
install(PROGRAMS ${CMAKE_BINARY_DIR}/volk_gnsssdr_module/build/apps/volk_gnsssdr-config-info
|
|
|
|
DESTINATION bin
|
|
|
|
COMPONENT "volk_gnsssdr"
|
|
|
|
)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
2014-11-14 20:03:45 +00:00
|
|
|
|
|
|
|
find_program(GZIP
|
|
|
|
gzip
|
|
|
|
/bin
|
|
|
|
/usr/bin
|
|
|
|
/usr/local/bin
|
|
|
|
/opt/local/bin
|
|
|
|
/sbin
|
|
|
|
)
|
2018-05-25 18:49:45 +00:00
|
|
|
|
2014-11-14 20:03:45 +00:00
|
|
|
if(NOT GZIP_NOTFOUND)
|
2014-11-14 20:42:22 +00:00
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/gnss-sdr-manpage
|
2019-09-07 11:37:16 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz"
|
|
|
|
)
|
2017-04-07 16:56:35 +00:00
|
|
|
|
2019-09-07 11:37:16 +00:00
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz
|
|
|
|
DESTINATION share/man/man1
|
|
|
|
)
|
Improve portability
In some architectures (e.g. alpha, hppa, powerpcspe, m68k, sh4, sparc64, x32) the package gr-osmosdr is not available. So when the package is build with -DENABLE_OSMOSDR=ON, it breaks on the mentioned architectures. This is expected behaviour (it breaks because a required dependency is not found), but prevents from building the package on such architectures. This commit introduces a small change: when compilation is called with
cmake -DENABLE_OSMOSDR=ON -DENABLE_PACKAGING=ON ..
then, the compilation does not break if gr-osmosdr is not found.
This commit also fixes building when UHD is present but gnuradio-uhd is not (for instance, in hurd-i386)
2017-04-12 16:06:04 +00:00
|
|
|
|
2020-02-27 20:05:29 +00:00
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/changelog.md
|
2019-09-07 11:37:16 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz"
|
|
|
|
)
|
Improve portability
In some architectures (e.g. alpha, hppa, powerpcspe, m68k, sh4, sparc64, x32) the package gr-osmosdr is not available. So when the package is build with -DENABLE_OSMOSDR=ON, it breaks on the mentioned architectures. This is expected behaviour (it breaks because a required dependency is not found), but prevents from building the package on such architectures. This commit introduces a small change: when compilation is called with
cmake -DENABLE_OSMOSDR=ON -DENABLE_PACKAGING=ON ..
then, the compilation does not break if gr-osmosdr is not found.
This commit also fixes building when UHD is present but gnuradio-uhd is not (for instance, in hurd-i386)
2017-04-12 16:06:04 +00:00
|
|
|
|
2019-09-07 11:37:16 +00:00
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/changelog.gz
|
|
|
|
DESTINATION share/doc/gnss-sdr
|
|
|
|
)
|
Improve portability
In some architectures (e.g. alpha, hppa, powerpcspe, m68k, sh4, sparc64, x32) the package gr-osmosdr is not available. So when the package is build with -DENABLE_OSMOSDR=ON, it breaks on the mentioned architectures. This is expected behaviour (it breaks because a required dependency is not found), but prevents from building the package on such architectures. This commit introduces a small change: when compilation is called with
cmake -DENABLE_OSMOSDR=ON -DENABLE_PACKAGING=ON ..
then, the compilation does not break if gr-osmosdr is not found.
This commit also fixes building when UHD is present but gnuradio-uhd is not (for instance, in hurd-i386)
2017-04-12 16:06:04 +00:00
|
|
|
|
2018-11-24 17:40:34 +00:00
|
|
|
if(NOT VOLKGNSSSDR_FOUND)
|
2018-11-21 23:35:21 +00:00
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr_profile-manpage
|
2019-09-07 11:37:16 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz"
|
|
|
|
)
|
|
|
|
|
2018-11-21 23:35:21 +00:00
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/cmake/Packaging/volk_gnsssdr-config-info-manpage
|
2019-09-07 11:37:16 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
|
|
|
OUTPUT_FILE "${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz"
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr_profile.1.gz
|
|
|
|
DESTINATION share/man/man1
|
|
|
|
)
|
|
|
|
|
|
|
|
install(FILES ${CMAKE_BINARY_DIR}/volk_gnsssdr-config-info.1.gz
|
|
|
|
DESTINATION share/man/man1
|
|
|
|
)
|
2018-11-24 17:40:34 +00:00
|
|
|
endif()
|
|
|
|
endif()
|