1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-11-16 14:54:59 +00:00
gnss-sdr/src/main/CMakeLists.txt

129 lines
4.2 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_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
target_link_libraries(gnss-sdr
2019-02-03 18:24:44 +00:00
PUBLIC
Boost::filesystem
Boost::system
Gflags::gflags
Glog::glog
2019-02-07 08:34:32 +00:00
Threads::Threads
core_receiver
2019-02-04 21:44:45 +00:00
gnss_sdr_flags
)
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)
target_link_libraries(gnss-sdr
PUBLIC
${CUDA_LIBRARIES}
)
target_include_directories(gnss-sdr
PUBLIC
${CUDA_INCLUDE_DIRS}
)
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()
2019-02-07 08:28:20 +00:00
if(OS_IS_MACOSX)
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
COMPONENT "gnss-sdr")
2015-04-30 07:18:15 +00:00
install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr
FILES_MATCHING PATTERN "*.conf")
2014-11-07 17:23:59 +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)
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
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz")
install(FILES ${CMAKE_BINARY_DIR}/gnss-sdr.1.gz DESTINATION share/man/man1)
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/changelog
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/changelog.gz")
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
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
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()