1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-17 07:14:55 +00:00
gnss-sdr/src/main/CMakeLists.txt

162 lines
4.3 KiB
CMake
Raw Normal View History

# Copyright (C) 2012-2020 (see AUTHORS file for a list of contributors)
#
2020-02-11 23:04:29 +00:00
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
#
# This file is part of GNSS-SDR.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
if(${FILESYSTEM_FOUND})
target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM=1)
if(${find_experimental})
target_compile_definitions(gnss-sdr PRIVATE -DHAS_STD_FILESYSTEM_EXPERIMENTAL=1)
endif()
target_link_libraries(gnss-sdr PRIVATE std::filesystem)
else()
target_link_libraries(gnss-sdr PRIVATE Boost::filesystem Boost::system)
endif()
target_link_libraries(gnss-sdr
2019-02-03 18:24:44 +00:00
PUBLIC
core_receiver
Boost::headers
Boost::thread
2019-02-03 18:24:44 +00:00
Gflags::gflags
Glog::glog
2019-02-07 08:34:32 +00:00
Threads::Threads
)
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()
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()
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
install(TARGETS gnss-sdr
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)
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"
)
2019-09-07 11:37:16 +00:00
install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz
DESTINATION share/man/man1
)
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"
)
2019-09-07 11:37:16 +00:00
install(FILES ${CMAKE_BINARY_DIR}/changelog.gz
DESTINATION share/doc/gnss-sdr
)
2018-11-24 17:40:34 +00:00
if(NOT VOLKGNSSSDR_FOUND)
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"
)
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()