2020-12-30 12:35:06 +00:00
|
|
|
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2012-12-24 02:33:50 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
2020-12-30 12:35:06 +00:00
|
|
|
# SPDX-FileCopyrightText: 2010-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2020-06-12 22:32:40 +00:00
|
|
|
if(USE_CMAKE_TARGET_SOURCES)
|
2020-06-08 18:04:01 +00:00
|
|
|
add_executable(gnss-sdr)
|
|
|
|
target_sources(gnss-sdr PRIVATE main.cc)
|
|
|
|
else()
|
|
|
|
add_executable(gnss-sdr main.cc)
|
|
|
|
endif()
|
2016-10-23 09:12:13 +00:00
|
|
|
|
2018-11-21 23:35:21 +00:00
|
|
|
target_link_libraries(gnss-sdr
|
2020-06-08 18:04:01 +00:00
|
|
|
PRIVATE
|
2020-06-18 09:49:28 +00:00
|
|
|
algorithms_libs
|
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-04 21:44:45 +00:00
|
|
|
if(ENABLE_CUDA)
|
2020-08-27 12:57:44 +00:00
|
|
|
if(CMAKE_VERSION VERSION_GREATER 3.11)
|
|
|
|
target_include_directories(gnss-sdr
|
|
|
|
PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES}
|
|
|
|
)
|
|
|
|
else()
|
2019-06-24 18:02:19 +00:00
|
|
|
target_link_libraries(gnss-sdr
|
2020-08-27 12:57:44 +00:00
|
|
|
PUBLIC ${CUDA_LIBRARIES}
|
2019-06-24 18:02:19 +00:00
|
|
|
)
|
|
|
|
target_include_directories(gnss-sdr
|
2020-08-27 12:57:44 +00:00
|
|
|
PUBLIC ${CUDA_INCLUDE_DIRS}
|
2019-06-24 18:02:19 +00:00
|
|
|
)
|
|
|
|
endif()
|
2020-08-27 12:57:44 +00:00
|
|
|
set_target_properties(gnss-sdr PROPERTIES
|
|
|
|
CUDA_SEPARABLE_COMPILATION ON
|
|
|
|
POSITION_INDEPENDENT_CODE ON
|
|
|
|
)
|
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
|
2020-06-08 18:04:01 +00:00
|
|
|
PRIVATE
|
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")
|
2020-06-10 15:22:03 +00:00
|
|
|
target_link_libraries(gnss-sdr PRIVATE "-lc++")
|
2019-02-07 08:28:20 +00:00
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2020-06-10 15:22:03 +00:00
|
|
|
if(ENABLE_STRIP)
|
|
|
|
set_target_properties(gnss-sdr PROPERTIES LINK_FLAGS "-s")
|
|
|
|
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>
|
2020-06-12 18:51:26 +00:00
|
|
|
${LOCAL_INSTALL_BASE_DIR}/install/$<TARGET_FILE_NAME:gnss-sdr>
|
2019-02-04 21:44:45 +00:00
|
|
|
)
|
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
|
|
|
|
2021-06-21 08:04:54 +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()
|