2019-02-03 18:24:44 +00:00
|
|
|
# Copyright (C) 2012-2019 (see AUTHORS file for a list of contributors)
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
|
|
|
# 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
|
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
|
|
|
# (at your option) any later version.
|
2012-12-24 02:33:50 +00:00
|
|
|
#
|
|
|
|
# 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
|
2018-05-13 20:49:11 +00:00
|
|
|
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
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
|
|
|
|
2018-11-21 23:35:21 +00:00
|
|
|
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
|
2019-02-10 17:34:28 +00:00
|
|
|
core_receiver
|
2019-02-04 21:44:45 +00:00
|
|
|
gnss_sdr_flags
|
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)
|
|
|
|
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()
|
|
|
|
|
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
|
|
|
|
COMPONENT "gnss-sdr")
|
2015-04-30 07:18:15 +00:00
|
|
|
|
2014-11-12 22:05:53 +00:00
|
|
|
install(DIRECTORY ${CMAKE_SOURCE_DIR}/conf DESTINATION share/gnss-sdr
|
2018-11-21 23:35:21 +00:00
|
|
|
FILES_MATCHING PATTERN "*.conf")
|
2014-11-07 17:23:59 +00:00
|
|
|
|
2014-11-12 22:05:53 +00:00
|
|
|
install(FILES ${CMAKE_SOURCE_DIR}/conf/gnss-sdr.conf DESTINATION share/gnss-sdr/conf
|
2018-11-21 23:35:21 +00:00
|
|
|
RENAME default.conf)
|
2014-11-05 22:26:31 +00:00
|
|
|
|
2018-11-24 17:40:34 +00:00
|
|
|
if(NOT VOLKGNSSSDR_FOUND)
|
2016-07-06 18:25:39 +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
|
2018-11-21 23:35:21 +00:00
|
|
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/gnss-sdr.1.gz")
|
2017-04-07 16:56:35 +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
|
|
|
|
2017-04-07 16:56:35 +00:00
|
|
|
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/changelog
|
2018-11-21 23:35:21 +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
|
|
|
|
2017-04-07 16:56:35 +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
|
|
|
|
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()
|