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.
#
2023-04-04 07:10:15 +00:00
# SPDX-FileCopyrightText: 2010-2023 C. Fernandez-Prades cfernandez(at)cttc.es
2020-12-30 12:35:06 +00:00
# SPDX-License-Identifier: BSD-3-Clause
2012-12-24 02:33:50 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
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
# Project setup
2019-03-10 04:36:09 +00:00
################################################################################
2012-12-24 02:33:50 +00:00
if ( ${ CMAKE_SOURCE_DIR } STREQUAL ${ CMAKE_BINARY_DIR } )
2019-04-02 00:41:20 +00:00
message ( FATAL_ERROR "Prevented in-tree build, it is bad practice.\nTry 'cd build && cmake ..' instead." )
2018-11-24 17:40:34 +00:00
endif ( )
2017-08-07 17:29:05 +00:00
2022-02-09 14:13:48 +00:00
# Select the release build type by default to get optimization flags.
# This has to come before project() which otherwise initializes it.
# Build type can still be overridden by setting -DCMAKE_BUILD_TYPE=
set ( CMAKE_BUILD_TYPE "Release" CACHE STRING "" )
2022-11-24 18:13:14 +00:00
cmake_minimum_required ( VERSION 2.8.12...3.25 )
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
project ( gnss-sdr CXX C )
2016-11-27 22:47:45 +00:00
2022-07-28 08:37:36 +00:00
set ( GNSSSDR_SOURCE_DIR ${ CMAKE_CURRENT_SOURCE_DIR } ) # Allows to be a sub-project
set ( GNSSSDR_BINARY_DIR ${ CMAKE_CURRENT_BINARY_DIR } )
list ( APPEND CMAKE_MODULE_PATH ${ GNSSSDR_SOURCE_DIR } /cmake/Modules )
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
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
# Determine optional blocks/libraries to be built (default: not built)
2019-02-21 08:59:06 +00:00
# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ..'
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
include ( FeatureSummary )
2019-06-24 19:29:35 +00:00
2015-05-03 08:15:51 +00:00
# Support of optional RF front-ends
2018-03-26 17:23:43 +00:00
option ( ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON )
2019-03-09 00:39:32 +00:00
2018-10-03 14:57:06 +00:00
option ( ENABLE_OSMOSDR "Enable the use of OsmoSDR and other front-ends (RTL-based dongles, HackRF, bladeRF, etc.) as signal source" OFF )
2019-03-09 00:39:32 +00:00
2021-01-22 16:45:26 +00:00
option ( ENABLE_LIMESDR "Enable the use of LimeSDR and Custom LimeSDR as signal source" OFF )
2017-10-31 14:40:14 +00:00
option ( ENABLE_FMCOMMS2 "Enable the use of FMCOMMS4-EBZ + ZedBoard hardware, requires gr-iio" OFF )
2019-03-09 00:39:32 +00:00
2017-10-30 21:31:20 +00:00
option ( ENABLE_PLUTOSDR "Enable the use of ADALM-PLUTO Evaluation Boards (Analog Devices Inc.), requires gr-iio" OFF )
2019-03-09 00:39:32 +00:00
option ( ENABLE_AD9361 "Enable the use of AD9361 direct to FPGA hardware, requires libiio" OFF )
2018-05-16 09:36:37 +00:00
option ( ENABLE_RAW_UDP "Enable the use of high-optimized custom UDP packet sample source, requires libpcap" OFF )
2015-05-03 08:15:51 +00:00
2019-03-10 04:36:09 +00:00
option ( ENABLE_FLEXIBAND "Enable the use of the signal source adater for the Teleorbit Flexiband GNU Radio driver" OFF )
option ( ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF )
2023-01-27 20:30:32 +00:00
option ( ENABLE_ZMQ "Enable GNU Radio ZeroMQ Messaging, requires gr-zeromq" ON )
2022-08-10 23:37:57 +00:00
2015-05-03 08:15:51 +00:00
# Performance analysis tools
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
option ( ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF )
2019-03-09 00:39:32 +00:00
2015-05-03 08:15:51 +00:00
option ( ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF )
2019-02-21 08:59:06 +00:00
# Code correctness
option ( ENABLE_CLANG_TIDY "Enable the use of clang-tidy when compiling" OFF )
2015-05-03 08:15:51 +00:00
# Acceleration
2016-07-02 16:54:39 +00:00
option ( ENABLE_PROFILING "Enable execution of volk_gnsssdr_profile at the end of the building" OFF )
2019-03-09 00:39:32 +00:00
2015-05-03 08:15:51 +00:00
option ( ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF )
2019-03-09 00:39:32 +00:00
2015-08-25 17:01:02 +00:00
option ( ENABLE_CUDA "Enable building of processing blocks implemented with CUDA (experimental, requires CUDA SDK)" OFF )
2019-03-09 00:39:32 +00:00
2019-08-12 09:53:53 +00:00
option ( ENABLE_FPGA "Enable building of processing blocks implementing FPGA offloading" OFF )
2015-05-03 08:15:51 +00:00
# Building and packaging options
2014-11-11 22:50:38 +00:00
option ( ENABLE_PACKAGING "Enable software packaging" OFF )
2019-03-09 00:39:32 +00:00
2014-11-14 00:40:43 +00:00
option ( ENABLE_OWN_GLOG "Download glog and link it to gflags" OFF )
2019-03-09 00:39:32 +00:00
2017-02-03 11:04:15 +00:00
option ( ENABLE_OWN_ARMADILLO "Download and build Armadillo locally" OFF )
2019-03-09 00:39:32 +00:00
2015-05-23 09:20:26 +00:00
option ( ENABLE_LOG "Enable logging" ON )
2019-03-09 00:39:32 +00:00
2019-08-12 09:33:51 +00:00
option ( ENABLE_ARMA_NO_DEBUG OFF )
2020-06-10 21:01:26 +00:00
option ( ENABLE_STRIP "Create stripped binaries without debugging symbols (in Release build mode only)" OFF )
2020-06-10 15:22:03 +00:00
2021-12-17 18:48:11 +00:00
option ( Boost_USE_STATIC_LIBS "Use Boost static libs" OFF )
2014-11-14 00:40:43 +00:00
if ( ENABLE_PACKAGING )
2019-08-12 09:33:51 +00:00
set ( ENABLE_ARMA_NO_DEBUG ON )
2019-09-07 14:54:02 +00:00
set ( CMAKE_VERBOSE_MAKEFILE ON )
2020-06-10 15:22:03 +00:00
set ( ENABLE_STRIP OFF )
2018-11-24 17:40:34 +00:00
endif ( )
2012-12-24 02:33:50 +00:00
2016-10-01 23:59:12 +00:00
# Testing
2017-01-10 17:57:38 +00:00
option ( ENABLE_UNIT_TESTING "Build unit tests" ON )
2019-03-09 00:39:32 +00:00
2018-09-07 12:36:11 +00:00
option ( ENABLE_UNIT_TESTING_MINIMAL "Build a minimal set of unit tests" OFF )
2019-03-09 00:39:32 +00:00
2017-01-28 15:49:46 +00:00
option ( ENABLE_UNIT_TESTING_EXTRA "Download external files and build extra unit tests" OFF )
2019-03-09 00:39:32 +00:00
2017-01-10 17:57:38 +00:00
option ( ENABLE_SYSTEM_TESTING "Build system tests" OFF )
2019-03-09 00:39:32 +00:00
2017-01-10 17:57:38 +00:00
option ( ENABLE_SYSTEM_TESTING_EXTRA "Download external tools and build extra system tests" OFF )
2019-03-09 00:39:32 +00:00
2019-06-28 07:32:46 +00:00
option ( ENABLE_GNSS_SIM_INSTALL "Enable the installation of gnss_sim on the fly" ON )
2022-04-03 21:24:31 +00:00
option ( ENABLE_CPUFEATURES "Make use of the cpu_features library" ON )
2021-01-11 12:57:29 +00:00
2019-06-28 07:32:46 +00:00
if ( NOT ( ENABLE_UNIT_TESTING_EXTRA OR ENABLE_SYSTEM_TESTING_EXTRA OR ENABLE_FPGA ) )
set ( ENABLE_GNSS_SIM_INSTALL OFF )
endif ( )
2017-01-10 17:57:38 +00:00
if ( ENABLE_SYSTEM_TESTING_EXTRA )
set ( ENABLE_SYSTEM_TESTING ON )
2018-11-24 17:40:34 +00:00
endif ( )
2019-06-28 07:32:46 +00:00
2022-07-04 08:05:54 +00:00
option ( ENABLE_OWN_GNSSTK "Force to download, build and link gnsstk for system tests, even if it is already installed" OFF )
2019-03-09 00:39:32 +00:00
2022-07-05 11:46:58 +00:00
if ( NOT ENABLE_OWN_GNSSTK )
option ( ENABLE_OWN_GPSTK "Force to download, build and link gnsstk for system tests, even if it is already installed" OFF )
if ( ENABLE_OWN_GPSTK )
2022-07-26 22:23:54 +00:00
unset ( Gnsstk:gnsstk CACHE )
unset ( GNSSTK_FOUND CACHE )
2022-07-05 11:46:58 +00:00
message ( STATUS "WARNING: Option ENABLE_OWN_GPSTK is deprecated, please use ENABLE_OWN_GNSSTK" )
set ( ENABLE_OWN_GNSSTK ON )
endif ( )
endif ( )
2017-02-17 00:02:07 +00:00
option ( ENABLE_INSTALL_TESTS "Install QA code system-wide" OFF )
if ( ENABLE_FPGA )
set ( ENABLE_INSTALL_TESTS ON )
2018-11-24 17:40:34 +00:00
endif ( )
2016-11-27 22:47:45 +00:00
2020-06-21 19:10:22 +00:00
option ( ENABLE_BENCHMARKS "Build code snippets benchmarks" OFF )
2022-11-23 09:04:03 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.16.3 )
2020-06-21 19:10:22 +00:00
set ( ENABLE_BENCHMARKS OFF )
endif ( )
2016-11-27 22:47:45 +00:00
2020-10-30 11:24:23 +00:00
option ( ENABLE_EXTERNAL_MATHJAX "Use MathJax from an external CDN in HTML docs" ON )
2021-12-23 13:48:27 +00:00
option ( ENABLE_ORC "Use (if available) the Optimized Inner Loop Runtime Compiler (ORC)" OFF )
2017-08-07 17:29:05 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2015-03-20 16:02:41 +00:00
# GNSS-SDR version information
2019-03-10 04:36:09 +00:00
################################################################################
2022-04-20 14:47:07 +00:00
set ( THIS_IS_A_RELEASE OFF ) # only related to version name, no further implications.
2015-01-13 10:11:23 +00:00
if ( NOT ${ THIS_IS_A_RELEASE } )
2019-03-10 04:36:09 +00:00
find_package ( Git )
set_package_properties ( Git PROPERTIES
U R L " h t t p s : / / g i t - s c m . c o m "
2019-06-26 18:15:15 +00:00
D E S C R I P T I O N " A f r e e a n d o p e n s o u r c e d i s t r i b u t e d v e r s i o n c o n t r o l system ( found: v ${ GIT_VERSION_STRING } ) "
2019-03-10 04:36:09 +00:00
P U R P O S E " M a n a g e v e r s i o n c o n t r o l , g e t M I N O R _ V E R S I O N n a m e f o r v e r s i o n n u m b e r . "
T Y P E R E Q U I R E D
2015-01-13 10:11:23 +00:00
)
2019-03-10 19:08:49 +00:00
if ( GIT_FOUND )
2019-03-10 04:36:09 +00:00
# was this info set in the CMake commandline?
if ( NOT GIT_BRANCH )
# no: try to find it
execute_process (
C O M M A N D $ { G I T _ E X E C U T A B L E } r e v - p a r s e - - a b b r e v - r e f H E A D
2022-07-28 08:37:36 +00:00
W O R K I N G _ D I R E C T O R Y $ { G N S S S D R _ S O U R C E _ D I R }
2019-03-10 04:36:09 +00:00
O U T P U T _ V A R I A B L E G I T _ B R A N C H
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
2019-08-12 09:33:51 +00:00
endif ( )
2019-03-10 04:36:09 +00:00
# was this info set in the CMake commandline?
if ( NOT GIT_COMMIT_HASH )
# Get the latest abbreviated commit hash of the working branch
execute_process (
C O M M A N D $ { G I T _ E X E C U T A B L E } l o g - 1 - - f o r m a t = % h
2022-07-28 08:37:36 +00:00
W O R K I N G _ D I R E C T O R Y $ { G N S S S D R _ S O U R C E _ D I R }
2019-03-10 04:36:09 +00:00
O U T P U T _ V A R I A B L E G I T _ C O M M I T _ H A S H
O U T P U T _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
2019-08-12 09:33:51 +00:00
endif ( )
2019-03-10 04:36:09 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2014-04-10 20:05:04 +00:00
2012-12-24 02:33:50 +00:00
set ( VERSION_INFO_MAJOR_VERSION 0 )
2018-11-24 17:40:34 +00:00
set ( VERSION_INFO_API_COMPAT 0 )
2015-01-13 10:11:23 +00:00
if ( ${ THIS_IS_A_RELEASE } )
2022-04-20 12:02:56 +00:00
set ( VERSION_INFO_MINOR_VERSION 17 )
2018-11-24 17:40:34 +00:00
else ( )
2022-04-20 12:02:56 +00:00
set ( VERSION_INFO_MINOR_VERSION 17.git- ${ GIT_BRANCH } - ${ GIT_COMMIT_HASH } )
2018-11-24 17:40:34 +00:00
endif ( )
2012-12-24 02:33:50 +00:00
2015-01-13 10:11:23 +00:00
set ( VERSION ${ VERSION_INFO_MAJOR_VERSION } . ${ VERSION_INFO_API_COMPAT } . ${ VERSION_INFO_MINOR_VERSION } )
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
2012-12-24 02:33:50 +00:00
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2012-12-24 02:33:50 +00:00
# Environment setup
2019-03-10 04:36:09 +00:00
################################################################################
2012-12-29 21:07:43 +00:00
include ( ExternalProject )
2019-03-09 00:39:32 +00:00
2013-12-10 20:17:57 +00:00
# Detect 64-bits machine
2018-11-24 17:40:34 +00:00
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
2018-11-19 07:51:05 +00:00
set ( ARCH_64BITS TRUE )
2018-11-24 17:40:34 +00:00
endif ( )
2013-12-10 20:17:57 +00:00
2019-03-10 04:36:09 +00:00
# Set prefix path for PyBOMBS and Snaps, if defined in environment variables
if ( NOT CMAKE_PREFIX_PATH )
if ( DEFINED ENV{PYBOMBS_PREFIX} )
set ( CMAKE_PREFIX_PATH $ENV{ PYBOMBS_PREFIX } )
endif ( )
if ( DEFINED ENV{SNAP} )
set ( CMAKE_PREFIX_PATH $ENV{ SNAP } )
endif ( )
endif ( )
2013-12-10 20:17:57 +00:00
2015-03-20 16:02:41 +00:00
# Detect Linux Distribution
2019-08-11 12:43:26 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2020-01-13 00:49:00 +00:00
include ( DetectLinuxDistro )
2020-02-03 21:39:52 +00:00
if ( CMAKE_CROSSCOMPILING )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be cross-compiled on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}" )
else ( )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}" )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2013-01-19 17:10:57 +00:00
2017-10-30 19:15:12 +00:00
# Detect macOS / Mac OS X Version
2013-01-19 17:10:57 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2020-01-13 00:49:00 +00:00
include ( DetectMacOSVersion )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${MACOS_DISTRIBUTION}" )
2018-11-24 17:40:34 +00:00
endif ( )
2013-01-19 17:10:57 +00:00
2018-08-16 08:02:51 +00:00
# Define extra build types and select Release by default to get optimization flags
include ( GnsssdrBuildTypes )
# Available options:
# - None: nothing set
# - Debug: -O2 -g
# - Release: -O3
# - RelWithDebInfo: -O3 -g
# - MinSizeRel: -Os
# - Coverage: -Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage
# - NoOptWithASM: -O0 -g -save-temps
# - O2WithASM: -O2 -g -save-temps
# - O3WithASM: -O3 -g -save-temps
# - ASAN: -Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer
2018-11-24 17:40:34 +00:00
gnsssdr_check_build_type ( ${ CMAKE_BUILD_TYPE } )
2022-02-09 14:13:48 +00:00
message ( STATUS "Build type set to ${CMAKE_BUILD_TYPE}." )
2020-06-10 15:22:03 +00:00
if ( NOT ( ${ CMAKE_BUILD_TYPE } STREQUAL "Release" ) )
set ( ENABLE_STRIP OFF )
endif ( )
2013-01-19 17:10:57 +00:00
2020-02-02 12:50:39 +00:00
# Enable optimization options in GCC for Release and RelWithDebInfo build types
2020-02-24 10:49:48 +00:00
if ( ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" ) AND ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) )
if ( NOT ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" ) AND NOT ( ${ LINUX_DISTRIBUTION } MATCHES "Gentoo" ) )
# flag -O3 enables tree vectorization
# See https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
set ( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG" )
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG" )
set ( CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG" )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "-O3 -g -DNDEBUG" )
endif ( )
2020-02-02 12:50:39 +00:00
endif ( )
2020-02-28 21:00:36 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2020-06-27 17:51:22 +00:00
# Fix for Debug and None modes in macOS
# without this, get get a runtime error
2020-02-28 21:00:36 +00:00
include ( CheckCXXCompilerFlag )
check_cxx_compiler_flag ( -fstandalone-debug HAVE_STANDALONE_DEBUG )
check_cxx_compiler_flag ( -Og HAVE_OG_FLAG )
if ( HAVE_STANDALONE_DEBUG AND HAVE_OG_FLAG )
set ( CMAKE_CXX_FLAGS_DEBUG "-Og -g -fstandalone-debug" )
set ( CMAKE_C_FLAGS_DEBUG "-Og -g -fstandalone-debug" )
2020-06-27 17:51:22 +00:00
if ( CMAKE_BUILD_TYPE STREQUAL "None" )
add_compile_options ( -Og -fstandalone-debug )
endif ( )
2020-02-28 21:00:36 +00:00
endif ( )
endif ( )
endif ( )
2020-02-02 12:50:39 +00:00
2017-04-14 08:28:57 +00:00
# allow 'large' files in 32 bit builds
if ( UNIX )
2022-12-03 22:55:12 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.12.0 )
add_compile_definitions ( _LARGEFILE_SOURCE _FILE_OFFSET_BITS=64 _LARGE_FILES )
else ( )
add_definitions ( -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2017-08-07 17:29:05 +00:00
2020-06-12 18:51:26 +00:00
# If this is an out-of-tree build, do not pollute the original source directory
2022-07-28 08:37:36 +00:00
if ( ${ GNSSSDR_BINARY_DIR } MATCHES ${ GNSSSDR_SOURCE_DIR } )
set ( LOCAL_INSTALL_BASE_DIR ${ GNSSSDR_SOURCE_DIR } )
2020-06-12 18:51:26 +00:00
else ( )
2022-07-28 08:37:36 +00:00
set ( LOCAL_INSTALL_BASE_DIR ${ GNSSSDR_BINARY_DIR } )
2020-06-12 18:51:26 +00:00
endif ( )
2020-06-12 22:32:40 +00:00
# Determine if CMake scripts make use of target_sources()
if ( CMAKE_VERSION VERSION_GREATER 3.13 )
set ( USE_CMAKE_TARGET_SOURCES ON )
endif ( )
2017-08-07 17:29:05 +00:00
# Determine if we are using make or ninja
2017-07-06 17:29:29 +00:00
if ( CMAKE_MAKE_PROGRAM MATCHES "make" )
2018-11-19 07:51:05 +00:00
set ( CMAKE_MAKE_PROGRAM_PRETTY_NAME "make" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-07-06 17:29:29 +00:00
if ( CMAKE_MAKE_PROGRAM MATCHES "ninja" )
2018-11-19 07:51:05 +00:00
set ( CMAKE_MAKE_PROGRAM_PRETTY_NAME "ninja" )
2018-11-24 17:40:34 +00:00
endif ( )
2019-11-10 13:32:21 +00:00
if ( CMAKE_MAKE_PROGRAM MATCHES "xcodebuild" )
set ( CMAKE_MAKE_PROGRAM_PRETTY_NAME "xcodebuild" )
endif ( )
2017-07-06 17:29:29 +00:00
if ( NOT CMAKE_MAKE_PROGRAM_PRETTY_NAME )
2018-11-19 07:51:05 +00:00
set ( CMAKE_MAKE_PROGRAM_PRETTY_NAME "${CMAKE_MAKE_PROGRAM}" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-04-14 08:28:57 +00:00
2020-01-28 23:29:09 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.12 )
2020-01-28 23:56:19 +00:00
if ( POLICY CMP0057 ) # required by FindDoxygen.cmake module
cmake_policy ( SET CMP0057 NEW ) # Support if() IN_LIST operator, added in CMake 3.3
2020-01-28 23:29:09 +00:00
endif ( )
endif ( )
2020-01-28 23:56:19 +00:00
2016-11-27 22:47:45 +00:00
2014-10-27 04:19:26 +00:00
################################################################################
2017-08-07 17:29:05 +00:00
# Minimum required versions
################################################################################
set ( GNSSSDR_APPLECLANG_MIN_VERSION "500" )
2018-04-03 17:17:44 +00:00
set ( GNSSSDR_ARMADILLO_MIN_VERSION "5.300.0" )
2023-04-04 07:10:15 +00:00
set ( GNSSSDR_BOOST_MIN_VERSION "1.53" )
set ( GNSSSDR_CLANG_MIN_VERSION "3.4.0" )
set ( GNSSSDR_GCC_MIN_VERSION "4.7.2" )
2020-08-13 18:54:22 +00:00
set ( GNSSSDR_GFLAGS_MIN_VERSION "2.1.2" )
2023-04-04 07:10:15 +00:00
set ( GNSSSDR_GNURADIO_MIN_VERSION "3.7.3" )
set ( GNSSSDR_MAKO_MIN_VERSION "0.4.2" )
2018-02-24 17:01:10 +00:00
set ( GNSSSDR_MATIO_MIN_VERSION "1.5.3" )
2019-04-20 13:55:46 +00:00
set ( GNSSSDR_PROTOBUF_MIN_VERSION "3.0.0" )
2023-04-04 07:10:15 +00:00
set ( GNSSSDR_PYTHON_MIN_VERSION "2.7" )
set ( GNSSSDR_PYTHON3_MIN_VERSION "3.4" )
2017-08-07 17:29:05 +00:00
2017-08-08 12:18:19 +00:00
2017-11-04 18:22:40 +00:00
################################################################################
2023-04-04 07:10:15 +00:00
# Versions to download and build (but not to install system-wide) if not found
2017-11-04 18:22:40 +00:00
################################################################################
2023-04-04 07:10:15 +00:00
set ( GNSSSDR_ARMADILLO_LOCAL_VERSION "12.2.x" )
2018-11-12 10:03:50 +00:00
set ( GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2" )
2021-12-25 21:27:26 +00:00
set ( GNSSSDR_GLOG_LOCAL_VERSION "0.6.0" )
2022-04-01 06:33:01 +00:00
set ( GNSSSDR_MATIO_LOCAL_VERSION "1.5.23" )
2023-03-31 11:23:31 +00:00
set ( GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "22.2" )
2023-04-04 07:10:15 +00:00
set ( GNSSSDR_PUGIXML_LOCAL_VERSION "1.13" )
set ( GNSSSDR_GTEST_LOCAL_VERSION "1.13.0" )
set ( GNSSSDR_GNSS_SIM_LOCAL_VERSION "master" )
set ( GNSSSDR_GNSSTK_LOCAL_VERSION "14.0.0" )
2022-11-11 20:36:34 +00:00
set ( GNSSSDR_BENCHMARK_LOCAL_VERSION "1.7.1" )
2020-10-30 11:24:23 +00:00
set ( GNSSSDR_MATHJAX_EXTERNAL_VERSION "2.7.7" )
2017-11-04 18:22:40 +00:00
2023-04-04 07:10:15 +00:00
# Downgrade versions if requirements are not met
2021-12-25 21:27:26 +00:00
if ( CMAKE_VERSION VERSION_LESS "3.16" )
set ( GNSSSDR_GLOG_LOCAL_VERSION "0.5.0" )
endif ( )
2021-05-09 07:27:51 +00:00
if ( CMAKE_VERSION VERSION_LESS "3.3" )
2023-04-04 07:10:15 +00:00
set ( GNSSSDR_GLOG_LOCAL_VERSION "0.4.0" )
2021-05-09 07:27:51 +00:00
endif ( )
2019-11-12 22:17:22 +00:00
if ( CMAKE_VERSION VERSION_LESS "3.0.2" )
set ( GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1" ) # Fix for CentOS 7
set ( GNSSSDR_GLOG_LOCAL_VERSION "0.3.4" ) # Fix for Ubuntu 14.04
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-04 18:22:40 +00:00
2023-04-04 07:10:15 +00:00
if ( CMAKE_CROSSCOMPILING OR CMAKE_VERSION VERSION_LESS "3.13" )
set ( GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.12" )
endif ( )
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0 ) OR
( C M A K E _ C X X _ C O M P I L E R _ I D S T R E Q U A L " C l a n g " A N D C M A K E _ C X X _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S 5 . 0 ) O R
C M A K E _ V E R S I O N V E R S I O N _ L E S S 3 . 5 )
set ( GNSSSDR_GTEST_LOCAL_VERSION "1.10.x" )
endif ( )
if ( CMAKE_VERSION VERSION_LESS "3.17" )
set ( GNSSSDR_GNSSTK_LOCAL_VERSION "13.7.0" )
endif ( )
2017-11-04 18:22:40 +00:00
2014-05-07 20:08:41 +00:00
################################################################################
2017-08-07 17:29:05 +00:00
# Check compiler version
2014-05-07 20:08:41 +00:00
################################################################################
2017-08-07 17:29:05 +00:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
2018-11-19 07:51:05 +00:00
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${ GNSSSDR_GCC_MIN_VERSION } )
message ( STATUS "Your GCC version is too old and does not support some C++ features required by GNSS-SDR. GCC version must be at least ${GNSSSDR_GCC_MIN_VERSION}" )
message ( FATAL_ERROR "Fatal error: GCC >= ${GNSSSDR_GCC_MIN_VERSION} required." )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2017-08-07 17:29:05 +00:00
2018-04-07 15:03:25 +00:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2017-08-07 17:29:05 +00:00
execute_process ( COMMAND
$ { C M A K E _ C X X _ C O M P I L E R } - v
R E S U L T _ V A R I A B L E _ r e s E R R O R _ V A R I A B L E _ e r r
2019-04-02 00:41:20 +00:00
E R R O R _ S T R I P _ T R A I L I N G _ W H I T E S P A C E
)
2017-08-07 17:29:05 +00:00
if ( ${ _res } STREQUAL "0" )
# output is in error stream
string ( REGEX MATCH "^Apple.*" IS_APPLE ${ _err } )
if ( "${IS_APPLE}" STREQUAL "" )
set ( MIN_VERSION ${ GNSSSDR_CLANG_MIN_VERSION } )
set ( APPLE_STR "" )
# retrieve the compiler's version from it
string ( REGEX MATCH "clang version [0-9.]+" CLANG_OTHER_VERSION ${ _err } )
string ( REGEX MATCH "[0-9.]+" CLANG_VERSION ${ CLANG_OTHER_VERSION } )
2018-11-24 17:40:34 +00:00
else ( )
2017-08-07 17:29:05 +00:00
set ( MIN_VERSION ${ GNSSSDR_APPLECLANG_MIN_VERSION } )
set ( APPLE_STR "Apple " )
# retrieve the compiler's version from it
string ( REGEX MATCH "(clang-[0-9.]+)" CLANG_APPLE_VERSION ${ _err } )
string ( REGEX MATCH "[0-9.]+" CLANG_VERSION ${ CLANG_APPLE_VERSION } )
2018-11-24 17:40:34 +00:00
endif ( )
2017-08-07 17:29:05 +00:00
if ( ${ CLANG_VERSION } VERSION_LESS "${MIN_VERSION}" )
message ( WARNING "\nThe compiler selected to build GNSS-SDR (${APPLE_STR}Clang version ${CLANG_VERSION} : ${CMAKE_CXX_COMPILER}) is older than that officially supported (${MIN_VERSION} minimum). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent." )
2018-11-24 17:40:34 +00:00
endif ( )
else ( )
2017-08-07 17:29:05 +00:00
message ( WARNING "\nCannot determine the version of the compiler selected to build GNSS-SDR (${APPLE_STR}Clang : ${CMAKE_CXX_COMPILER}). This build may or not work. We highly recommend using Apple Clang version ${APPLECLANG_MIN_VERSION} or more recent, or Clang version ${CLANG_MIN_VERSION} or more recent." )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2013-01-19 17:10:57 +00:00
2020-06-14 10:57:47 +00:00
# Determine if we use lambdas
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1" )
set ( DO_NOT_USE_LAMBDAS ON )
endif ( )
endif ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if ( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
if ( CLANG_VERSION VERSION_LESS "600" )
set ( DO_NOT_USE_LAMBDAS ON )
endif ( )
else ( )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0" )
set ( DO_NOT_USE_LAMBDAS ON )
endif ( )
endif ( )
endif ( )
# Determine if we try to use generic lambdas
if ( NOT DO_NOT_USE_LAMBDAS )
if ( CMAKE_VERSION VERSION_GREATER 3.1 AND NOT ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND
( C M A K E _ C X X _ C O M P I L E R _ V E R S I O N V E R S I O N _ L E S S 7 . 0 ) ) )
set ( USE_GENERIC_LAMBDAS ON )
endif ( )
endif ( )
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
2014-09-30 23:09:44 +00:00
################################################################################
2019-06-16 07:37:04 +00:00
# Set minimal C and C++ standards
2014-09-30 23:09:44 +00:00
################################################################################
2019-02-17 12:36:13 +00:00
if ( NOT ( CMAKE_VERSION VERSION_LESS "3.1" ) )
set ( CMAKE_C_STANDARD 11 )
2019-02-18 04:51:25 +00:00
set ( CMAKE_CXX_STANDARD 14 )
2019-02-17 12:36:13 +00:00
set ( CMAKE_CXX_EXTENSIONS OFF )
else ( )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:-std=gnu11>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_C_STANDARD 11 ) # set variable just for reporting
2019-02-17 12:36:13 +00:00
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.1.1" )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_CXX_STANDARD 11 ) # set variable just for reporting
2019-02-17 12:36:13 +00:00
else ( )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_CXX_STANDARD 14 ) # set variable just for reporting
2019-02-17 12:36:13 +00:00
endif ( )
endif ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2019-06-16 07:37:04 +00:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" )
2019-02-17 12:36:13 +00:00
if ( CLANG_VERSION VERSION_LESS "600" )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_CXX_STANDARD 11 )
2019-02-17 12:36:13 +00:00
else ( )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_CXX_STANDARD 14 )
2019-02-17 12:36:13 +00:00
endif ( )
else ( )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.5.0" )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++11>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_CXX_STANDARD 11 )
2019-02-17 12:36:13 +00:00
else ( )
2019-02-24 18:17:32 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:-std=c++14>" )
2020-06-17 11:31:02 +00:00
set ( CMAKE_CXX_STANDARD 14 )
2019-02-17 12:36:13 +00:00
endif ( )
endif ( )
endif ( )
endif ( )
# Visibility
# See https://gcc.gnu.org/wiki/Visibility
2019-03-10 22:07:31 +00:00
if ( POLICY CMP0063 )
2019-02-17 12:36:13 +00:00
cmake_policy ( SET CMP0063 NEW )
set ( CMAKE_CXX_VISIBILITY_PRESET hidden )
set ( CMAKE_C_VISIBILITY_PRESET hidden )
set ( CMAKE_VISIBILITY_INLINES_HIDDEN 1 )
else ( )
if ( ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
add_definitions ( -fvisibility=hidden )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2014-09-30 23:09:44 +00:00
2016-11-27 22:47:45 +00:00
2014-09-30 23:09:44 +00:00
################################################################################
# Check if the compiler defines the architecture as ARM
################################################################################
2023-01-26 17:39:25 +00:00
if ( CMAKE_SYSTEM_PROCESSOR MATCHES "(^arm)|(^aarch64)" )
set ( IS_ARM TRUE )
endif ( )
2020-01-13 00:49:00 +00:00
if ( NOT ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" ) )
2016-12-20 01:35:52 +00:00
if ( CMAKE_CROSSCOMPILING )
2019-02-03 20:12:24 +00:00
if ( NOT CMAKE_NO_SYSTEM_FROM_IMPORTED )
set ( CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE )
endif ( )
2021-07-25 10:30:39 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2014-09-30 23:09:44 +00:00
2023-01-26 17:39:25 +00:00
2020-02-20 18:51:57 +00:00
################################################################################
# pkg-config - Helper tool used when compiling applications and libraries.
################################################################################
set ( PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE )
2020-05-14 21:17:09 +00:00
set ( FPHSA_NAME_MISMATCHED ON )
2020-02-20 18:51:57 +00:00
find_package ( PkgConfig )
2014-09-30 23:09:44 +00:00
2016-11-27 22:47:45 +00:00
2023-01-26 17:39:25 +00:00
2017-11-25 19:09:10 +00:00
################################################################################
2017-11-25 23:18:21 +00:00
# Find the POSIX thread (pthread) libraries
2017-11-25 19:09:10 +00:00
################################################################################
2017-11-25 23:18:21 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.1 )
2019-02-07 14:21:47 +00:00
# Workaround for CMake < 3.1
2017-11-25 20:47:39 +00:00
find_package ( Threads REQUIRED )
2019-02-07 14:21:47 +00:00
add_library ( Threads::Threads SHARED IMPORTED )
set_property ( TARGET Threads::Threads PROPERTY INTERFACE_LINK_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}" )
set_property ( TARGET Threads::Threads PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX" )
include ( GNUInstallDirs )
2019-02-07 19:52:24 +00:00
# Fix bug in Debian 8.11
if ( ${ LINUX_DISTRIBUTION } MATCHES "Debian" )
if ( ${ LINUX_VER } VERSION_LESS 8.12 )
if ( ARCH_64BITS )
set ( FIX_PTHREADS_LOCATION "x86_64-linux-gnu/" )
endif ( )
endif ( )
endif ( )
set_property ( TARGET Threads::Threads PROPERTY IMPORTED_LOCATION /usr/ ${ CMAKE_INSTALL_LIBDIR } / ${ FIX_PTHREADS_LOCATION } ${ CMAKE_FIND_LIBRARY_PREFIXES } pthread ${ CMAKE_SHARED_LIBRARY_SUFFIX } )
2018-11-24 17:40:34 +00:00
else ( )
2017-11-25 23:18:21 +00:00
set ( CMAKE_THREAD_PREFER_PTHREAD TRUE )
if ( CMAKE_CROSSCOMPILING )
set ( THREADS_PREFER_PTHREAD_FLAG FALSE )
2018-11-24 17:40:34 +00:00
else ( )
2017-11-25 23:18:21 +00:00
set ( THREADS_PREFER_PTHREAD_FLAG TRUE )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-25 23:18:21 +00:00
find_package ( Threads REQUIRED )
2018-11-24 17:40:34 +00:00
endif ( )
2019-03-09 00:39:32 +00:00
set_package_properties ( Threads PROPERTIES
U R L " h t t p s : / / c o m p u t i n g . l l n l . g o v / t u t o r i a l s / p t h r e a d s / "
D E S C R I P T I O N " I m p l e m e n t s t h e P O S I X T h r e a d s e x e c u t i o n m o d e l "
P U R P O S E " U s e d t o i m p l e m e n t p a r a l l e l i s m . "
2019-03-10 04:36:09 +00:00
T Y P E R E Q U I R E D
2019-03-09 00:39:32 +00:00
)
2016-11-27 22:47:45 +00:00
2017-08-08 12:18:19 +00:00
2012-12-25 10:28:29 +00:00
################################################################################
2015-08-24 11:17:48 +00:00
# Googletest - https://github.com/google/googletest
2012-12-25 10:28:29 +00:00
################################################################################
2012-12-28 15:40:03 +00:00
enable_testing ( )
2016-10-01 23:59:12 +00:00
if ( ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING )
2019-04-02 01:31:46 +00:00
if ( NOT GTEST_DIR )
if ( DEFINED ENV{GTEST_DIR} )
set ( GTEST_DIR $ENV{ GTEST_DIR } )
message ( STATUS "Googletest root folder set at ${GTEST_DIR}" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
endif ( )
2012-12-25 10:28:29 +00:00
2019-03-09 00:39:32 +00:00
find_package ( GOOGLETEST )
set_package_properties ( GOOGLETEST PROPERTIES
2019-03-10 04:36:09 +00:00
P U R P O S E " U s e d f o r U n i t a n d S y s t e m T e s t s . "
2019-03-09 00:39:32 +00:00
T Y P E R E Q U I R E D
)
2019-03-10 04:36:09 +00:00
if ( NOT GOOGLETEST_FOUND )
2019-03-09 00:39:32 +00:00
set_package_properties ( GOOGLETEST PROPERTIES
2021-05-11 09:56:01 +00:00
P U R P O S E " G o o g l e t e s t v $ { G N S S S D R _ G T E S T _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-03-09 00:39:32 +00:00
)
endif ( )
2012-12-25 10:28:29 +00:00
2013-07-04 13:47:40 +00:00
2021-10-23 12:16:54 +00:00
################################################################################
# VOLK - Vector-Optimized Library of Kernels
################################################################################
find_package ( VOLK )
if ( NOT VOLK_FOUND )
message ( FATAL_ERROR "*** VOLK is required to build gnss-sdr" )
endif ( )
set_package_properties ( VOLK PROPERTIES
P U R P O S E " P r o v i d e s a n a b s t r a c t i o n o f o p t i m i z e d m a t h r o u t i n e s t a r g e t i n g s e v e r a l S I M D p r o c e s s o r s . "
T Y P E R E Q U I R E D
)
2013-01-19 17:10:57 +00:00
################################################################################
2020-02-05 20:24:46 +00:00
# GNU Radio - https://www.gnuradio.org
2013-01-19 17:10:57 +00:00
################################################################################
2022-08-10 23:37:57 +00:00
list ( APPEND GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS FFT FILTER ANALOG )
2019-03-09 00:39:32 +00:00
find_package ( UHD )
2019-03-10 04:36:09 +00:00
set_package_properties ( UHD PROPERTIES
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h f r o n t - e n d s o f t h e U S R P f a m i l y . "
T Y P E O P T I O N A L
)
2019-03-09 00:39:32 +00:00
if ( ENABLE_UHD )
if ( NOT UHD_FOUND )
set ( ENABLE_UHD OFF )
2018-11-24 17:40:34 +00:00
else ( )
2022-08-10 23:37:57 +00:00
list ( APPEND GR_REQUIRED_COMPONENTS UHD )
2019-03-09 00:39:32 +00:00
endif ( )
endif ( )
2023-01-30 08:15:43 +00:00
find_package ( ZEROMQ )
set_package_properties ( ZEROMQ PROPERTIES
P U R P O S E " U s e d b y t h e Z M Q _ S i g n a l _ S o u r c e . "
T Y P E O P T I O N A L
)
2022-08-10 23:37:57 +00:00
if ( ENABLE_ZMQ )
2023-01-30 08:15:43 +00:00
if ( NOT ZEROMQ_FOUND )
set ( ENABLE_ZMQ OFF )
else ( )
list ( APPEND GR_REQUIRED_COMPONENTS ZEROMQ )
endif ( )
2022-08-10 23:37:57 +00:00
endif ( )
2018-11-21 07:28:50 +00:00
find_package ( GNURADIO )
2019-03-10 04:36:09 +00:00
set_package_properties ( GNURADIO PROPERTIES
P U R P O S E " I m p l e m e n t s f l o w g r a p h s c h e d u l e r , p r o v i d e s s o m e p r o c e s s i n g b l o c k s a n d c l a s s e s t o c r e a t e n e w o n e s . "
T Y P E R E Q U I R E D
)
2019-03-09 00:39:32 +00:00
2020-06-13 08:56:49 +00:00
if ( NOT ( GNURADIO_VERSION VERSION_LESS "3.8" ) )
set ( GNURADIO_IS_38_OR_GREATER ON )
endif ( )
2014-11-17 19:42:50 +00:00
2016-01-06 01:05:34 +00:00
2020-08-19 13:24:09 +00:00
2019-06-10 19:41:13 +00:00
################################################################################
2019-06-16 07:37:04 +00:00
# Detect availability of std::filesystem and set C++ standard accordingly
2019-06-10 19:41:13 +00:00
################################################################################
set ( FILESYSTEM_FOUND FALSE )
2022-07-04 08:05:54 +00:00
if ( NOT ENABLE_OWN_GNSSTK )
2022-07-10 19:15:15 +00:00
unset ( Gnsstk::gnsstk CACHE )
2022-07-26 22:23:54 +00:00
unset ( GNSSTK_FOUND CACHE )
unset ( GNSSTK_OLDER_THAN_8 CACHE )
unset ( GNSSTK_OLDER_THAN_9 CACHE )
unset ( GNSSTK_OLDER_THAN_13 CACHE )
2022-07-04 08:05:54 +00:00
find_package ( GNSSTK )
set_package_properties ( GNSSTK PROPERTIES
2020-12-02 13:27:59 +00:00
P U R P O S E " U s e d i n s o m e E x t r a T e s t s . "
)
2022-07-10 19:15:15 +00:00
else ( )
unset ( Gnsstk::gnsstk CACHE )
unset ( GNSSTK_FOUND CACHE )
unset ( GNSSTK_OLDER_THAN_8 CACHE )
unset ( GNSSTK_OLDER_THAN_9 CACHE )
unset ( GNSSTK_OLDER_THAN_13 CACHE )
2020-12-02 13:27:59 +00:00
endif ( )
2021-11-23 17:53:56 +00:00
if ( NOT ( GNURADIO_VERSION VERSION_LESS 3.8 ) AND ( LOG4CPP_READY_FOR_CXX17 OR GNURADIO_USES_SPDLOG ) )
2019-06-10 19:41:13 +00:00
# Check if we have std::filesystem
if ( NOT ( CMAKE_VERSION VERSION_LESS 3.8 ) )
2022-07-05 11:46:58 +00:00
if ( NOT GNSSTK_FOUND OR NOT ( GNSSTK_FOUND AND GNSSTK_OLDER_THAN_8 ) ) # Fix for GNSSTk < 8.0.0
2020-06-12 18:51:26 +00:00
find_package ( FILESYSTEM COMPONENTS Final Experimental )
set_package_properties ( FILESYSTEM PROPERTIES
U R L " h t t p s : / / e n . c p p r e f e r e n c e . c o m / w / c p p / f i l e s y s t e m "
D E S C R I P T I O N " P r o v i d e s f a c i l i t i e s f o r p e r f o r m i n g o p e r a t i o n s o n f i l e s y s t e m s a n d t h e i r c o m p o n e n t s "
P U R P O S E " W o r k w i t h p a t h s , r e g u l a r f i l e s , a n d d i r e c t o r i e s . "
T Y P E O P T I O N A L
)
2022-07-05 11:46:58 +00:00
endif ( )
2020-12-02 13:27:59 +00:00
if ( FILESYSTEM_FOUND )
2021-04-26 07:33:36 +00:00
set ( CMAKE_CXX_STANDARD 17 )
2022-12-17 08:16:51 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.13 )
if ( ( ( NOT UHD_FOUND ) OR ( UHD_FOUND AND ( "${UHD_VERSION}" VERSION_GREATER 4.2.99 ) ) ) AND ( GNURADIO_VERSION VERSION_GREATER 3.10.3.99 ) )
set ( CMAKE_CXX_STANDARD 20 )
# if(CMAKE_VERSION VERSION_GREATER 3.20.99)
2021-12-17 18:48:11 +00:00
# if(((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "11.0.0")) OR
# ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.0")))
# set(CMAKE_CXX_STANDARD 23)
# endif()
2022-12-17 08:16:51 +00:00
# endif()
endif ( )
endif ( )
2019-10-30 10:50:02 +00:00
set ( CMAKE_CXX_STANDARD_REQUIRED ON )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
endif ( )
2021-10-30 03:43:22 +00:00
if ( ( NOT PMT_USES_BOOST_ANY ) AND ( CMAKE_CXX_STANDARD VERSION_LESS 17 ) )
message ( FATAL_ERROR "GNU Radio v${GNURADIO_VERSION} requires C++17. Please update your environment." )
endif ( )
2012-12-25 10:28:29 +00:00
2013-07-04 13:47:40 +00:00
2021-11-23 15:38:50 +00:00
2013-07-04 13:47:40 +00:00
################################################################################
2018-05-13 19:16:09 +00:00
# Boost - https://www.boost.org
2013-07-04 13:47:40 +00:00
################################################################################
if ( UNIX AND EXISTS "/usr/lib64" )
2013-12-14 10:23:33 +00:00
list ( APPEND BOOST_LIBRARYDIR "/usr/lib64" ) # Fedora 64-bit fix
2018-11-24 17:40:34 +00:00
endif ( )
2019-11-24 20:20:37 +00:00
# Boost_ADDITIONAL_VERSIONS is only used internally by cmake to know the
# formation of newer versions. No need to increase, not used anymore since newer
# Boost provides its own CMake configuration files.
2013-07-04 13:47:40 +00:00
set ( Boost_ADDITIONAL_VERSIONS
2019-06-10 19:41:13 +00:00
" 1 . 5 3 . 0 " " 1 . 5 3 " " 1 . 5 4 . 0 " " 1 . 5 4 "
2013-07-04 13:47:40 +00:00
" 1 . 5 5 . 0 " " 1 . 5 5 " " 1 . 5 6 . 0 " " 1 . 5 6 " " 1 . 5 7 . 0 " " 1 . 5 7 " " 1 . 5 8 . 0 " " 1 . 5 8 " " 1 . 5 9 . 0 " " 1 . 5 9 "
" 1 . 6 0 . 0 " " 1 . 6 0 " " 1 . 6 1 . 0 " " 1 . 6 1 " " 1 . 6 2 . 0 " " 1 . 6 2 " " 1 . 6 3 . 0 " " 1 . 6 3 " " 1 . 6 4 . 0 " " 1 . 6 4 "
" 1 . 6 5 . 0 " " 1 . 6 5 " " 1 . 6 6 . 0 " " 1 . 6 6 " " 1 . 6 7 . 0 " " 1 . 6 7 " " 1 . 6 8 . 0 " " 1 . 6 8 " " 1 . 6 9 . 0 " " 1 . 6 9 "
2019-11-24 20:20:37 +00:00
" 1 . 7 0 . 0 " " 1 . 7 0 " " 1 . 7 1 . 0 " " 1 . 7 1 "
2013-07-04 13:47:40 +00:00
)
set ( Boost_USE_MULTITHREAD ON )
2019-06-10 19:41:13 +00:00
set ( BOOST_COMPONENTS atomic chrono date_time serialization system thread )
if ( NOT ${ FILESYSTEM_FOUND } )
set ( BOOST_COMPONENTS ${ BOOST_COMPONENTS } filesystem )
endif ( )
find_package ( Boost ${ GNSSSDR_BOOST_MIN_VERSION } COMPONENTS ${ BOOST_COMPONENTS } REQUIRED )
2019-06-16 21:28:24 +00:00
2013-07-04 13:47:40 +00:00
if ( NOT Boost_FOUND )
2018-11-19 07:51:05 +00:00
message ( FATAL_ERROR "Fatal error: Boost (version >=${GNSSSDR_BOOST_MIN_VERSION}) required." )
2018-11-24 17:40:34 +00:00
endif ( )
2013-07-04 13:47:40 +00:00
2019-06-10 19:41:13 +00:00
set_package_properties ( Boost PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g "
P U R P O S E " U s e d w i d e l y a c r o s s t h e s o u r c e c o d e . "
T Y P E R E Q U I R E D
)
2013-07-04 13:47:40 +00:00
2019-07-22 12:13:57 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.14 )
set ( Boost_VERSION_STRING "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}" )
2019-06-10 19:41:13 +00:00
endif ( )
2019-07-22 12:46:36 +00:00
if ( POLICY CMP0093 )
cmake_policy ( SET CMP0093 NEW ) # FindBoost reports Boost_VERSION in x.y.z format.
endif ( )
2019-07-22 12:13:57 +00:00
set_package_properties ( Boost PROPERTIES
D E S C R I P T I O N " P o r t a b l e C + + s o u r c e libraries ( found: v ${ Boost_VERSION_STRING } ) "
)
2016-11-27 22:47:45 +00:00
2019-09-08 12:51:19 +00:00
# Define targets if CMake < 3.5
2019-06-10 19:41:13 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.5 )
if ( NOT TARGET Boost::date_time )
add_library ( Boost::date_time SHARED IMPORTED )
set_target_properties ( Boost::date_time PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ D A T E _ T I M E _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ D A T E _ T I M E _ L I B R A R I E S }
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-06-10 19:41:13 +00:00
if ( NOT TARGET Boost::system )
add_library ( Boost::system SHARED IMPORTED )
set_target_properties ( Boost::system PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ S Y S T E M _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ S Y S T E M _ L I B R A R I E S }
)
endif ( )
if ( NOT TARGET Boost::thread )
add_library ( Boost::thread SHARED IMPORTED )
set_target_properties ( Boost::thread PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ T H R E A D _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ T H R E A D _ L I B R A R I E S }
)
endif ( )
if ( NOT TARGET Boost::serialization )
add_library ( Boost::serialization SHARED IMPORTED )
set_target_properties ( Boost::serialization PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ S E R I A L I Z A T I O N _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ S E R I A L I Z A T I O N _ L I B R A R I E S }
)
endif ( )
if ( NOT TARGET Boost::chrono )
add_library ( Boost::chrono SHARED IMPORTED )
set_target_properties ( Boost::chrono PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ C H R O N O _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ C H R O N O _ L I B R A R I E S }
)
endif ( )
if ( NOT TARGET Boost::atomic )
add_library ( Boost::atomic SHARED IMPORTED )
set_target_properties ( Boost::atomic PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ A T O M I C _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ A T O M I C _ L I B R A R I E S }
)
endif ( )
if ( NOT ${ FILESYSTEM_FOUND } )
if ( NOT TARGET Boost::filesystem )
add_library ( Boost::filesystem SHARED IMPORTED )
set_target_properties ( Boost::filesystem PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B o o s t _ F I L E S Y S T E M _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ F I L E S Y S T E M _ L I B R A R I E S }
)
2019-08-12 09:33:51 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2019-09-08 12:51:19 +00:00
# Define Boost::headers target if CMake < 3.15
2019-09-07 10:36:19 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.15 )
if ( NOT TARGET Boost::headers )
2019-09-07 11:35:43 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.0 )
2019-09-07 12:21:15 +00:00
add_library ( Boost::headers SHARED IMPORTED ) # Trick for CMake 2.8.12
set_target_properties ( Boost::headers PROPERTIES
2019-09-07 11:35:43 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
I M P O R T E D _ L O C A T I O N $ { B o o s t _ D A T E _ T I M E _ L I B R A R I E S }
)
else ( )
add_library ( Boost::headers INTERFACE IMPORTED )
2019-09-07 11:39:48 +00:00
set_target_properties ( Boost::headers PROPERTIES
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { B o o s t _ I N C L U D E _ D I R }
2019-09-07 11:35:43 +00:00
)
endif ( )
2019-09-07 10:36:19 +00:00
endif ( )
endif ( )
2013-12-10 20:17:57 +00:00
2019-09-08 12:51:19 +00:00
# Provide package descriptions if Boost >= 1.71.00
if ( Boost_VERSION_STRING VERSION_GREATER 1.70.99 )
set_package_properties ( boost_headers PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / "
D E S C R I P T I O N " H e a d e r f i l e s o f B o o s t l i b r a r i e s "
P U R P O S E " U s e d w i d e l y a c r o s s t h e s o u r c e c o d e . "
T Y P E R E Q U I R E D
)
set_package_properties ( boost_atomic PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / d o c / h t m l / a t o m i c . h t m l "
D E S C R I P T I O N " P r o v i d e s a t o m i c d a t a t y p e s a n d o p e r a t i o n s o n t h o s e t y p e s "
P U R P O S E " R e q u i r e d b y B o o s t T h r e a d . "
T Y P E R E Q U I R E D
)
set_package_properties ( boost_chrono PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / d o c / h t m l / c h r o n o . h t m l "
D E S C R I P T I O N " U s e f u l t i m e u t i l i t i e s "
P U R P O S E " R e q u i r e d b y B o o s t T h r e a d . "
T Y P E R E Q U I R E D
)
set_package_properties ( boost_date_time PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / d o c / h t m l / d a t e _ t i m e . h t m l "
D E S C R I P T I O N " A s e t o f d a t e - t i m e l i b r a r i e s "
P U R P O S E " R e q u i r e d b y B o o s t T h r e a d . "
T Y P E R E Q U I R E D
)
set_package_properties ( boost_serialization PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / l i b s / s e r i a l i z a t i o n / d o c / i n d e x . h t m l "
D E S C R I P T I O N " R e v e r s i b l e d e c o n s t r u c t i o n o f C + + d a t a s t r u c t u r e s t o s e q u e n c e s o f b y t e s "
P U R P O S E " U s e d f o r s e r i a l i z i n g d a t a . "
T Y P E R E Q U I R E D
)
set_package_properties ( boost_system PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / l i b s / s y s t e m / d o c / h t m l / s y s t e m . h t m l "
D E S C R I P T I O N " E x t e n s i b l e e r r o r r e p o r t i n g l i b r a r y "
P U R P O S E " U s e d f o r e r r o r r e p o r t i n g . "
T Y P E R E Q U I R E D
)
set_package_properties ( boost_thread PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / d o c / h t m l / t h r e a d . h t m l "
D E S C R I P T I O N " P o r t a b l e C + + m u l t i - t h r e a d i n g "
P U R P O S E " U s e d b y G N U R a d i o m u l t i - t h r e a d i n g s y s t e m . "
T Y P E R E Q U I R E D
)
if ( NOT ${ FILESYSTEM_FOUND } )
set_package_properties ( boost_filesystem PROPERTIES
U R L " h t t p s : / / w w w . b o o s t . o r g / d o c / l i b s / r e l e a s e / l i b s / f i l e s y s t e m / d o c / i n d e x . h t m "
D E S C R I P T I O N " P o r t a b l e f a c i l i t i e s t o m a n i p u l a t e p a t h s a n d f i l e s "
P U R P O S E " U s e d f o r o u t p u t f i l e h a n d l i n g . "
T Y P E R E Q U I R E D
)
endif ( )
endif ( )
2020-06-12 22:32:40 +00:00
if ( Boost_VERSION_STRING VERSION_LESS 1.58.0 )
set ( USE_OLD_BOOST_MATH_COMMON_FACTOR ON )
endif ( )
if ( Boost_VERSION_STRING VERSION_GREATER 1.65.99 )
set ( USE_BOOST_ASIO_IO_CONTEXT ON )
endif ( )
2020-05-15 20:04:32 +00:00
if ( Boost_VERSION_STRING VERSION_LESS 1.73 )
# Disable concepts to address https://github.com/boostorg/asio/issues/312
2020-06-08 18:04:01 +00:00
if ( ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.9 ) OR
C M A K E _ C X X _ C O M P I L E R _ I D M A T C H E S " C l a n g " ) AND ( CMAKE_VERSION VERSION_GREATER 3.11 ) )
2020-05-15 20:04:32 +00:00
target_compile_definitions ( Boost::headers
I N T E R F A C E
- D B O O S T _ A S I O _ D I S A B L E _ C O N C E P T S
)
endif ( )
2020-05-14 20:33:54 +00:00
endif ( )
# Workaround for https://github.com/boostorg/format/issues/67
2020-06-06 18:07:00 +00:00
if ( ( Boost_VERSION_STRING VERSION_GREATER 1.71 ) AND ( Boost_VERSION_STRING VERSION_LESS 1.73 ) )
2020-06-12 18:51:26 +00:00
if ( CMAKE_CXX_STANDARD VERSION_GREATER 17 )
set ( CMAKE_CXX_STANDARD 17 )
endif ( )
2020-05-14 20:33:54 +00:00
endif ( )
2019-06-10 19:41:13 +00:00
# Fix for Boost Asio < 1.70 when using Clang in macOS
2019-07-22 12:13:57 +00:00
if ( Boost_VERSION_STRING VERSION_LESS 1.70.0 )
2019-06-10 19:41:13 +00:00
# Check if we have std::string_view
2020-06-12 18:51:26 +00:00
unset ( has_string_view CACHE )
2019-06-10 19:41:13 +00:00
include ( CheckCXXSourceCompiles )
check_cxx_source_compiles ( "
#include <string_view>
i n t main ( )
{ s t d : : s t r i n g _ v i e w s v ; } "
h a s _ s t r i n g _ v i e w
)
2013-07-06 02:15:09 +00:00
endif ( )
2013-01-01 11:24:42 +00:00
2020-08-19 13:24:09 +00:00
# Fox for CentOS 7 with cmake3 and gcc8
if ( Boost_VERSION_STRING VERSION_LESS "1.60" )
2020-08-19 15:24:43 +00:00
set ( USE_GENERIC_LAMBDAS OFF )
2020-08-19 13:24:09 +00:00
endif ( )
2020-06-12 22:32:40 +00:00
# Fix for Boost >= 1.73
if ( Boost_VERSION_STRING VERSION_GREATER 1.72.99 )
set ( USE_BOOST_BIND_PLACEHOLDERS ON )
endif ( )
2014-11-17 19:42:50 +00:00
2016-01-06 01:05:34 +00:00
2020-05-14 20:33:54 +00:00
################################################################################
# Detect availability of std::span
################################################################################
2020-06-12 18:51:26 +00:00
unset ( has_span CACHE )
2020-06-16 11:07:13 +00:00
include ( CheckCXXSourceCompiles )
2020-05-14 20:33:54 +00:00
check_cxx_source_compiles ( "
#include <span>
i n t main ( )
{ s t d : : s p a n < f l o a t > s ; } "
h a s _ s p a n
)
2020-06-16 10:22:37 +00:00
################################################################################
# Detect availability of std::rotl
################################################################################
unset ( has_rotl CACHE )
if ( CMAKE_CXX_STANDARD VERSION_GREATER 17 )
check_cxx_source_compiles ( "
#include <bit>
#include <cstdint>
i n t main ( )
{
s t d : : u i n t 8 _ t i = 0 b 0 0 0 1 1 1 0 1 ;
a u t o k = s t d : : rotl ( i,0 ) ;
} "
h a s _ r o t l
)
endif ( )
2020-06-12 18:51:26 +00:00
################################################################################
# Detect availability of std::put_time (Workaround for gcc < 5.0)
################################################################################
check_cxx_source_compiles ( "
#include <iomanip>
i n t main ( )
{ s t d : : put_time ( nullptr, \"\"); } "
h a s _ p u t _ t i m e
)
2020-06-30 11:41:20 +00:00
################################################################################
# Detect availability of std::plus without class specifier
################################################################################
unset ( has_std_plus_void CACHE )
if ( CMAKE_CXX_STANDARD VERSION_GREATER 11 )
include ( CheckCXXSourceCompiles )
check_cxx_source_compiles ( "
2020-07-02 05:08:53 +00:00
#include <functional>
2020-06-30 11:41:20 +00:00
i n t main ( )
{ [ ] ( f l o a t a = 1 , f l o a t b = 0 ) { r e t u r n s t d : : p l u s < > ( ) ; } ; } ; "
h a s _ s t d _ p l u s _ v o i d
)
endif ( )
2020-07-01 21:05:33 +00:00
################################################################################
# Detect availability of std::transform_reduce
################################################################################
unset ( has_transform_reduce CACHE )
unset ( has_transform_reduce_with_execution_policy CACHE )
if ( CMAKE_CXX_STANDARD VERSION_GREATER 14 )
include ( CheckCXXSourceCompiles )
check_cxx_source_compiles ( "
2020-07-01 21:28:00 +00:00
#include <functional>
2020-07-01 21:05:33 +00:00
#include <numeric>
#include <vector>
i n t main ( )
{
s t d : : v e c t o r < f l o a t > a ( 5 ) ;
s t d : : v e c t o r < f l o a t > b ( 5 ) ;
a u t o c = s t d : : transform_reduce ( cbegin(a ) , cend ( a ) , cbegin ( b ) , 0 , s t d : : p l u s < > { } , s t d : : m u l t i p l i e s < > { } ) ; } ; "
h a s _ t r a n s f o r m _ r e d u c e
)
check_cxx_source_compiles ( "
#include <execution>
2020-07-01 21:28:00 +00:00
#include <functional>
2020-07-01 21:05:33 +00:00
#include <numeric>
#include <vector>
i n t main ( )
{
s t d : : v e c t o r < f l o a t > a ( 5 ) ;
s t d : : v e c t o r < f l o a t > b ( 5 ) ;
a u t o c = s t d : : transform_reduce ( std::execution::par, cbegin(a ) , cend ( a ) , cbegin ( b ) , 0 , s t d : : p l u s < > { } , s t d : : m u l t i p l i e s < > { } ) ; } ; "
h a s _ t r a n s f o r m _ r e d u c e _ w i t h _ e x e c u t i o n _ p o l i c y
)
endif ( )
2014-10-28 00:00:04 +00:00
################################################################################
2014-11-07 17:23:59 +00:00
# volk_gnsssdr module - GNSS-SDR's own VOLK library
2014-10-28 00:00:04 +00:00
################################################################################
2018-11-21 07:28:50 +00:00
find_package ( VOLKGNSSSDR )
2019-03-10 04:36:09 +00:00
set_package_properties ( VOLKGNSSSDR PROPERTIES
P U R P O S E " A c c e l e r a t e s m a t h r o u t i n e s t a r g e t i n g s e v e r a l S I M D p r o c e s s o r s . "
T Y P E R E Q U I R E D
)
2018-11-21 07:28:50 +00:00
if ( NOT VOLKGNSSSDR_FOUND )
2019-03-09 00:39:32 +00:00
message ( STATUS " volk_gnsssdr will be built along with gnss-sdr when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2016-12-25 19:40:29 +00:00
###############################
# Find Python required modules
###############################
2018-07-27 08:38:32 +00:00
include ( SetupPython ) # sets PYTHON_EXECUTABLE and search for required modules
2016-12-25 19:40:29 +00:00
if ( NOT PYTHON_MIN_VER_FOUND )
2017-08-07 17:29:05 +00:00
message ( FATAL_ERROR "Python ${GNSSSDR_PYTHON_MIN_VERSION} or greater required to build VOLK_GNSSSDR" )
2016-12-25 19:40:29 +00:00
endif ( )
2018-07-27 08:38:32 +00:00
if ( ${ PYTHON3 } )
set ( PYTHON_NAME "python3" )
2018-11-24 17:40:34 +00:00
else ( )
2018-07-27 08:38:32 +00:00
set ( PYTHON_NAME "python" )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-25 19:40:29 +00:00
# Mako
if ( NOT MAKO_FOUND )
2020-02-05 09:20:32 +00:00
message ( STATUS "Mako template library not found. See https://www.makotemplates.org/" )
2016-12-26 10:42:38 +00:00
message ( STATUS " You can try to install it by typing:" )
2020-05-10 15:31:39 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( STATUS " sudo yum install ${PYTHON_NAME}-mako" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( STATUS " sudo zypper install ${PYTHON_NAME}-Mako" )
else ( )
message ( STATUS " sudo apt-get install ${PYTHON_NAME}-mako" )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-25 19:40:29 +00:00
message ( FATAL_ERROR "Mako templates required to build VOLK_GNSSSDR" )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-26 11:42:20 +00:00
2020-05-10 15:31:39 +00:00
if ( PYTHON_NAME STREQUAL "python" )
# Six
if ( NOT SIX_FOUND )
message ( STATUS "python-six not found. See https://pythonhosted.org/six/" )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
message ( STATUS " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( STATUS " sudo yum install ${PYTHON_NAME}-six" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( STATUS " sudo zypper install ${PYTHON_NAME}-six" )
else ( )
message ( STATUS " sudo apt-get install ${PYTHON_NAME}-six" )
endif ( )
endif ( )
message ( FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2020-05-10 15:31:39 +00:00
2019-06-19 10:46:15 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.12 )
2019-06-19 09:59:41 +00:00
set_package_properties ( Python3 PROPERTIES
2019-06-18 06:59:06 +00:00
U R L " h t t p s : / / w w w . p y t h o n . o r g / "
P U R P O S E " R e q u i r e d t o b u i l d v o l k _ g n s s s d r . "
T Y P E R E Q U I R E D
)
2019-06-19 10:46:15 +00:00
if ( Python3_FOUND )
set_package_properties ( Python3 PROPERTIES
2019-06-26 19:07:59 +00:00
D E S C R I P T I O N " A n i n t e r p r e t e d , h i g h - l e v e l , g e n e r a l - p u r p o s e p r o g r a m m i n g language ( found: v ${ Python3_VERSION } ) "
2019-06-19 10:46:15 +00:00
)
else ( )
set_package_properties ( Python3 PROPERTIES
D E S C R I P T I O N " A n i n t e r p r e t e d , h i g h - l e v e l , g e n e r a l - p u r p o s e p r o g r a m m i n g l a n g u a g e "
P U R P O S E " A n o t h e r P y t h o n v e r s i o n w i l l b e u s e d . "
)
endif ( )
if ( Python2_FOUND )
set_package_properties ( Python2 PROPERTIES
U R L " h t t p s : / / w w w . p y t h o n . o r g / "
2019-06-26 19:07:59 +00:00
D E S C R I P T I O N " A n i n t e r p r e t e d , h i g h - l e v e l , g e n e r a l - p u r p o s e p r o g r a m m i n g language ( found: v ${ Python2_VERSION } ) "
2019-06-19 10:46:15 +00:00
P U R P O S E " R e q u i r e d t o b u i l d v o l k _ g n s s s d r . "
T Y P E R E Q U I R E D
)
endif ( )
2019-06-18 06:59:06 +00:00
endif ( )
2019-03-09 18:45:24 +00:00
2019-06-18 06:59:06 +00:00
if ( PYTHONINTERP_FOUND )
set_package_properties ( PythonInterp PROPERTIES
U R L " h t t p s : / / w w w . p y t h o n . o r g / "
2019-06-26 19:07:59 +00:00
D E S C R I P T I O N " A n i n t e r p r e t e d , h i g h - l e v e l , g e n e r a l - p u r p o s e p r o g r a m m i n g language ( found: v ${ PYTHON_VERSION_STRING } ) "
2019-06-18 06:59:06 +00:00
P U R P O S E " R e q u i r e d t o b u i l d v o l k _ g n s s s d r . "
T Y P E R E Q U I R E D
)
endif ( )
2016-12-26 11:42:20 +00:00
2020-02-29 13:33:09 +00:00
set ( STRIP_VOLK_GNSSSDR_PROFILE "" )
2020-06-10 15:22:03 +00:00
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
2022-12-17 08:16:51 +00:00
set ( STRIP_VOLK_GNSSSDR_PROFILE -DENABLE_STRIP= ${ ENABLE_STRIP } )
2020-06-10 15:22:03 +00:00
if ( ENABLE_PACKAGING )
2022-12-17 08:16:51 +00:00
set ( STRIP_VOLK_GNSSSDR_PROFILE ${ STRIP_VOLK_GNSSSDR_PROFILE } -DCMAKE_VERBOSE_MAKEFILE=ON )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2016-12-26 11:42:20 +00:00
2017-06-21 06:54:47 +00:00
set ( VOLK_GNSSSDR_BUILD_COMMAND "${CMAKE_MAKE_PROGRAM}" )
2016-12-25 19:40:29 +00:00
if ( PYTHON_EXECUTABLE )
set ( USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}" )
2018-11-24 17:40:34 +00:00
endif ( )
2022-12-03 22:55:12 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
set ( VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild"
" - c o n f i g u r a t i o n " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l >
)
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-26 11:42:20 +00:00
2020-01-19 10:42:15 +00:00
if ( CMAKE_TOOLCHAIN_FILE )
2020-01-13 01:08:50 +00:00
set ( VOLK_GNSSSDR_COMPILER "" )
else ( )
set ( VOLK_GNSSSDR_COMPILER -DCMAKE_C_COMPILER= ${ CMAKE_C_COMPILER } -DCMAKE_CXX_COMPILER= ${ CMAKE_CXX_COMPILER } )
endif ( )
2021-12-23 13:48:27 +00:00
if ( ENABLE_ORC )
find_package ( ORC )
set_package_properties ( ORC PROPERTIES
P U R P O S E " U s e d b y v o l k _ g n s s s d r . "
T Y P E O P T I O N A L
)
if ( ORC_FOUND )
set ( ORC_ENABLED ON )
else ( )
set ( ORC_ENABLED OFF )
2021-12-23 14:18:40 +00:00
set ( ENABLE_ORC OFF )
2021-12-23 13:48:27 +00:00
endif ( )
2019-11-17 12:42:29 +00:00
else ( )
set ( ORC_ENABLED OFF )
2021-12-23 14:18:40 +00:00
set ( ENABLE_ORC OFF )
2019-11-17 12:42:29 +00:00
endif ( )
2016-12-20 01:35:52 +00:00
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_COMPILER }
2022-07-28 08:37:36 +00:00
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l
2018-11-19 07:51:05 +00:00
- D E N A B L E _ S T A T I C _ L I B S = O N
- D E N A B L E _ P R O F I L I N G = $ { E N A B L E _ P R O F I L I N G }
2019-11-17 12:42:29 +00:00
- D E N A B L E _ O R C = $ { O R C _ E N A B L E D }
2018-11-19 07:51:05 +00:00
$ { S T R I P _ V O L K _ G N S S S D R _ P R O F I L E }
2019-03-10 04:36:09 +00:00
$ { U S E _ T H I S _ P Y T H O N }
)
2022-12-17 13:38:10 +00:00
if ( CMAKE_C_FLAGS ) # Required by some packaging systems
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS } -DCMAKE_C_FLAGS= ${ CMAKE_C_FLAGS } )
endif ( )
if ( CMAKE_CXX_FLAGS ) # Required by some packaging systems
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS } -DCMAKE_CXX_FLAGS= ${ CMAKE_CXX_FLAGS } )
endif ( )
2022-12-03 22:55:12 +00:00
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{OECORE_TARGET_SYSROOT} )
2017-04-06 19:16:44 +00:00
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS }
2019-03-10 04:36:09 +00:00
- D C R O S S C O M P I L E _ M U L T I L I B = T R U E
2020-04-06 18:30:59 +00:00
- D B O O S T _ R O O T = $ E N V { O E C O R E _ T A R G E T _ S Y S R O O T } / u s r
2019-03-10 04:36:09 +00:00
)
2020-01-26 13:24:38 +00:00
if ( NOT CMAKE_TOOLCHAIN_FILE )
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS }
2022-07-28 08:37:36 +00:00
- D C M A K E _ T O O L C H A I N _ F I L E = $ { G N S S S D R _ S O U R C E _ D I R } / c m a k e / T o o l c h a i n s / o e - s d k _ c r o s s . c m a k e
2020-01-26 13:24:38 +00:00
)
2021-06-28 11:51:20 +00:00
else ( )
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS }
- D C M A K E _ T O O L C H A I N _ F I L E = $ { C M A K E _ T O O L C H A I N _ F I L E }
)
2020-01-26 13:24:38 +00:00
endif ( )
2019-11-01 18:29:28 +00:00
else ( )
if ( CMAKE_TOOLCHAIN_FILE )
2020-01-13 01:08:50 +00:00
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS }
2019-11-01 18:29:28 +00:00
- D C M A K E _ T O O L C H A I N _ F I L E = $ { C M A K E _ T O O L C H A I N _ F I L E }
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2021-06-28 11:51:20 +00:00
if ( CMAKE_SYSTEM_PROCESSOR MATCHES "^cortex" )
set ( CMAKE_SYSTEM_PROCESSOR arm- ${ CMAKE_SYSTEM_PROCESSOR } )
endif ( )
2020-10-24 08:48:48 +00:00
include ( GNUInstallDirs )
2020-10-28 17:42:17 +00:00
set ( SUPPORTED_CPU_FEATURES_ARCH FALSE )
2022-04-03 21:24:31 +00:00
if ( CMAKE_SYSTEM_PROCESSOR MATCHES
2023-01-26 17:39:25 +00:00
" ( ^ m i p s ) | ( ^ a r m ) | ( ^ a a r c h 6 4 ) | ( x 8 6 _ 6 4 ) | ( A M D 6 4 | a m d 6 4 ) | ( ^ i . 8 6 $ ) | ( ^ p o w e r p c ) | ( ^ p p c ) | ( ^ s 3 9 0 x ) | ^ r i s c v " )
2020-12-02 15:19:56 +00:00
set ( SUPPORTED_CPU_FEATURES_ARCH TRUE )
2020-10-28 17:42:17 +00:00
endif ( )
2020-11-30 20:13:58 +00:00
if ( ${ CMAKE_INSTALL_LIBDIR } MATCHES lib64 )
set ( VOLK_GNSSSDR_LIB_SUFFIX 64 )
endif ( )
2017-06-22 18:17:37 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( volk_gnsssdr_module
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e
S O U R C E _ D I R $ { G N S S S D R _ S O U R C E _ D I R } / s r c / a l g o r i t h m s / l i b s / v o l k _ g n s s s d r _ m o d u l e / v o l k _ g n s s s d r
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / b u i l d
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S $ { V O L K _ G N S S S D R _ C M A K E _ A R G S }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : N o n e > : N o n e > $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : N o O p t W i t h A S M > $ < $ < C O N F I G : C o v e r a g e > : C o v e r a g e > $ < $ < C O N F I G : O 2 W i t h A S M > : O 2 W i t h A S M > $ < $ < C O N F I G : O 3 W i t h A S M > : O 3 W i t h A S M > $ < $ < C O N F I G : A S A N > : A S A N >
2020-11-30 18:42:15 +00:00
- D C M A K E _ I N S T A L L _ L I B D I R = $ { C M A K E _ I N S T A L L _ L I B D I R }
2018-11-24 17:40:34 +00:00
D O W N L O A D _ C O M M A N D " "
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2022-11-27 07:18:07 +00:00
B U I L D _ C O M M A N D $ { V O L K _ G N S S S D R _ B U I L D _ C O M M A N D }
2022-07-28 08:37:36 +00:00
I N S T A L L _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l
2018-11-19 07:51:05 +00:00
)
2018-11-24 17:40:34 +00:00
else ( )
2020-10-28 17:42:17 +00:00
if ( SUPPORTED_CPU_FEATURES_ARCH )
2021-01-11 12:57:29 +00:00
set ( VOLK_GNSSSDR_BUILD_BYPRODUCTS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / l i b $ { V O L K _ G N S S S D R _ L I B _ S U F F I X } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } v o l k _ g n s s s d r $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
$ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / b i n / v o l k _ g n s s s d r _ p r o f i l e
2021-01-11 12:57:29 +00:00
)
2022-04-03 21:24:31 +00:00
if ( ENABLE_CPUFEATURES )
find_package ( CPUFEATURES )
set_package_properties ( CPUFEATURES PROPERTIES
2021-01-11 12:57:29 +00:00
U R L " h t t p s : / / g i t h u b . c o m / g o o g l e / c p u _ f e a t u r e s "
P U R P O S E " U s e d b y t h e v o l k _ g n s s s d r l i b r a r y . "
T Y P E R E Q U I R E D
)
endif ( )
2022-04-03 21:24:31 +00:00
if ( CPUFEATURES_FOUND )
2022-04-20 12:02:56 +00:00
message ( STATUS "Found CpuFeatures: (found version ${CPUFEATURES_VERSION})" )
2022-04-03 21:24:31 +00:00
set_package_properties ( CPUFEATURES PROPERTIES
2022-04-20 12:02:56 +00:00
D E S C R I P T I O N " A c r o s s p l a t f o r m C 9 9 l i b r a r y t o g e t C P U f e a t u r e s a t runtime ( version: ${ CPUFEATURES_VERSION } ) "
2021-01-11 12:57:29 +00:00
)
2023-01-26 17:39:25 +00:00
if ( ( CMAKE_SYSTEM_PROCESSOR MATCHES "(^s390x)|^riscv" ) AND ( CPUFEATURES_VERSION VERSION_LESS "0.8.0" ) ) # detect cpu_features without s390x / riscv support
set ( ENABLE_CPUFEATURES OFF )
endif ( )
2021-01-11 12:57:29 +00:00
else ( )
2022-04-03 21:24:31 +00:00
set_package_properties ( CPUFEATURES PROPERTIES
2021-01-11 12:57:29 +00:00
D E S C R I P T I O N " A c r o s s p l a t f o r m C 9 9 l i b r a r y t o g e t C P U f e a t u r e s a t r u n t i m e "
)
2023-01-26 17:39:25 +00:00
if ( DEFINED VOLK_VERSION AND VOLK_VERSION VERSION_GREATER "2.3" ) # avoid clash with volk's cpufeatures.
2022-04-03 21:24:31 +00:00
set ( ENABLE_CPUFEATURES OFF )
else ( )
set_package_properties ( CPUFEATURES PROPERTIES
P U R P O S E " C p u F e a t u r e s w i l l b e b u i l t w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
)
set ( VOLK_GNSSSDR_BUILD_BYPRODUCTS
$ { V O L K _ G N S S S D R _ B U I L D _ B Y P R O D U C T S }
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / $ { C M A K E _ I N S T A L L _ L I B D I R } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } c p u _ f e a t u r e s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2022-04-03 21:24:31 +00:00
)
endif ( )
2021-01-11 12:57:29 +00:00
endif ( )
2022-04-01 13:02:05 +00:00
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS }
2022-04-03 21:24:31 +00:00
- D V O L K _ C P U _ F E A T U R E S = $ { E N A B L E _ C P U F E A T U R E S }
2022-04-01 13:02:05 +00:00
)
2020-10-27 09:16:07 +00:00
ExternalProject_Add ( volk_gnsssdr_module
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e
S O U R C E _ D I R $ { G N S S S D R _ S O U R C E _ D I R } / s r c / a l g o r i t h m s / l i b s / v o l k _ g n s s s d r _ m o d u l e / v o l k _ g n s s s d r
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / b u i l d
2020-10-27 09:16:07 +00:00
C M A K E _ A R G S $ { V O L K _ G N S S S D R _ C M A K E _ A R G S }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : N o n e > : N o n e > $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : N o O p t W i t h A S M > $ < $ < C O N F I G : C o v e r a g e > : C o v e r a g e > $ < $ < C O N F I G : O 2 W i t h A S M > : O 2 W i t h A S M > $ < $ < C O N F I G : O 3 W i t h A S M > : O 3 W i t h A S M > $ < $ < C O N F I G : A S A N > : A S A N >
2020-11-30 18:42:15 +00:00
- D C M A K E _ I N S T A L L _ L I B D I R = $ { C M A K E _ I N S T A L L _ L I B D I R }
2020-10-27 09:16:07 +00:00
D O W N L O A D _ C O M M A N D " "
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2022-11-27 07:18:07 +00:00
B U I L D _ C O M M A N D $ { V O L K _ G N S S S D R _ B U I L D _ C O M M A N D }
2021-01-11 12:57:29 +00:00
B U I L D _ B Y P R O D U C T S $ { V O L K _ G N S S S D R _ B U I L D _ B Y P R O D U C T S }
2022-07-28 08:37:36 +00:00
I N S T A L L _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l
2020-10-27 09:16:07 +00:00
)
else ( )
2022-04-03 21:24:31 +00:00
set ( ENABLE_CPUFEATURES OFF )
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS }
- D V O L K _ C P U _ F E A T U R E S = $ { E N A B L E _ C P U F E A T U R E S }
)
2020-10-27 09:16:07 +00:00
ExternalProject_Add ( volk_gnsssdr_module
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e
S O U R C E _ D I R $ { G N S S S D R _ S O U R C E _ D I R } / s r c / a l g o r i t h m s / l i b s / v o l k _ g n s s s d r _ m o d u l e / v o l k _ g n s s s d r
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / b u i l d
2020-10-27 09:16:07 +00:00
C M A K E _ A R G S $ { V O L K _ G N S S S D R _ C M A K E _ A R G S }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : N o n e > : N o n e > $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : N o O p t W i t h A S M > $ < $ < C O N F I G : C o v e r a g e > : C o v e r a g e > $ < $ < C O N F I G : O 2 W i t h A S M > : O 2 W i t h A S M > $ < $ < C O N F I G : O 3 W i t h A S M > : O 3 W i t h A S M > $ < $ < C O N F I G : A S A N > : A S A N >
2020-11-30 18:42:15 +00:00
- D C M A K E _ I N S T A L L _ L I B D I R = $ { C M A K E _ I N S T A L L _ L I B D I R }
2020-10-27 09:16:07 +00:00
D O W N L O A D _ C O M M A N D " "
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2022-11-27 07:18:07 +00:00
B U I L D _ C O M M A N D $ { V O L K _ G N S S S D R _ B U I L D _ C O M M A N D }
2022-07-28 08:37:36 +00:00
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / l i b $ { V O L K _ G N S S S D R _ L I B _ S U F F I X } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } v o l k _ g n s s s d r $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
$ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / b i n / v o l k _ g n s s s d r _ p r o f i l e
2022-11-26 16:52:46 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / b i n / v o l k _ g n s s s d r - c o n f i g - i n f o
2022-07-28 08:37:36 +00:00
I N S T A L L _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l
2020-10-27 09:16:07 +00:00
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2019-06-21 00:49:41 +00:00
2020-12-02 15:19:56 +00:00
if ( NOT ORC_LIBRARIES_STATIC )
set ( ORC_LIBRARIES_STATIC "" )
2018-11-19 07:51:05 +00:00
set ( ORC_INCLUDE_DIRS "" )
2018-11-24 17:40:34 +00:00
endif ( )
2015-03-20 16:02:41 +00:00
2014-11-07 20:44:44 +00:00
add_library ( volk_gnsssdr UNKNOWN IMPORTED )
2022-07-28 08:37:36 +00:00
set_property ( TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${ GNSSSDR_BINARY_DIR } /volk_gnsssdr_module/install/lib ${ VOLK_GNSSSDR_LIB_SUFFIX } /libvolk_gnsssdr ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
set ( VOLK_GNSSSDR_INCLUDE_DIRS "${GNSSSDR_BINARY_DIR}/volk_gnsssdr_module/build/include/;${GNSSSDR_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}" )
2020-12-02 15:19:56 +00:00
set ( VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ ORC_LIBRARIES_STATIC } )
2022-04-03 21:24:31 +00:00
if ( CPUFEATURES_FOUND )
set ( VOLK_GNSSSDR_LIBRARIES ${ VOLK_GNSSSDR_LIBRARIES } CpuFeature::cpu_features )
2021-01-11 12:57:29 +00:00
endif ( )
2014-11-07 17:23:59 +00:00
2019-02-03 18:24:44 +00:00
if ( NOT TARGET Volkgnsssdr::volkgnsssdr )
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /volk_gnsssdr_module/build/include )
2019-02-03 18:24:44 +00:00
add_library ( Volkgnsssdr::volkgnsssdr STATIC IMPORTED )
add_dependencies ( Volkgnsssdr::volkgnsssdr volk_gnsssdr_module )
set_target_properties ( Volkgnsssdr::volkgnsssdr PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2022-07-28 08:37:36 +00:00
I M P O R T E D _ L O C A T I O N " $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / l i b $ { V O L K _ G N S S S D R _ L I B _ S U F F I X } / l i b v o l k _ g n s s s d r $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X } "
2019-02-03 18:24:44 +00:00
I N C L U D E _ D I R E C T O R I E S " $ { V O L K _ G N S S S D R _ I N C L U D E _ D I R S } "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { V O L K _ G N S S S D R _ I N C L U D E _ D I R S } "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { V O L K _ G N S S S D R _ L I B R A R I E S } "
)
2020-10-28 17:42:17 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.0 AND SUPPORTED_CPU_FEATURES_ARCH )
2022-04-03 21:24:31 +00:00
if ( NOT CPUFEATURES_FOUND AND ENABLE_CPUFEATURES )
2021-01-11 12:57:29 +00:00
set_target_properties ( Volkgnsssdr::volkgnsssdr PROPERTIES
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / $ { C M A K E _ I N S T A L L _ L I B D I R } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } c p u _ f e a t u r e s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2021-01-11 12:57:29 +00:00
)
endif ( )
2020-08-21 14:31:57 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
endif ( )
2017-06-22 18:59:45 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
add_custom_command ( TARGET volk_gnsssdr_module POST_BUILD
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / b i n / v o l k _ g n s s s d r _ p r o f i l e
2020-06-12 18:51:26 +00:00
$ { L O C A L _ I N S T A L L _ B A S E _ D I R } / i n s t a l l / v o l k _ g n s s s d r _ p r o f i l e
2019-03-10 04:36:09 +00:00
)
2018-11-24 17:40:34 +00:00
else ( )
add_custom_command ( TARGET volk_gnsssdr_module POST_BUILD
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / b i n / v o l k _ g n s s s d r _ p r o f i l e
2020-06-12 18:51:26 +00:00
$ { L O C A L _ I N S T A L L _ B A S E _ D I R } / i n s t a l l / v o l k _ g n s s s d r _ p r o f i l e
B Y P R O D U C T S $ { L O C A L _ I N S T A L L _ B A S E _ D I R } / i n s t a l l / v o l k _ g n s s s d r _ p r o f i l e
2019-03-10 04:36:09 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2017-07-13 15:28:08 +00:00
2016-07-06 18:25:39 +00:00
add_custom_command ( TARGET volk_gnsssdr_module POST_BUILD
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { G N S S S D R _ B I N A R Y _ D I R } / v o l k _ g n s s s d r _ m o d u l e / i n s t a l l / b i n / v o l k _ g n s s s d r - c o n f i g - i n f o
2020-06-12 18:51:26 +00:00
$ { L O C A L _ I N S T A L L _ B A S E _ D I R } / i n s t a l l / v o l k _ g n s s s d r - c o n f i g - i n f o
2019-03-09 00:39:32 +00:00
)
2019-03-10 04:36:09 +00:00
2019-03-09 00:39:32 +00:00
set_package_properties ( VOLKGNSSSDR PROPERTIES
2019-03-10 04:36:09 +00:00
P U R P O S E " v o l k _ g n s s s d r w i l l b e b u i l t w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-03-09 00:39:32 +00:00
)
2021-01-11 12:57:29 +00:00
else ( )
2021-12-23 14:18:40 +00:00
set ( ENABLE_ORC OFF )
2018-11-24 17:40:34 +00:00
endif ( )
2014-09-07 23:56:09 +00:00
2013-11-13 21:07:33 +00:00
2016-11-27 22:47:45 +00:00
2013-01-01 11:24:42 +00:00
################################################################################
2015-03-24 18:53:10 +00:00
# gflags - https://github.com/gflags/gflags
2013-01-01 11:24:42 +00:00
################################################################################
2019-09-08 11:56:20 +00:00
set ( LOCAL_GFLAGS FALSE )
2022-07-26 22:23:54 +00:00
if ( ENABLE_OWN_GLOG )
unset ( Glog::glog CACHE )
unset ( GLOG_FOUND CACHE )
unset ( Gflags::gflags CACHE )
unset ( GLAGS_FOUND CACHE )
set ( GFLAGS_GREATER_20 TRUE )
else ( )
unset ( Glog::glog CACHE )
unset ( GLOG_FOUND CACHE )
2022-01-04 11:57:01 +00:00
find_package ( GLOG )
if ( GLOG_FOUND )
2022-07-26 22:23:54 +00:00
unset ( GFLAGS_GREATER_20 CACHE )
2022-01-04 11:57:01 +00:00
find_package ( GFLAGS )
endif ( )
2020-08-09 00:13:32 +00:00
endif ( )
2019-03-10 04:36:09 +00:00
set_package_properties ( GFLAGS PROPERTIES
P U R P O S E " U s e d f o r c o m m a n d l i n e f l a g s m a n a g e m e n t . "
T Y P E R E Q U I R E D
)
2018-11-21 07:28:50 +00:00
if ( NOT GFLAGS_FOUND )
2020-08-13 18:54:22 +00:00
set ( ENABLE_OWN_GLOG ON )
if ( GFLAGS_VERSION )
message ( STATUS " A version of the gflags library equal or higher than v${GNSSSDR_GFLAGS_MIN_VERSION} has not been found." )
else ( )
message ( STATUS " The gflags library has not been found." )
endif ( )
2021-05-11 09:56:01 +00:00
message ( STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded, built, and statically linked automatically" )
2019-11-10 13:32:21 +00:00
message ( STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2020-01-19 23:35:00 +00:00
set ( GFLAGS_BUILD_COMMAND ${ CMAKE_COMMAND }
2022-07-28 08:37:36 +00:00
" - - b u i l d " " $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } "
2020-01-19 23:35:00 +00:00
" - - c o n f i g " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
)
2019-12-06 13:23:12 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
set ( GFLAGS_BUILD_COMMAND "xcodebuild" "-configuration" $< $<CONFIG:Debug > :Debug> $< $<CONFIG:Release > :Release> $< $<CONFIG:RelWithDebInfo > :RelWithDebInfo> $< $<CONFIG:MinSizeRel > :MinSizeRel> )
2019-11-28 11:29:04 +00:00
endif ( )
2019-12-06 13:23:12 +00:00
if ( CMAKE_TOOLCHAIN_FILE )
set ( GFLAGS_TOOLCHAIN_FILE -DCMAKE_TOOLCHAIN_FILE= ${ CMAKE_TOOLCHAIN_FILE } )
2019-11-28 14:20:57 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
2020-08-13 23:09:15 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g f l a g s / g f l a g s . g i t
2018-11-24 17:40:34 +00:00
G I T _ T A G v $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g f l a g s / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S - D B U I L D _ S H A R E D _ L I B S = O F F
- D B U I L D _ S T A T I C _ L I B S = O N
- D B U I L D _ g f l a g s _ L I B = O N
2020-08-13 18:54:22 +00:00
- D B U I L D _ g f l a g s _ n o t h r e a d s _ L I B = O N
2020-01-19 23:35:00 +00:00
- D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
$ { G F L A G S _ T O O L C H A I N _ F I L E }
2020-08-13 18:54:22 +00:00
- D G F L A G S _ N A M E S P A C E = g o o g l e
2020-01-19 23:35:00 +00:00
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2019-11-10 13:32:21 +00:00
B U I L D _ C O M M A N D $ { G F L A G S _ B U I L D _ C O M M A N D }
2018-11-24 17:40:34 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
else ( )
2022-07-28 08:37:36 +00:00
set ( GFLAGS_BUILD_BYPRODUCTS ${ GNSSSDR_BINARY_DIR } /gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } /lib/ ${ CMAKE_FIND_LIBRARY_PREFIXES } gflags ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2020-01-19 21:13:50 +00:00
if ( ( CMAKE_BUILD_TYPE STREQUAL Debug ) OR ( CMAKE_BUILD_TYPE STREQUAL NoOptWithASM ) OR
( C M A K E _ B U I L D _ T Y P E S T R E Q U A L C o v e r a g e ) OR ( CMAKE_BUILD_TYPE STREQUAL ASAN ) ) # Workaround for Ninja generator
2022-07-28 08:37:36 +00:00
set ( GFLAGS_BUILD_BYPRODUCTS ${ GNSSSDR_BINARY_DIR } /gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } /lib/ ${ CMAKE_FIND_LIBRARY_PREFIXES } gflags_debug ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2019-12-06 13:23:12 +00:00
endif ( )
2019-12-06 13:36:53 +00:00
if ( ( CMAKE_VERSION VERSION_GREATER 3.12.0 ) AND NOT ( CMAKE_GENERATOR STREQUAL Xcode ) )
2019-12-06 13:23:12 +00:00
set ( PARALLEL_BUILD "--parallel 2" )
endif ( )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
2020-08-13 23:09:15 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g f l a g s / g f l a g s . g i t
2019-11-28 14:29:27 +00:00
G I T _ T A G v $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g f l a g s / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S - D B U I L D _ S H A R E D _ L I B S = O F F
- D B U I L D _ S T A T I C _ L I B S = O N
- D B U I L D _ g f l a g s _ L I B = O N
- D B U I L D _ g f l a g s _ n o t h r e a d s _ L I B = O N
- D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
$ { G F L A G S _ T O O L C H A I N _ F I L E }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2020-06-21 19:59:05 +00:00
B U I L D _ C O M M A N D " $ { G F L A G S _ B U I L D _ C O M M A N D } $ { P A R A L L E L _ B U I L D } "
2019-12-06 13:23:12 +00:00
B U I L D _ B Y P R O D U C T S $ { G F L A G S _ B U I L D _ B Y P R O D U C T S }
2018-11-24 17:40:34 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
endif ( )
2019-11-28 14:20:57 +00:00
# Note: -DBUILD_gflags_nothreads_LIB=ON is required as a workaround to a bug in gflags 2.2.2. This is fixed in gflags master branch
2018-11-19 07:51:05 +00:00
set ( GFlags_INCLUDE_DIRS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / i n c l u d e C A C H E P A T H " L o c a l G f l a g s h e a d e r s "
2018-11-19 07:51:05 +00:00
)
2019-11-28 14:20:57 +00:00
2019-12-06 13:23:12 +00:00
if ( CMAKE_VERSION VERSION_LESS "3.0.2" )
2019-11-10 13:32:21 +00:00
set ( GFlags_LIBS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-11-28 11:29:04 +00:00
)
endif ( )
2019-02-03 18:24:44 +00:00
if ( NOT TARGET Gflags::gflags )
2019-11-10 13:32:21 +00:00
file ( MAKE_DIRECTORY ${ GFlags_INCLUDE_DIRS } )
2019-02-03 18:24:44 +00:00
add_library ( Gflags::gflags STATIC IMPORTED )
add_dependencies ( Gflags::gflags gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } )
set_target_properties ( Gflags::gflags PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2020-01-19 21:13:50 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " N o n e ; D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
M A P _ I M P O R T E D _ C O N F I G _ N O O P T W I T H A S M D e b u g
M A P _ I M P O R T E D _ C O N F I G _ C O V E R A G E D e b u g
M A P _ I M P O R T E D _ C O N F I G _ O 2 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ O 3 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ A S A N D e b u g
2022-07-28 08:37:36 +00:00
I M P O R T E D _ L O C A T I O N _ N O N E $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ D E B U G $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s _ d e b u g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G F l a g s _ I N C L U D E _ D I R S }
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ < $ < C O N F I G : D e b u g > : _ d e b u g > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-02-03 18:24:44 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
if ( MSVC )
set ( MSVC_POSTFIX _static )
endif ( )
set_target_properties ( Gflags::gflags PROPERTIES
2022-07-28 08:37:36 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { M S V C _ P O S T F I X } _ d e b u g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { M S V C _ P O S T F I X } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { M S V C _ P O S T F I X } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { M S V C _ P O S T F I X } $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / g f l a g s - $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } / l i b / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g f l a g s $ { M S V C _ P O S T F I X } $ < $ < C O N F I G : D e b u g > : _ d e b u g > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-02-03 18:24:44 +00:00
endif ( )
2019-11-28 11:29:04 +00:00
if ( MSVC )
target_link_libraries ( Gflags::gflags INTERFACE shlwapi.lib )
endif ( )
2021-05-11 09:56:01 +00:00
set ( LOCAL_GFLAGS TRUE CACHE STRING "GFlags downloaded, built, and statically linked automatically" FORCE )
2019-03-09 00:39:32 +00:00
set_package_properties ( GFLAGS PROPERTIES
2021-05-11 09:56:01 +00:00
P U R P O S E " G f l a g s v $ { G N S S S D R _ G F L A G S _ L O C A L _ V E R S I O N } a n d G l o g v $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-03-09 00:39:32 +00:00
)
2020-08-13 18:54:22 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
set_property ( TARGET Gflags::gflags APPEND PROPERTY
I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S G F L A G S _ O L D _ N A M E S P A C E = 1
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2013-01-01 11:24:42 +00:00
2016-11-27 22:47:45 +00:00
2012-12-24 02:33:50 +00:00
################################################################################
2015-03-24 20:44:03 +00:00
# glog - https://github.com/google/glog
2012-12-24 02:33:50 +00:00
################################################################################
2019-03-10 04:36:09 +00:00
set_package_properties ( GLOG PROPERTIES
P U R P O S E " U s e d f o r r u n t i m e i n t e r n a l l o g g i n g . "
T Y P E R E Q U I R E D
)
2018-11-19 07:51:05 +00:00
if ( NOT GLOG_FOUND OR ${ LOCAL_GFLAGS } )
message ( STATUS " glog library has not been found" )
2018-11-21 07:28:50 +00:00
if ( NOT GFLAGS_FOUND )
2018-11-19 07:51:05 +00:00
message ( STATUS " or it is likely not linked to gflags." )
2018-11-24 17:40:34 +00:00
endif ( )
2021-05-11 09:56:01 +00:00
message ( STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded, built, and statically linked automatically" )
2019-11-10 13:32:21 +00:00
message ( STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2022-07-25 07:48:17 +00:00
find_package ( LIBUNWIND )
set_package_properties ( LIBUNWIND PROPERTIES
P U R P O S E " N e e d e d b y g l o g . "
T Y P E O P T I O N A L
)
2018-11-19 07:51:05 +00:00
if ( NOT ${ LOCAL_GFLAGS } )
2021-07-24 11:59:05 +00:00
if ( NOT TARGET gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } )
add_library ( gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } UNKNOWN IMPORTED )
endif ( )
2018-11-19 07:51:05 +00:00
set_property ( TARGET gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}" )
2019-11-10 19:56:58 +00:00
string ( REPLACE /include "" GFLAGS_PREFIX_PATH ${ GFlags_INCLUDE_DIRS } )
else ( )
2022-07-28 08:37:36 +00:00
set ( GFLAGS_PREFIX_PATH ${ GNSSSDR_BINARY_DIR } /gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
set ( TARGET_GFLAGS gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } )
2020-01-19 23:35:00 +00:00
set ( GLOG_MAKE_PROGRAM ${ CMAKE_COMMAND }
2022-07-28 08:37:36 +00:00
" - - b u i l d " " $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } "
2020-01-19 23:35:00 +00:00
" - - c o n f i g " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
)
2019-12-06 13:23:12 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
2020-01-19 23:35:00 +00:00
set ( GLOG_MAKE_PROGRAM "xcodebuild" "-configuration"
$ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l >
)
2019-11-28 11:29:04 +00:00
endif ( )
2019-12-06 13:23:12 +00:00
if ( CMAKE_TOOLCHAIN_FILE )
set ( GLOG_TOOLCHAIN_FILE -DCMAKE_TOOLCHAIN_FILE= ${ CMAKE_TOOLCHAIN_FILE } )
2019-11-10 22:26:03 +00:00
endif ( )
2019-04-23 22:56:17 +00:00
2021-05-09 07:27:51 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.3 )
2019-11-10 18:45:55 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.0 )
2019-12-06 18:12:36 +00:00
set ( GLOG_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
2019-11-12 22:17:22 +00:00
set ( GFLAGS_LIBRARIES_TO_LINK ${ GFlags_LIBS } )
2019-11-10 18:45:55 +00:00
if ( ${ LOCAL_GFLAGS } )
2022-07-28 08:37:36 +00:00
set ( GFLAGS_LIBRARY_DIR_TO_LINK ${ GNSSSDR_BINARY_DIR } /gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } /lib )
2019-11-10 18:45:55 +00:00
else ( )
set ( GFLAGS_LIBRARY_DIR_TO_LINK ${ GFlags_LIBRARY_DIRS } )
endif ( )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2019-11-10 18:45:55 +00:00
set ( GFLAGS_LIBRARIES_TO_LINK "${GFLAGS_LIBRARIES_TO_LINK} -lc++" )
set ( GLOG_EXPORT_CXX_LIBRARIES "export CXXFLAGS=\" -stdlib=libc++\ "" )
endif ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set ( GLOG_EXPORT_C_COMPILER "export CC=clang" )
set ( GLOG_EXPORT_CXX_COMPILER "export CXX=clang++" )
endif ( )
2021-07-24 11:59:05 +00:00
if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
set ( GLOG_EXPORT_C_COMPILER "export CC=gcc" )
set ( GLOG_EXPORT_CXX_COMPILER "export CXX=g++" )
endif ( )
2022-07-28 08:37:36 +00:00
file ( WRITE ${ GNSSSDR_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /tmp/configure_with_gflags
2019-11-10 18:45:55 +00:00
" #!/bin/sh
e x p o r t C P P F L A G S = - I $ { G F l a g s _ I N C L U D E _ D I R S }
e x p o r t L D F L A G S = - L $ { G F L A G S _ L I B R A R Y _ D I R _ T O _ L I N K }
e x p o r t L I B S = \ " $ { G F L A G S _ L I B R A R I E S _ T O _ L I N K } \ "
$ { G L O G _ E X P O R T _ C X X _ L I B R A R I E S }
$ { G L O G _ E X P O R T _ C _ C O M P I L E R }
$ { G L O G _ E X P O R T _ C X X _ C O M P I L E R }
2022-07-28 08:37:36 +00:00
c d $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } /
2019-11-10 18:45:55 +00:00
a c l o c a l
a u t o m a k e - - a d d - m i s s i n g
a u t o r e c o n f - v f i
2022-07-28 08:37:36 +00:00
c d $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / c o n f i g u r e - - e n a b l e - s h a r e d = n o "
2019-11-10 18:45:55 +00:00
)
2022-07-28 08:37:36 +00:00
file ( COPY ${ GNSSSDR_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /tmp/configure_with_gflags
D E S T I N A T I O N $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2019-11-10 18:45:55 +00:00
F I L E _ P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D
G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E
)
2022-07-28 08:37:36 +00:00
set ( GLOG_CONFIGURE ${ GNSSSDR_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /configure_with_gflags )
2019-11-10 18:45:55 +00:00
# Ensure that aclocal and libtool are present
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2019-11-10 18:45:55 +00:00
if ( EXISTS "/usr/bin/libtoolize" )
if ( EXISTS "/usr/bin/aclocal" OR
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 6 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 5 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 4 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 3 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 1 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 0 " )
# Everything ok, we can move on
else ( )
message ( " aclocal has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum groupinstall 'Development Tools'" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install automake" )
else ( )
message ( " sudo apt-get install automake" )
endif ( )
message ( FATAL_ERROR "aclocal is required to build glog from source" )
endif ( )
else ( )
message ( " libtool has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum groupinstall 'Development Tools'" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install libtoool" )
else ( )
message ( " sudo apt-get install libtool" )
endif ( )
message ( FATAL_ERROR "libtool is required to build glog from source" )
endif ( )
endif ( )
if ( GLOG_MAKE_PROGRAM MATCHES "ninja" )
find_program ( GLOG_MAKE_EXECUTABLE make
P A T H S
/ u s r / b i n
/ u s r / l o c a l / b i n
)
if ( NOT GLOG_MAKE_EXECUTABLE )
message ( FATAL_ERROR "make is required to build Glog from source." )
endif ( )
set ( GLOG_MAKE_PROGRAM ${ GLOG_MAKE_EXECUTABLE } )
endif ( )
ExternalProject_Add ( glog- ${ GNSSSDR_GLOG_LOCAL_VERSION }
D E P E N D S $ { T A R G E T _ G F L A G S }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2019-11-10 18:45:55 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g o o g l e / g l o g /
G I T _ T A G v $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2019-11-10 18:45:55 +00:00
C O N F I G U R E _ C O M M A N D $ { G L O G _ C O N F I G U R E } - - p r e f i x = < I N S T A L L _ D I R >
B U I L D _ C O M M A N D " $ { G L O G _ M A K E _ P R O G R A M } "
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
set ( GLOG_LIBRARIES
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / . l i b s / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-11-10 18:45:55 +00:00
)
2019-12-06 18:24:42 +00:00
set ( GLOG_INCLUDE_DIRS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / s r c
$ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / s r c
2019-12-06 18:24:42 +00:00
)
2021-05-09 07:27:51 +00:00
else ( ) # CMake > 3.0 but < 3.3
2019-11-10 18:45:55 +00:00
ExternalProject_Add ( glog- ${ GNSSSDR_GLOG_LOCAL_VERSION }
D E P E N D S $ { T A R G E T _ G F L A G S }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2019-11-10 18:45:55 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g o o g l e / g l o g /
G I T _ T A G v $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S - D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
- D C M A K E _ C _ C O M P I L E R = $ { C M A K E _ C _ C O M P I L E R }
- D C M A K E _ P R E F I X _ P A T H = $ { G F L A G S _ P R E F I X _ P A T H }
$ { G L O G _ T O O L C H A I N _ F I L E }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2019-12-06 13:23:12 +00:00
B U I L D _ C O M M A N D $ { G L O G _ M A K E _ P R O G R A M }
2019-11-10 18:45:55 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
2019-12-06 18:24:42 +00:00
set ( GLOG_INCLUDE_DIRS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / s r c
$ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2019-12-06 18:24:42 +00:00
$ { G F l a g s _ I N C L U D E _ D I R S }
)
2019-11-10 18:45:55 +00:00
endif ( )
2021-05-09 07:27:51 +00:00
else ( ) # CMake > 3.3
2019-12-06 13:23:12 +00:00
set ( GLOG_BUILD_BYPRODUCTS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
2020-01-19 21:13:50 +00:00
if ( ( CMAKE_BUILD_TYPE STREQUAL Debug ) OR ( CMAKE_BUILD_TYPE STREQUAL NoOptWithASM ) OR
( C M A K E _ B U I L D _ T Y P E S T R E Q U A L C o v e r a g e ) OR ( CMAKE_BUILD_TYPE STREQUAL ASAN ) ) # Workaround for Ninja generator
2019-12-06 13:23:12 +00:00
set ( GLOG_BUILD_BYPRODUCTS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g d $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2021-12-25 21:27:26 +00:00
if ( ( CMAKE_VERSION VERSION_GREATER 3.12.0 ) AND NOT ( CMAKE_GENERATOR STREQUAL Xcode ) AND NOT CMAKE_CROSSCOMPILING )
2019-12-06 13:23:12 +00:00
set ( PARALLEL_BUILD "--parallel 2" )
endif ( )
2021-12-25 21:27:26 +00:00
if ( GNSSSDR_GLOG_LOCAL_VERSION VERSION_GREATER 0.5.0 )
set ( GLOG_GTEST -DWITH_GTEST=FALSE )
endif ( )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( glog- ${ GNSSSDR_GLOG_LOCAL_VERSION }
2018-11-19 07:51:05 +00:00
D E P E N D S $ { T A R G E T _ G F L A G S }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2018-11-19 07:51:05 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / g o o g l e / g l o g /
G I T _ T A G v $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S - D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
- D C M A K E _ P R E F I X _ P A T H = $ { G F L A G S _ P R E F I X _ P A T H }
$ { G L O G _ T O O L C H A I N _ F I L E }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2021-05-09 07:27:51 +00:00
- D B U I L D _ S H A R E D _ L I B S = O F F
2021-12-25 21:27:26 +00:00
$ { G L O G _ G T E S T }
2021-05-11 09:56:01 +00:00
- D B U I L D _ T E S T I N G = O F F
2020-06-21 19:59:05 +00:00
B U I L D _ C O M M A N D " $ { G L O G _ M A K E _ P R O G R A M } $ { P A R A L L E L _ B U I L D } "
2019-11-10 13:32:21 +00:00
B U I L D _ B Y P R O D U C T S $ { G L O G _ B U I L D _ B Y P R O D U C T S }
2018-11-19 07:51:05 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
I N S T A L L _ C O M M A N D " "
)
2019-12-06 18:24:42 +00:00
set ( GLOG_INCLUDE_DIRS
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / g l o g / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / s r c
$ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N }
2019-12-06 18:24:42 +00:00
$ { G F l a g s _ I N C L U D E _ D I R S }
)
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
2019-12-06 13:23:12 +00:00
add_dependencies ( glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } Gflags::gflags )
2019-02-03 18:24:44 +00:00
# Create Glog::glog target
if ( NOT TARGET Glog::glog )
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /thirdparty/glog/glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /src )
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } )
2019-02-03 18:24:44 +00:00
add_library ( Glog::glog STATIC IMPORTED )
add_dependencies ( Glog::glog glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } )
2019-12-06 13:23:12 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.0 )
set_target_properties ( Glog::glog PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
I M P O R T E D _ L O C A T I O N " $ { G L O G _ L I B R A R I E S } "
I N C L U D E _ D I R E C T O R I E S " $ { G L O G _ I N C L U D E _ D I R S } "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { G L O G _ I N C L U D E _ D I R S } "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { G L O G _ L I B R A R I E S } "
)
else ( )
set_target_properties ( Glog::glog PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2020-01-19 21:13:50 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " N o n e ; D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
M A P _ I M P O R T E D _ C O N F I G _ N O O P T W I T H A S M D e b u g
M A P _ I M P O R T E D _ C O N F I G _ C O V E R A G E D e b u g
M A P _ I M P O R T E D _ C O N F I G _ O 2 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ O 3 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ A S A N D e b u g
2022-07-28 08:37:36 +00:00
I M P O R T E D _ L O C A T I O N _ N O N E $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ D E B U G $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g d $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { G L O G _ I N C L U D E _ D I R S } "
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ < $ < C O N F I G : D e b u g > : d > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( Glog::glog PROPERTIES
2022-07-28 08:37:36 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g d $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / g l o g - $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } g l o g $ < $ < C O N F I G : D e b u g > : d > $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
endif ( )
2019-02-03 18:24:44 +00:00
endif ( )
2022-07-25 07:48:17 +00:00
if ( LIBUNWIND_FOUND )
target_link_libraries ( Glog::glog INTERFACE Libunwind::libunwind )
endif ( )
2021-05-11 09:56:01 +00:00
set ( LOCAL_GLOG TRUE CACHE STRING "Glog downloaded, built, and statically linked automatically" FORCE )
2019-03-09 00:39:32 +00:00
set_package_properties ( GLOG PROPERTIES
2021-05-11 09:56:01 +00:00
P U R P O S E " G l o g v $ { G N S S S D R _ G L O G _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-03-09 00:39:32 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2012-12-24 02:33:50 +00:00
2015-05-23 09:20:26 +00:00
if ( NOT ENABLE_LOG )
2020-07-05 10:02:05 +00:00
message ( STATUS "Internal logging is not enabled" )
2020-07-05 09:53:20 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.11.0 )
target_compile_definitions ( Glog::glog INTERFACE -DGOOGLE_STRIP_LOG=1 )
else ( )
set_property ( TARGET Glog::glog APPEND PROPERTY
I N T E R F A C E _ C O M P I L E _ D E F I N I T I O N S G O O G L E _ S T R I P _ L O G = 1
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2015-05-23 09:20:26 +00:00
2013-01-11 14:13:07 +00:00
2019-12-06 20:28:16 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2017-11-26 00:48:48 +00:00
# Check that BLAS (Basic Linear Algebra Subprograms) is found in the system
2020-02-05 20:24:46 +00:00
# See https://www.netlib.org/blas/
2019-03-10 04:36:09 +00:00
################################################################################
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2019-03-22 10:00:13 +00:00
# Avoid using the implementation that comes with the Accelerate framework
include ( AvoidAccelerate )
else ( )
2019-03-22 23:43:01 +00:00
if ( NOT BLA_VENDOR )
set ( BLA_VENDOR "Generic" )
endif ( )
2023-01-26 17:39:25 +00:00
if ( NOT CMAKE_CROSSCOMPILING AND NOT DEFINED BLA_PREFER_PKGCONFIG )
set ( BLA_PREFER_PKGCONFIG ON ) # Required by riscv64 arch
endif ( )
2019-03-22 10:00:13 +00:00
find_package ( BLAS )
set_package_properties ( BLAS PROPERTIES
2020-02-05 20:24:46 +00:00
U R L " h t t p s : / / w w w . n e t l i b . o r g / b l a s / "
2019-03-22 10:00:13 +00:00
D E S C R I P T I O N " B a s i c L i n e a r A l g e b r a S u b p r o g r a m s "
P U R P O S E " U s e d f o r m a t r i x a l g e b r a c o m p u t a t i o n s . "
T Y P E R E Q U I R E D
)
endif ( )
if ( NOT BLAS_FOUND )
2017-11-26 00:48:48 +00:00
message ( " The BLAS library has not been found." )
message ( " You can try to install it by typing:" )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2019-03-22 10:00:13 +00:00
message ( " 'sudo port install lapack' if you are using Macports, or" )
message ( " 'brew install lapack' if you are using Homebrew." )
2018-11-24 17:40:34 +00:00
else ( )
2019-03-22 10:00:13 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum install blas-devel" )
else ( )
message ( " sudo apt-get install libblas-dev" )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-26 00:48:48 +00:00
message ( FATAL_ERROR "BLAS is required to build gnss-sdr" )
2018-11-24 17:40:34 +00:00
endif ( )
2020-06-13 11:43:00 +00:00
if ( NOT TARGET BLAS::BLAS )
add_library ( BLAS::BLAS SHARED IMPORTED )
set_target_properties ( BLAS::BLAS PROPERTIES
I M P O R T E D _ L O C A T I O N $ { B L A S _ L I B R A R I E S }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B L A S _ L I B R A R I E S }
)
endif ( )
2017-11-26 00:48:48 +00:00
2021-12-17 18:48:11 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2017-11-26 00:48:48 +00:00
# Check that LAPACK (Linear Algebra PACKage) is found in the system
2020-02-05 20:24:46 +00:00
# See https://www.netlib.org/lapack/
2019-03-10 04:36:09 +00:00
################################################################################
2020-01-13 00:49:00 +00:00
if ( NOT ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" ) )
2019-03-22 10:00:13 +00:00
find_package ( LAPACK )
set_package_properties ( LAPACK PROPERTIES
2020-02-05 20:24:46 +00:00
U R L " h t t p s : / / w w w . n e t l i b . o r g / l a p a c k / "
2019-03-22 10:00:13 +00:00
D E S C R I P T I O N " L i n e a r A l g e b r a P A C K a g e "
P U R P O S E " U s e d f o r m a t r i x a l g e b r a c o m p u t a t i o n s . "
T Y P E R E Q U I R E D
)
endif ( )
if ( NOT LAPACK_FOUND )
2017-11-26 00:48:48 +00:00
message ( " The LAPACK library has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum install lapack-devel" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install lapack-devel" )
2018-11-24 17:40:34 +00:00
else ( )
2017-11-26 00:48:48 +00:00
message ( " sudo apt-get install liblapack-dev" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-26 00:48:48 +00:00
message ( FATAL_ERROR "LAPACK is required to build gnss-sdr" )
2018-11-24 17:40:34 +00:00
endif ( )
2020-06-13 11:43:00 +00:00
if ( NOT TARGET LAPACK::LAPACK )
add_library ( LAPACK::LAPACK SHARED IMPORTED )
2020-06-13 12:09:20 +00:00
set_target_properties ( LAPACK::LAPACK PROPERTIES
2020-06-13 11:43:00 +00:00
I M P O R T E D _ L O C A T I O N $ { L A P A C K _ L I B R A R I E S }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { L A P A C K _ L I B R A R I E S }
)
endif ( )
2013-11-27 21:11:21 +00:00
2017-11-25 19:09:10 +00:00
2021-12-17 18:48:11 +00:00
2017-11-25 19:09:10 +00:00
################################################################################
# Armadillo - http://arma.sourceforge.net/
################################################################################
2022-07-26 22:23:54 +00:00
if ( ENABLE_OWN_ARMADILLO )
unset ( Armadillo::armadillo CACHE )
unset ( ARMADILLO_FOUND CACHE )
else ( )
unset ( Armadillo::armadillo CACHE )
unset ( ARMADILLO_FOUND CACHE )
find_package ( Armadillo )
endif ( )
2019-03-10 04:36:09 +00:00
set_package_properties ( Armadillo PROPERTIES
U R L " h t t p : / / a r m a . s o u r c e f o r g e . n e t / "
P U R P O S E " U s e d f o r m a t r i x c o m p u t a t i o n s . "
T Y P E R E Q U I R E D
)
2017-08-08 12:18:19 +00:00
if ( ARMADILLO_FOUND )
2019-06-15 22:16:52 +00:00
set_package_properties ( Armadillo PROPERTIES
D E S C R I P T I O N " C + + l i b r a r y f o r l i n e a r a l g e b r a a n d s c i e n t i f i c computing ( found: v ${ ARMADILLO_VERSION_STRING } ) "
)
2017-08-08 12:18:19 +00:00
if ( ${ ARMADILLO_VERSION_STRING } VERSION_LESS ${ GNSSSDR_ARMADILLO_MIN_VERSION } )
2022-07-26 22:23:54 +00:00
unset ( Armadillo::armadillo CACHE )
unset ( ARMADILLO_FOUND CACHE )
2019-09-08 11:56:20 +00:00
set ( ENABLE_OWN_ARMADILLO ON )
2019-12-01 17:52:51 +00:00
message ( STATUS " Armadillo >= v${GNSSSDR_ARMADILLO_MIN_VERSION} has not been found." )
2019-02-03 18:24:44 +00:00
else ( )
2019-09-08 11:56:20 +00:00
if ( NOT ENABLE_OWN_ARMADILLO )
add_library ( Armadillo::armadillo SHARED IMPORTED )
set_target_properties ( Armadillo::armadillo PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
I M P O R T E D _ L O C A T I O N " $ { A R M A D I L L O _ L I B R A R I E S } "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { A R M A D I L L O _ I N C L U D E _ D I R S } "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { A R M A D I L L O _ L I B R A R I E S } "
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2019-09-08 11:56:20 +00:00
else ( )
message ( STATUS " Armadillo has not been found." )
2018-11-24 17:40:34 +00:00
endif ( )
2017-08-07 17:29:05 +00:00
2017-02-03 11:04:15 +00:00
if ( NOT ARMADILLO_FOUND OR ENABLE_OWN_ARMADILLO )
2021-05-11 09:56:01 +00:00
message ( STATUS " Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded, built, and statically linked automatically" )
2019-03-09 00:39:32 +00:00
message ( STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2018-11-19 07:51:05 +00:00
set ( armadillo_BRANCH ${ GNSSSDR_ARMADILLO_LOCAL_VERSION } )
set ( armadillo_RELEASE ${ armadillo_BRANCH } )
#############################################
# Check if GFORTRAN is found in the system
#############################################
2020-01-13 00:49:00 +00:00
if ( NOT ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" ) AND NOT MSVC )
2018-11-19 07:51:05 +00:00
find_package ( GFORTRAN )
2019-03-10 04:36:09 +00:00
set_package_properties ( GFORTRAN PROPERTIES
P U R P O S E " R e q u i r e d b y A r m a d i l l o . "
T Y P E R E Q U I R E D
)
2018-11-19 07:51:05 +00:00
if ( NOT GFORTRAN )
message ( STATUS "The gfortran library has not been found." )
message ( STATUS " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2018-11-24 17:40:34 +00:00
message ( STATUS " sudo yum install gcc-fortran" )
2018-11-19 07:51:05 +00:00
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
2018-11-24 17:40:34 +00:00
message ( STATUS " sudo zypper install gcc-fortran" )
else ( )
message ( STATUS " sudo apt-get install gfortran" )
endif ( )
2018-11-19 07:51:05 +00:00
message ( FATAL_ERROR "gfortran is required to build gnss-sdr" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2018-11-19 07:51:05 +00:00
#############################################
# Download and build Armadillo
#############################################
2020-01-19 23:35:00 +00:00
set ( ARMADILLO_BUILD_COMMAND ${ CMAKE_COMMAND }
2022-07-28 08:37:36 +00:00
" - - b u i l d " " $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E } "
2020-01-19 23:35:00 +00:00
" - - c o n f i g " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2023-04-04 07:10:15 +00:00
" - - t a r g e t " i n s t a l l
2020-01-19 23:35:00 +00:00
)
2019-12-06 13:23:12 +00:00
if ( CMAKE_TOOLCHAIN_FILE )
set ( ARMADILLO_TOOLCHAIN_FILE -DCMAKE_TOOLCHAIN_FILE= ${ CMAKE_TOOLCHAIN_FILE } )
2020-02-29 13:33:09 +00:00
else ( )
set ( ARMADILLO_TOOLCHAIN_FILE "" )
2019-12-06 13:23:12 +00:00
endif ( )
2020-04-22 12:44:53 +00:00
set ( ARMADILLO_CXX_VERSION "" )
if ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND ${ CMAKE_CXX_COMPILER_VERSION } VERSION_LESS 4.8.3 )
set ( ARMADILLO_CXX_VERSION -DCMAKE_CXX_FLAGS=-std=c++11 )
endif ( )
2018-11-19 07:51:05 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( armadillo- ${ armadillo_RELEASE }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
2018-11-19 07:51:05 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t l a b . c o m / c o n r a d s n i c t a / a r m a d i l l o - c o d e . g i t
G I T _ T A G $ { a r m a d i l l o _ B R A N C H }
2023-04-04 07:10:15 +00:00
U P D A T E _ C O M M A N D " "
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / a r m a d i l l o / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S - D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
2023-04-04 07:10:15 +00:00
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
2020-01-19 23:35:00 +00:00
- D B U I L D _ S H A R E D _ L I B S = O F F
2022-07-26 22:23:54 +00:00
- D B U I L D _ S M O K E _ T E S T = O F F
- D A L L O W _ B L A S _ L A P A C K _ M A C O S = O N
2020-04-22 12:44:53 +00:00
$ { A R M A D I L L O _ C X X _ V E R S I O N }
2020-01-19 23:35:00 +00:00
$ { A R M A D I L L O _ T O O L C H A I N _ F I L E }
2019-12-06 13:23:12 +00:00
B U I L D _ C O M M A N D $ { A R M A D I L L O _ B U I L D _ C O M M A N D }
2018-11-19 07:51:05 +00:00
I N S T A L L _ C O M M A N D " "
)
2018-11-24 17:40:34 +00:00
else ( )
ExternalProject_Add ( armadillo- ${ armadillo_RELEASE }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
2018-11-19 07:51:05 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t l a b . c o m / c o n r a d s n i c t a / a r m a d i l l o - c o d e . g i t
G I T _ T A G $ { a r m a d i l l o _ B R A N C H }
2023-04-04 07:10:15 +00:00
U P D A T E _ C O M M A N D " "
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / a r m a d i l l o / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S - D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
2023-04-04 07:10:15 +00:00
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E }
2020-01-19 23:35:00 +00:00
- D B U I L D _ S H A R E D _ L I B S = O F F
2022-07-26 22:23:54 +00:00
- D B U I L D _ S M O K E _ T E S T = O F F
- D A L L O W _ B L A S _ L A P A C K _ M A C O S = O N
2020-04-22 12:44:53 +00:00
$ { A R M A D I L L O _ C X X _ V E R S I O N }
2020-01-19 23:35:00 +00:00
$ { A R M A D I L L O _ T O O L C H A I N _ F I L E }
2023-04-04 07:10:15 +00:00
B U I L D _ C O M M A N D $ { A R M A D I L L O _ B U I L D _ C O M M A N D }
2022-07-28 08:37:36 +00:00
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2018-11-19 07:51:05 +00:00
I N S T A L L _ C O M M A N D " "
)
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
2019-03-10 04:36:09 +00:00
# Create imported target
2018-11-19 07:51:05 +00:00
ExternalProject_Get_Property ( armadillo- ${ armadillo_RELEASE } binary_dir )
if ( NOT GFORTRAN )
set ( GFORTRAN "" )
2018-11-24 17:40:34 +00:00
endif ( )
2019-12-01 17:52:51 +00:00
set ( ARMADILLO_STATIC_LIBRARY ${ binary_dir } / ${ CMAKE_FIND_LIBRARY_PREFIXES } armadillo ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2021-05-11 09:56:01 +00:00
set ( LOCAL_ARMADILLO TRUE CACHE STRING "Armadillo downloaded, built, and statically linked automatically" FORCE )
2018-11-19 07:51:05 +00:00
set ( ARMADILLO_VERSION_STRING ${ armadillo_RELEASE } )
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /thirdparty/armadillo/armadillo- ${ armadillo_RELEASE } /include )
2019-02-03 18:24:44 +00:00
add_library ( Armadillo::armadillo STATIC IMPORTED )
add_dependencies ( Armadillo::armadillo armadillo- ${ armadillo_RELEASE } )
set_target_properties ( Armadillo::armadillo PROPERTIES
2019-04-02 00:41:20 +00:00
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2020-01-19 21:13:50 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " N o n e ; D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
M A P _ I M P O R T E D _ C O N F I G _ N O O P T W I T H A S M D e b u g
M A P _ I M P O R T E D _ C O N F I G _ C O V E R A G E D e b u g
M A P _ I M P O R T E D _ C O N F I G _ O 2 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ O 3 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ A S A N D e b u g
I M P O R T E D _ L O C A T I O N _ N O N E $ { A R M A D I L L O _ S T A T I C _ L I B R A R Y }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { A R M A D I L L O _ S T A T I C _ L I B R A R Y }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { A R M A D I L L O _ S T A T I C _ L I B R A R Y }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { A R M A D I L L O _ S T A T I C _ L I B R A R Y }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { A R M A D I L L O _ S T A T I C _ L I B R A R Y }
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / a r m a d i l l o / a r m a d i l l o - $ { a r m a d i l l o _ R E L E A S E } / i n c l u d e
2019-12-06 13:23:12 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B L A S _ L I B R A R I E S } $ { L A P A C K _ L I B R A R I E S } $ { G F O R T R A N } $ { A R M A D I L L O _ S T A T I C _ L I B R A R Y }
2019-02-03 18:24:44 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( Armadillo::armadillo PROPERTIES
I M P O R T E D _ L O C A T I O N _ D E B U G $ { b i n a r y _ d i r } / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { b i n a r y _ d i r } / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { b i n a r y _ d i r } / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { b i n a r y _ d i r } / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { B L A S _ L I B R A R I E S } $ { L A P A C K _ L I B R A R I E S } $ { G F O R T R A N } $ { b i n a r y _ d i r } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X } / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } a r m a d i l l o $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
)
endif ( )
2019-03-09 00:39:32 +00:00
set_package_properties ( Armadillo PROPERTIES
2019-06-18 06:59:06 +00:00
D E S C R I P T I O N " C + + l i b r a r y f o r l i n e a r a l g e b r a a n d s c i e n t i f i c c o m p u t i n g "
2021-05-11 09:56:01 +00:00
P U R P O S E " A r m a d i l l o $ { G N S S S D R _ A R M A D I L L O _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-03-09 00:39:32 +00:00
)
2022-07-26 22:23:54 +00:00
# Fix for macOS
find_library ( ARPACK_LIBRARY
N A M E S a r p a c k
P A T H S $ { C M A K E _ S Y S T E M _ L I B R A R Y _ P A T H } / o p t / l o c a l / l i b / u s r / l i b 6 4 / u s r / l i b / u s r / l o c a l / l i b 6 4 / u s r / l o c a l / l i b / o p t / l o c a l / l i b 6 4
)
if ( ARPACK_LIBRARY )
2022-07-27 11:19:36 +00:00
target_link_libraries ( Armadillo::armadillo INTERFACE ${ ARPACK_LIBRARY } )
2022-07-26 22:23:54 +00:00
endif ( )
2023-04-04 07:10:15 +00:00
find_library ( FLEXIBLAS_LIBRARY
N A M E S f l e x i b l a s
P A T H S $ { C M A K E _ S Y S T E M _ L I B R A R Y _ P A T H } / o p t / l o c a l / l i b / l i b 6 4 / l i b / u s r / l i b 6 4 / u s r / l i b / u s r / l o c a l / l i b 6 4 / u s r / l o c a l / l i b / o p t / l o c a l / l i b 6 4
)
if ( FLEXIBLAS_LIBRARY )
target_link_libraries ( Armadillo::armadillo INTERFACE ${ FLEXIBLAS_LIBRARY } )
endif ( )
find_library ( SUPERLU_LIBRARY
N A M E S s u p e r l u
P A T H S $ { C M A K E _ S Y S T E M _ L I B R A R Y _ P A T H } / o p t / l o c a l / l i b / u s r / l i b 6 4 / u s r / l i b / u s r / l o c a l / l i b 6 4 / u s r / l o c a l / l i b / o p t / l o c a l / l i b 6 4
)
if ( SUPERLU_LIBRARY )
target_link_libraries ( Armadillo::armadillo INTERFACE ${ SUPERLU_LIBRARY } )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2012-12-24 02:33:50 +00:00
2013-10-18 18:26:06 +00:00
2013-11-27 21:11:21 +00:00
################################################################################
2018-05-13 19:16:09 +00:00
# GnuTLS - https://www.gnutls.org/
2013-11-27 21:11:21 +00:00
################################################################################
2015-09-14 23:41:18 +00:00
find_package ( GnuTLS )
2019-03-10 04:36:09 +00:00
set_package_properties ( GnuTLS PROPERTIES
U R L " h t t p s : / / w w w . g n u t l s . o r g / "
P U R P O S E " U s e d f o r t h e S U P L p r o t o c o l i m p l e m e n t a t i o n . "
T Y P E R E Q U I R E D
)
2019-06-21 00:49:41 +00:00
if ( GnuTLS_FOUND AND GNUTLS_VERSION_STRING )
set_package_properties ( GnuTLS PROPERTIES
D E S C R I P T I O N " T r a n s p o r t L a y e r S e c u r i t y Library ( found: v ${ GNUTLS_VERSION_STRING } ) "
)
else ( )
set_package_properties ( GnuTLS PROPERTIES
D E S C R I P T I O N " T r a n s p o r t L a y e r S e c u r i t y L i b r a r y "
)
endif ( )
2019-09-30 12:58:34 +00:00
find_library ( GNUTLS_OPENSSL_LIBRARY
N A M E S g n u t l s - o p e n s s l l i b g n u t l s - o p e n s s l . s o . 2 7
P A T H S
/ u s r / l i b
2018-11-24 17:40:34 +00:00
/ u s r / l i b 6 4
/ u s r / l i b / x 8 6 _ 6 4 - l i n u x - g n u
/ u s r / l i b / a a r c h 6 4 - l i n u x - g n u
/ u s r / l i b / a r m - l i n u x - g n u e a b i h f
/ u s r / l i b / a r m - l i n u x - g n u e a b i
/ u s r / l i b / i 3 8 6 - l i n u x - g n u
/ u s r / l i b / a l p h a - l i n u x - g n u
/ u s r / l i b / h p p a - l i n u x - g n u
/ u s r / l i b / i 3 8 6 - g n u
/ u s r / l i b / i 6 8 6 - g n u
/ u s r / l i b / i 6 8 6 - l i n u x - g n u
/ u s r / l i b / x 8 6 _ 6 4 - k f r e e b s d - g n u
/ u s r / l i b / i 6 8 6 - k f r e e b s d - g n u
/ u s r / l i b / m 6 8 k - l i n u x - g n u
/ u s r / l i b / m i p s - l i n u x - g n u
/ u s r / l i b / m i p s 6 4 e l - l i n u x - g n u a b i 6 4
/ u s r / l i b / m i p s e l - l i n u x - g n u
/ u s r / l i b / p o w e r p c - l i n u x - g n u
/ u s r / l i b / p o w e r p c - l i n u x - g n u s p e
/ u s r / l i b / p o w e r p c 6 4 - l i n u x - g n u
/ u s r / l i b / p o w e r p c 6 4 l e - l i n u x - g n u
/ u s r / l i b / s 3 9 0 x - l i n u x - g n u
2019-08-12 09:33:51 +00:00
/ u s r / l i b / r i s c v 6 4 - l i n u x - g n u
2018-11-24 17:40:34 +00:00
/ u s r / l i b / s p a r c 6 4 - l i n u x - g n u
/ u s r / l i b / x 8 6 _ 6 4 - l i n u x - g n u x 3 2
/ u s r / l i b / s h 4 - l i n u x - g n u
2019-09-30 12:58:34 +00:00
/ u s r / l o c a l / l i b
/ u s r / l o c a l / l i b 6 4
/ o p t / l o c a l / l i b
2018-11-24 17:40:34 +00:00
)
2015-10-27 19:18:48 +00:00
if ( NOT GNUTLS_OPENSSL_LIBRARY )
2019-03-23 11:57:45 +00:00
if ( GnuTLS_FOUND )
message ( STATUS " But it was not built with openssl compatibility." )
endif ( )
message ( STATUS " Looking for OpenSSL instead..." )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2019-03-23 11:57:45 +00:00
set ( OPENSSL_ROOT_DIR /usr/local/opt/openssl ) # Trick for Homebrew
endif ( )
2018-11-19 07:51:05 +00:00
find_package ( OpenSSL )
2019-03-10 04:36:09 +00:00
set_package_properties ( OpenSSL PROPERTIES
U R L " h t t p s : / / w w w . o p e n s s l . o r g "
2019-06-18 06:59:06 +00:00
D E S C R I P T I O N " C r y p t o g r a p h y a n d S S L / T L S Toolkit ( found: v ${ OPENSSL_VERSION } ) "
2019-03-10 04:36:09 +00:00
P U R P O S E " U s e d f o r t h e S U P L p r o t o c o l i m p l e m e n t a t i o n . "
T Y P E R E Q U I R E D
)
2018-11-19 07:51:05 +00:00
if ( OPENSSL_FOUND )
2019-03-10 04:36:09 +00:00
set_package_properties ( GnuTLS PROPERTIES
P U R P O S E " N o t f o u n d , b u t O p e n S S L c a n r e p l a c e i t . "
)
2015-10-27 19:18:48 +00:00
set ( GNUTLS_INCLUDE_DIR ${ OPENSSL_INCLUDE_DIR } )
set ( GNUTLS_LIBRARIES "" )
set ( GNUTLS_OPENSSL_LIBRARY ${ OPENSSL_SSL_LIBRARY } )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
message ( " The GnuTLS library with openssl compatibility enabled has not been found." )
message ( " You can try to install the required libraries by typing:" )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2015-10-27 19:18:48 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-10-27 19:39:02 +00:00
message ( " sudo yum install openssl-devel" )
2018-11-24 17:40:34 +00:00
else ( )
2019-03-23 11:57:45 +00:00
message ( " sudo apt-get install libgnutls28-dev" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2019-03-23 11:57:45 +00:00
message ( " 'sudo port install gnutls', if you are using Macports, or" )
message ( " 'brew install openssl', if you are using Homebrew." )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
message ( FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2013-11-27 21:11:21 +00:00
2016-11-27 22:47:45 +00:00
2013-10-18 18:26:06 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2017-11-26 09:49:42 +00:00
# Matio - https://github.com/tbeu/matio
2019-03-10 04:36:09 +00:00
################################################################################
2017-11-26 09:49:42 +00:00
find_package ( MATIO )
2019-03-10 04:36:09 +00:00
set_package_properties ( MATIO PROPERTIES
P U R P O S E " U s e d t o s t o r e p r o c e s s i n g b l o c k ' s r e s u l t s i n M A T f i l e s r e a d a b l e f r o m M A T L A B / O c t a v e . "
T Y P E R E Q U I R E D
)
2018-02-24 17:01:10 +00:00
if ( NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${ GNSSSDR_MATIO_MIN_VERSION } )
2018-02-24 17:28:52 +00:00
if ( MATIO_FOUND )
2018-11-19 07:51:05 +00:00
message ( STATUS " Matio installed version (${MATIO_VERSION_STRING}) is too old (>= ${GNSSSDR_MATIO_MIN_VERSION} is required)." )
2018-11-24 17:40:34 +00:00
endif ( )
2021-05-11 09:56:01 +00:00
message ( STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded, built, and statically linked automatically" )
2019-03-09 00:39:32 +00:00
message ( STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2021-06-12 10:37:39 +00:00
set_package_properties ( MATIO PROPERTIES
P U R P O S E " M a t i o v $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
)
2021-06-13 19:05:20 +00:00
# Find ZLIB library https://github.com/madler/zlib
2017-11-26 09:49:42 +00:00
find_package ( ZLIB )
2019-03-09 00:39:32 +00:00
set_package_properties ( ZLIB PROPERTIES
U R L " h t t p s : / / w w w . z l i b . n e t / "
P U R P O S E " R e q u i r e d t o b u i l d M a t i o . "
T Y P E R E Q U I R E D
)
2019-06-19 21:42:46 +00:00
if ( ZLIB_FOUND AND ZLIB_VERSION_STRING )
set_package_properties ( ZLIB PROPERTIES
2019-06-26 19:07:59 +00:00
D E S C R I P T I O N " A M a s s i v e l y S p i f f y Y e t D e l i c a t e l y U n o b t r u s i v e C o m p r e s s i o n Library ( found: v ${ ZLIB_VERSION_STRING } ) "
2019-06-19 21:42:46 +00:00
)
else ( )
set_package_properties ( ZLIB PROPERTIES
D E S C R I P T I O N " A M a s s i v e l y S p i f f y Y e t D e l i c a t e l y U n o b t r u s i v e C o m p r e s s i o n L i b r a r y "
)
endif ( )
2021-06-13 19:05:20 +00:00
if ( NOT ZLIB_FOUND )
message ( FATAL_ERROR "*** The zlib library is required to build Matio from source." )
endif ( )
# Find HDF5 library
2021-06-12 10:37:39 +00:00
find_package ( HDF5 )
set_package_properties ( HDF5 PROPERTIES
U R L " h t t p s : / / s u p p o r t . h d f g r o u p . o r g / H D F 5 / "
P U R P O S E " R e q u i r e d t o b u i l d M a t i o . "
T Y P E R E Q U I R E D
)
if ( HDF5_FOUND AND HDF5_VERSION )
set_package_properties ( HDF5 PROPERTIES
D E S C R I P T I O N " A v e r s a t i l e d a t a m o d e l , a p o r t a b l e f i l e f o r m a t a n d a s o f t w a r e library ( found: v ${ HDF5_VERSION } ) "
)
else ( )
set_package_properties ( HDF5 PROPERTIES
D E S C R I P T I O N " A v e r s a t i l e d a t a m o d e l , a p o r t a b l e f i l e f o r m a t a n d a s o f t w a r e l i b r a r y "
)
endif ( )
if ( NOT HDF5_FOUND )
message ( STATUS " The hdf5 library has not been found in your system." )
message ( STATUS " Please try to install it by doing:" )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
message ( STATUS " $ sudo port install hdf5" )
message ( STATUS " or" )
message ( STATUS " $ brew install hdf5" )
endif ( )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2021-06-13 19:05:20 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" OR ${ LINUX_DISTRIBUTION } MATCHES "CentOS" )
message ( STATUS " sudo yum install hdf5-devel" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( STATUS " sudo zypper install hdf5-devel" )
else ( )
message ( STATUS " sudo apt-get install libhdf5-dev" )
endif ( )
2021-06-12 10:37:39 +00:00
endif ( )
message ( FATAL_ERROR "*** The hdf5 library is required to build Matio from source." )
endif ( )
2021-06-12 12:12:25 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.7 OR "${HDF5_VERSION}" VERSION_LESS "1.8.13" )
2017-11-26 09:49:42 +00:00
get_filename_component ( ZLIB_BASE_DIR ${ ZLIB_INCLUDE_DIRS } DIRECTORY )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2018-02-23 22:46:16 +00:00
if ( NOT EXISTS "/usr/bin/libtoolize" )
message ( " libtool has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum groupinstall 'Development Tools'" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install libtoool" )
2018-11-24 17:40:34 +00:00
else ( )
2018-02-23 22:46:16 +00:00
message ( " sudo apt-get install libtool" )
2018-11-24 17:40:34 +00:00
endif ( )
2021-06-13 19:05:20 +00:00
message ( FATAL_ERROR "libtool is required to build matio from source." )
2018-11-24 17:40:34 +00:00
endif ( )
2018-12-08 22:16:10 +00:00
if ( EXISTS "/usr/bin/aclocal" OR
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 6 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 5 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 4 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 3 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 1 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 0 " )
2018-02-24 17:28:52 +00:00
message ( STATUS "Automake found." )
2018-11-24 17:40:34 +00:00
else ( )
2018-02-23 22:46:16 +00:00
message ( " aclocal has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum groupinstall 'Development Tools'" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install automake" )
2018-11-24 17:40:34 +00:00
else ( )
2018-02-23 22:46:16 +00:00
message ( " sudo apt-get install automake" )
2018-11-24 17:40:34 +00:00
endif ( )
2021-06-13 19:05:20 +00:00
message ( FATAL_ERROR "aclocal is required to build matio from source." )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2021-06-12 10:37:39 +00:00
2020-02-09 22:29:17 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
if ( ( NOT EXISTS /usr/local/bin/glibtoolize AND NOT EXISTS /opt/local/bin/glibtoolize ) OR
( N O T E X I S T S / u s r / l o c a l / b i n / a c l o c a l A N D N O T E X I S T S / o p t / l o c a l / b i n / a c l o c a l ) )
message ( " libtool/automake tools have not been found." )
message ( " You can try to install them by typing:" )
message ( " 'sudo port install libtool automake', if you use Macports, or 'brew install libtool automake', if you use Homebrew" )
message ( FATAL_ERROR "libtool/automake tools are required to build matio from source" )
endif ( )
if ( CMAKE_GENERATOR STREQUAL Xcode )
if ( EXISTS /opt/local/bin/glibtoolize OR EXISTS /opt/local/bin/aclocal )
if ( NOT EXISTS /usr/local/bin/glibtoolize OR NOT EXISTS /usr/local/bin/aclocal )
message ( " WARNING: libtool/atomake binaries cannot be found by Xcode. Please do:" )
message ( "sudo ln -s /opt/local/bin/glibtoolize /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/aclocal /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/autom4te /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/automake /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/autoconf /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/autoreconf /usr/local/bin/" ) # not needed by Matio, but by Protocol Buffers
message ( FATAL_ERROR "libtool/automake tools cannot be found by Xcode" )
endif ( )
endif ( )
endif ( )
endif ( )
2019-04-23 22:56:17 +00:00
2021-06-13 19:05:20 +00:00
list ( GET HDF5_LIBRARIES 0 HDF5_FIRST_DIR )
get_filename_component ( HDF5_BASE_DIR2 ${ HDF5_FIRST_DIR } DIRECTORY )
get_filename_component ( HDF5_BASE_DIR ${ HDF5_BASE_DIR2 } DIRECTORY )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
if ( EXISTS /opt/local/include/hdf5.h )
set ( HDF5_BASE_DIR /opt/local )
2018-11-24 17:40:34 +00:00
endif ( )
2021-06-13 19:05:20 +00:00
if ( EXISTS /usr/local/include/hdf5.h )
set ( HDF5_BASE_DIR /usr/local )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2021-06-12 10:37:39 +00:00
set ( MATIO_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
if ( MATIO_MAKE_PROGRAM MATCHES "ninja" OR CMAKE_GENERATOR STREQUAL Xcode )
find_program ( MATIO_MAKE_EXECUTABLE make
P A T H S
/ u s r / b i n
/ u s r / l o c a l / b i n
)
if ( NOT MATIO_MAKE_EXECUTABLE )
message ( FATAL_ERROR "make is required to build Matio from source." )
2018-11-24 17:40:34 +00:00
endif ( )
2021-06-12 10:37:39 +00:00
set ( MATIO_MAKE_PROGRAM ${ MATIO_MAKE_EXECUTABLE } )
2018-11-24 17:40:34 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
set ( MATIO_STATIC_LIB ${ GNSSSDR_BINARY_DIR } /matio/lib/ ${ CMAKE_FIND_LIBRARY_PREFIXES } matio ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2021-06-12 10:37:39 +00:00
ExternalProject_Add ( matio- ${ GNSSSDR_MATIO_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / m a t i o
2021-06-12 10:37:39 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / t b e u / m a t i o
G I T _ T A G v $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / m a t i o / m a t i o - $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N }
U P D A T E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / m a t i o / m a t i o - $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N } / a u t o g e n . s h
C O N F I G U R E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / m a t i o / m a t i o - $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N } / c o n f i g u r e - - w i t h - h d f 5 = $ { H D F 5 _ B A S E _ D I R } - - w i t h - z l i b = $ { Z L I B _ B A S E _ D I R } - - w i t h - d e f a u l t - f i l e - v e r = 7 . 3 - - e n a b l e - m a t 7 3 = y e s - - p r e f i x = < I N S T A L L _ D I R >
2021-06-12 10:37:39 +00:00
B U I L D _ C O M M A N D $ { M A T I O _ M A K E _ P R O G R A M }
)
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /matio/lib )
2021-06-13 19:05:20 +00:00
else ( ) # CMake >= 3.7
include ( GNUInstallDirs )
2022-07-28 08:37:36 +00:00
set ( MATIO_STATIC_LIB ${ GNSSSDR_BINARY_DIR } /matio/ ${ CMAKE_INSTALL_LIBDIR } / ${ CMAKE_FIND_LIBRARY_PREFIXES } matio ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2021-06-14 09:37:12 +00:00
if ( "${HDF5_VERSION}" VERSION_GREATER "1.8.18" AND "${HDF5_VERSION}" VERSION_LESS "1.10.4" )
# weird workaround, but it works in all tested distros (Ubuntu, Debian, Fedora, CentOS, OpenSUSE)
2021-06-13 19:05:20 +00:00
set ( EXTRA_MATIO_BUILD_FLAGS -DMATIO_WITH_ZLIB=OFF -DHAVE_ZLIB=1 )
endif ( )
2021-06-12 10:37:39 +00:00
ExternalProject_Add ( matio- ${ GNSSSDR_MATIO_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / m a t i o
2021-06-12 10:37:39 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / t b e u / m a t i o
G I T _ T A G v $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N }
2023-03-31 11:23:31 +00:00
U P D A T E _ C O M M A N D " "
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / m a t i o / m a t i o - $ { G N S S S D R _ M A T I O _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / m a t i o
2021-06-12 10:37:39 +00:00
C M A K E _ A R G S - D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
2021-06-14 09:37:12 +00:00
- D C M A K E _ C _ C O M P I L E R = $ { C M A K E _ C _ C O M P I L E R }
2021-06-12 10:37:39 +00:00
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
- D M A T I O _ S H A R E D = O F F
2021-06-13 19:05:20 +00:00
" $ { E X T R A _ M A T I O _ B U I L D _ F L A G S } "
- D H D F 5 _ U S E _ S T A T I C _ L I B R A R I E S = O F F
2021-06-12 10:37:39 +00:00
- D M A T I O _ D E F A U L T _ F I L E _ V E R S I O N : S T R I N G = 7 . 3
- D M A T I O _ M A T 7 3 = O N
2022-07-28 08:37:36 +00:00
- D C M A K E _ I N S T A L L _ P R E F I X = $ { G N S S S D R _ B I N A R Y _ D I R } / m a t i o
2021-06-12 10:37:39 +00:00
B U I L D _ C O M M A N D $ { C M A K E _ C O M M A N D }
2022-07-28 08:37:36 +00:00
" - - b u i l d " " $ { G N S S S D R _ B I N A R Y _ D I R } / m a t i o "
2021-06-12 10:37:39 +00:00
" - - c o n f i g " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2021-06-13 19:05:20 +00:00
B U I L D _ B Y P R O D U C T S $ { M A T I O _ S T A T I C _ L I B }
2021-06-12 10:37:39 +00:00
)
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /matio/ ${ CMAKE_INSTALL_LIBDIR } )
2021-06-12 10:37:39 +00:00
endif ( )
2021-06-13 19:05:20 +00:00
2021-06-12 10:37:39 +00:00
if ( NOT TARGET Matio::matio )
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /matio/include )
2021-06-12 10:37:39 +00:00
add_library ( Matio::matio STATIC IMPORTED )
add_dependencies ( Matio::matio matio- ${ GNSSSDR_MATIO_LOCAL_VERSION } )
set_target_properties ( Matio::matio PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2021-06-13 19:05:20 +00:00
I M P O R T E D _ L O C A T I O N $ { M A T I O _ S T A T I C _ L I B }
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / m a t i o / i n c l u d e
2021-06-13 19:05:20 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { M A T I O _ S T A T I C _ L I B } ; $ { H D F 5 _ L I B R A R I E S } ; $ { Z L I B _ L I B R A R I E S } "
2021-06-12 10:37:39 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2017-11-26 09:49:42 +00:00
2018-11-10 18:16:13 +00:00
################################################################################
# PugiXML - https://pugixml.org/
################################################################################
2019-03-09 00:39:32 +00:00
find_package ( PUGIXML )
2019-03-10 04:36:09 +00:00
set_package_properties ( PUGIXML PROPERTIES
P U R P O S E " U s e d t o h a n d l e G a l i l e o a l m a n a c X M L f i l e s p u b l i s h e d b y t h e E u r o p e a n G N S S S e r v i c e C e n t r e . "
T Y P E R E Q U I R E D
)
if ( NOT PUGIXML_FOUND )
2021-05-11 09:56:01 +00:00
message ( STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded, built, and statically linked when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2019-12-01 17:52:51 +00:00
set ( PUGIXML_COMPILER -DCMAKE_CXX_COMPILER= ${ CMAKE_CXX_COMPILER } )
set ( PUGIXML_CMAKE_FLAGS "" )
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{OECORE_TARGET_SYSROOT} )
2018-11-11 11:27:01 +00:00
set ( PUGIXML_COMPILER "" )
2020-01-28 23:11:06 +00:00
if ( NOT CMAKE_TOOLCHAIN_FILE )
2022-07-28 08:37:36 +00:00
set ( PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${GNSSSDR_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake" )
2020-01-28 23:11:06 +00:00
else ( )
set ( PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" )
endif ( )
2019-11-01 18:29:28 +00:00
else ( )
if ( CMAKE_TOOLCHAIN_FILE )
2019-12-01 17:52:51 +00:00
set ( PUGIXML_CMAKE_FLAGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" )
2019-11-01 18:29:28 +00:00
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2020-01-19 23:35:00 +00:00
set ( PUGIXML_BUILD_COMMAND ${ CMAKE_COMMAND }
2022-07-28 08:37:36 +00:00
" - - b u i l d " " $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } "
2020-01-19 23:35:00 +00:00
" - - c o n f i g " $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
)
2018-11-11 11:27:01 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
2018-11-24 17:40:34 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / z e u x / p u g i x m l
G I T _ T A G v $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p u g i x m l / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S $ { P U G I X M L _ C O M P I L E R }
$ { P U G I X M L _ C M A K E _ F L A G S }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2018-11-24 17:40:34 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2019-12-06 13:23:12 +00:00
B U I L D _ C O M M A N D $ { P U G I X M L _ B U I L D _ C O M M A N D }
2018-11-24 17:40:34 +00:00
I N S T A L L _ C O M M A N D " "
2018-11-11 11:27:01 +00:00
)
2018-11-24 17:40:34 +00:00
else ( )
2019-12-06 13:23:12 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.12.0 )
set ( PARALLEL_BUILD "--parallel 2" )
endif ( )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
2018-11-24 17:40:34 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / z e u x / p u g i x m l
G I T _ T A G v $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p u g i x m l / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N }
2020-01-19 23:35:00 +00:00
C M A K E _ A R G S $ { P U G I X M L _ C O M P I L E R }
$ { P U G I X M L _ C M A K E _ F L A G S }
- D C M A K E _ B U I L D _ T Y P E = $ < $ < C O N F I G : D e b u g > : D e b u g > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l > $ < $ < C O N F I G : N o O p t W i t h A S M > : D e b u g > $ < $ < C O N F I G : C o v e r a g e > : D e b u g > $ < $ < C O N F I G : O 2 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : O 3 W i t h A S M > : R e l W i t h D e b I n f o > $ < $ < C O N F I G : A S A N > : D e b u g >
2018-11-24 17:40:34 +00:00
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2020-06-21 19:59:05 +00:00
B U I L D _ C O M M A N D " $ { P U G I X M L _ B U I L D _ C O M M A N D } $ { P A R A L L E L _ B U I L D } "
2022-07-28 08:37:36 +00:00
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p u g i x m l $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2018-11-24 17:40:34 +00:00
I N S T A L L _ C O M M A N D " "
2018-11-11 11:27:01 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
2022-07-28 08:37:36 +00:00
set ( PUGIXML_LIBRARIES ${ GNSSSDR_BINARY_DIR } /pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION } / ${ CMAKE_FIND_LIBRARY_PREFIXES } pugixml ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2019-12-01 17:52:51 +00:00
2019-02-03 18:24:44 +00:00
if ( NOT TARGET Pugixml::pugixml )
2022-07-28 08:37:36 +00:00
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /thirdparty/pugixml/pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION } /src )
2019-02-03 18:24:44 +00:00
add_library ( Pugixml::pugixml STATIC IMPORTED )
add_dependencies ( Pugixml::pugixml pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION } )
set_target_properties ( Pugixml::pugixml PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2020-01-19 21:13:50 +00:00
I M P O R T E D _ C O N F I G U R A T I O N S " N o n e ; D e b u g ; R e l e a s e ; R e l W i t h D e b I n f o ; M i n S i z e R e l "
M A P _ I M P O R T E D _ C O N F I G _ N O O P T W I T H A S M D e b u g
M A P _ I M P O R T E D _ C O N F I G _ C O V E R A G E D e b u g
M A P _ I M P O R T E D _ C O N F I G _ O 2 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ O 3 W I T H A S M R e l W i t h D e b I n f o
M A P _ I M P O R T E D _ C O N F I G _ A S A N D e b u g
I M P O R T E D _ L O C A T I O N _ N O N E $ { P U G I X M L _ L I B R A R I E S }
2019-12-06 13:23:12 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { P U G I X M L _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { P U G I X M L _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { P U G I X M L _ L I B R A R I E S }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { P U G I X M L _ L I B R A R I E S }
2022-07-28 08:37:36 +00:00
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p u g i x m l / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / s r c
2019-12-01 17:52:51 +00:00
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { P U G I X M L _ L I B R A R I E S }
2019-02-03 18:24:44 +00:00
)
2019-12-06 13:23:12 +00:00
if ( ( CMAKE_GENERATOR STREQUAL Xcode ) OR MSVC )
set_target_properties ( Pugixml::pugixml PROPERTIES
2022-07-28 08:37:36 +00:00
I M P O R T E D _ L O C A T I O N _ D E B U G $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / D e b u g / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p u g i x m l $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L E A S E $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / R e l e a s e / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p u g i x m l $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ R E L W I T H D E B I N F O $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / R e l W i t h D e b I n f o / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p u g i x m l $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I M P O R T E D _ L O C A T I O N _ M I N S I Z E R E L $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / M i n S i z e R e l / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p u g i x m l $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
I N T E R F A C E _ L I N K _ L I B R A R I E S $ { G N S S S D R _ B I N A R Y _ D I R } / p u g i x m l - $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } / $ < $ < C O N F I G : D e b u g > : D e b u g / > $ < $ < C O N F I G : R e l e a s e > : R e l e a s e / > $ < $ < C O N F I G : R e l W i t h D e b I n f o > : R e l W i t h D e b I n f o / > $ < $ < C O N F I G : M i n S i z e R e l > : M i n S i z e R e l / > $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p u g i x m l $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
2019-12-06 13:23:12 +00:00
)
endif ( )
2019-02-03 18:24:44 +00:00
endif ( )
2018-11-10 18:16:13 +00:00
2019-03-09 00:39:32 +00:00
set_package_properties ( PUGIXML PROPERTIES
2021-05-11 09:56:01 +00:00
P U R P O S E " P u g i X M L v $ { G N S S S D R _ P U G I X M L _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-03-09 00:39:32 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-10 18:16:13 +00:00
2017-11-26 09:49:42 +00:00
2016-11-27 22:47:45 +00:00
2014-11-14 20:42:22 +00:00
################################################################################
2019-04-20 09:52:00 +00:00
# Protocol Buffers https://github.com/protocolbuffers/protobuf
2014-11-14 20:42:22 +00:00
################################################################################
2019-04-21 09:51:49 +00:00
find_package ( Protobuf )
set_package_properties ( Protobuf PROPERTIES
U R L " h t t p s : / / d e v e l o p e r s . g o o g l e . c o m / p r o t o c o l - b u f f e r s / "
P U R P O S E " U s e d t o s e r i a l i z e o u t p u t d a t a i n a w a y t h a t c a n b e r e a d b y o t h e r a p p l i c a t i o n s . "
T Y P E R E Q U I R E D
)
2019-04-23 22:56:17 +00:00
if ( NOT Protobuf_VERSION )
set ( Protobuf_VERSION "0.0.0" )
endif ( )
2019-04-23 09:58:18 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.6 )
if ( PROTOBUF_FOUND )
set ( Protobuf_FOUND ${ PROTOBUF_FOUND } )
endif ( )
endif ( )
2019-04-21 09:51:49 +00:00
if ( Protobuf_FOUND AND CMAKE_VERSION VERSION_LESS 3.9 )
2019-04-23 09:58:18 +00:00
if ( PROTOBUF_INCLUDE_DIR )
set ( Protobuf_INCLUDE_DIR ${ PROTOBUF_INCLUDE_DIR } )
endif ( )
if ( PROTOBUF_LIBRARY )
set ( Protobuf_LIBRARY ${ PROTOBUF_LIBRARY } )
endif ( )
if ( PROTOBUF_PROTOC_EXECUTABLE )
set ( Protobuf_PROTOC_EXECUTABLE ${ PROTOBUF_PROTOC_EXECUTABLE } )
endif ( )
if ( PROTOBUF_PROTOC_LIBRARY )
set ( Protobuf_PROTOC_LIBRARY ${ PROTOBUF_PROTOC_EXECUTABLE } )
endif ( )
2019-04-21 09:51:49 +00:00
add_library ( protobuf::libprotobuf SHARED IMPORTED )
set_target_properties ( protobuf::libprotobuf PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
I M P O R T E D _ L O C A T I O N " $ { P r o t o b u f _ L I B R A R Y } "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { P r o t o b u f _ I N C L U D E _ D I R } "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { P r o t o b u f _ L I B R A R Y } "
2019-04-20 09:52:00 +00:00
)
2019-04-21 09:51:49 +00:00
add_executable ( protobuf::protoc IMPORTED )
set_target_properties ( protobuf::protoc PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
I M P O R T E D _ L O C A T I O N " $ { P r o t o b u f _ P R O T O C _ E X E C U T A B L E } "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { P r o t o b u f _ P R O T O C _ L I B R A R Y } "
)
2019-04-23 09:58:18 +00:00
if ( ${ Protobuf_VERSION } VERSION_EQUAL "0.0.0" )
set ( _PROTOBUF_COMMON_HEADER ${ Protobuf_INCLUDE_DIR } /google/protobuf/stubs/common.h )
set ( Protobuf_VERSION "" )
set ( Protobuf_LIB_VERSION "" )
file ( STRINGS ${ _PROTOBUF_COMMON_HEADER } _PROTOBUF_COMMON_H_CONTENTS REGEX "#define[ \t]+GOOGLE_PROTOBUF_VERSION[ \t]+" )
if ( _PROTOBUF_COMMON_H_CONTENTS MATCHES "#define[ \t]+GOOGLE_PROTOBUF_VERSION[ \t]+([0-9]+)" )
set ( Protobuf_LIB_VERSION "${CMAKE_MATCH_1}" )
endif ( )
unset ( _PROTOBUF_COMMON_H_CONTENTS )
math ( EXPR _PROTOBUF_MAJOR_VERSION "${Protobuf_LIB_VERSION} / 1000000" )
math ( EXPR _PROTOBUF_MINOR_VERSION "${Protobuf_LIB_VERSION} / 1000 % 1000" )
math ( EXPR _PROTOBUF_SUBMINOR_VERSION "${Protobuf_LIB_VERSION} % 1000" )
set ( Protobuf_VERSION "${_PROTOBUF_MAJOR_VERSION}.${_PROTOBUF_MINOR_VERSION}.${_PROTOBUF_SUBMINOR_VERSION}" )
endif ( )
2019-04-21 09:51:49 +00:00
endif ( )
2019-06-16 21:28:24 +00:00
if ( Protobuf_FOUND )
set_package_properties ( Protobuf PROPERTIES
D E S C R I P T I O N " S t r u c t u r e d d a t a s e r i a l i z a t i o n mechanism ( found: v ${ Protobuf_VERSION } ) "
)
2019-06-18 06:59:06 +00:00
else ( )
set_package_properties ( Protobuf PROPERTIES
D E S C R I P T I O N " S t r u c t u r e d d a t a s e r i a l i z a t i o n m e c h a n i s m "
)
2019-06-16 21:28:24 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
if ( Protobuf_FOUND AND CMAKE_CROSSCOMPILING )
2019-04-30 18:22:10 +00:00
find_program ( PROTOC_EXECUTABLE protoc )
if ( NOT PROTOC_EXECUTABLE )
find_program ( PROTOC_EXECUTABLE protoc
2019-10-10 18:05:14 +00:00
P A T H S
/ u s r / b i n
/ u s r / l o c a l / b i n
2019-04-30 18:22:10 +00:00
)
endif ( )
2019-04-21 09:51:49 +00:00
if ( PROTOC_EXECUTABLE )
2019-04-21 08:08:39 +00:00
set_target_properties ( protobuf::protoc PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
2019-04-21 09:51:49 +00:00
I M P O R T E D _ L O C A T I O N $ { P R O T O C _ E X E C U T A B L E }
2019-04-21 08:08:39 +00:00
)
2019-04-30 18:22:10 +00:00
set ( Protobuf_PROTOC_EXECUTABLE ${ PROTOC_EXECUTABLE } )
2018-11-24 17:40:34 +00:00
else ( )
2019-04-30 18:22:10 +00:00
message ( FATAL_ERROR "Please install the Protocol Buffers compiler v${Protobuf_VERSION} in the host machine" )
2019-04-21 08:08:39 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
endif ( )
2019-06-16 21:28:24 +00:00
2019-04-21 09:51:49 +00:00
if ( ( NOT Protobuf_FOUND ) OR ( NOT Protobuf_PROTOC_EXECUTABLE ) OR ( ${ Protobuf_VERSION } VERSION_LESS ${ GNSSSDR_PROTOBUF_MIN_VERSION } ) )
unset ( Protobuf_PROTOC_EXECUTABLE )
if ( CMAKE_CROSSCOMPILING )
if ( NOT Protobuf_FOUND )
ExternalProject_Add ( protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION }
2022-07-28 08:37:36 +00:00
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
2019-04-21 09:51:49 +00:00
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / p r o t o c o l b u f f e r s / p r o t o b u f
G I T _ T A G v $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
2022-07-28 08:37:36 +00:00
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
U P D A T E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / a u t o g e n . s h
C O N F I G U R E _ C O M M A N D " $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / c o n f i g u r e - - p r e f i x = $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } - - h o s t = $ E N V { O E C O R E _ T A R G E T _ A R C H } - - w i t h - p r o t o c = $ { P R O T O C _ E X E C U T A B L E } "
2019-04-21 09:51:49 +00:00
B U I L D _ C O M M A N D $ { C M A K E _ M A K E _ P R O G R A M }
2020-12-10 13:48:06 +00:00
I N S T A L L _ C O M M A N D $ { C M A K E _ M A K E _ P R O G R A M } D E S T D I R = i n s t a l l
2022-07-28 08:37:36 +00:00
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p r o t o b u f $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
$ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / b i n / p r o t o c
2019-04-20 16:47:18 +00:00
)
2022-07-28 08:37:36 +00:00
set ( PROTOBUF_PROTOC_EXECUTABLE "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" )
2019-04-20 16:47:18 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
else ( )
2023-03-31 11:23:31 +00:00
if ( CMAKE_VERSION VERSION_GREATER "3.13" )
find_package ( absl )
set_package_properties ( absl PROPERTIES
U R L " h t t p s : / / g i t h u b . c o m / a b s e i l / a b s e i l - c p p "
P U R P O S E " A b s e i l - c p p > = 2 0 2 3 0 1 1 7 r e q u i r e d t o b e i n s t a l l e d b e f o r e b u i l d i n g P r o t o c o l B u f f e r s > 2 2 . x o n t h e f l y . "
T Y P E O P T I O N A L
)
if ( absl_FOUND )
if ( absl_VERSION )
if ( ${ absl_VERSION } VERSION_LESS "20230117" )
unset ( absl_FOUND CACHE )
set ( absl_FOUND OFF )
endif ( )
2019-04-23 22:56:17 +00:00
else ( )
2023-03-31 11:23:31 +00:00
unset ( absl_FOUND CACHE )
set ( absl_FOUND OFF )
2019-04-23 22:56:17 +00:00
endif ( )
endif ( )
2023-03-31 11:23:31 +00:00
if ( absl_FOUND )
set_package_properties ( absl PROPERTIES
D E S C R I P T I O N " A n o p e n - s o u r c e c o l l e c t i o n o f C + + c o d e d e s i g n e d t o a u g m e n t t h e C + + s t a n d a r d library ( found: v ${ absl_VERSION } ) "
)
2019-04-23 22:56:17 +00:00
else ( )
2023-03-31 11:23:31 +00:00
if ( absl_VERSION )
set_package_properties ( absl PROPERTIES
D E S C R I P T I O N " A n o p e n - s o u r c e c o l l e c t i o n o f C + + c o d e d e s i g n e d t o a u g m e n t t h e C + + s t a n d a r d library ( found: v ${ absl_VERSION } ) "
)
2019-04-23 22:56:17 +00:00
else ( )
2023-03-31 11:23:31 +00:00
set_package_properties ( absl PROPERTIES
D E S C R I P T I O N " A n o p e n - s o u r c e c o l l e c t i o n o f C + + c o d e d e s i g n e d t o a u g m e n t t h e C + + s t a n d a r d l i b r a r y "
)
2019-04-23 22:56:17 +00:00
endif ( )
2023-03-31 11:23:31 +00:00
message ( STATUS "The Abseil library (https://github.com/abseil/abseil-cpp) >= v20230117 is required to be installed before building Protocol Buffers >22.x on the fly." )
message ( STATUS " Instead, Protocol Buffers v21.12 will be built, which does not require Abseil." )
set ( GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "21.12" )
2019-04-23 22:56:17 +00:00
endif ( )
endif ( )
2023-03-31 11:23:31 +00:00
if ( CMAKE_VERSION VERSION_LESS "3.13" OR NOT absl_FOUND )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
if ( NOT EXISTS "/usr/bin/libtoolize" )
message ( " libtool has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum groupinstall 'Development Tools'" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install libtoool" )
else ( )
message ( " sudo apt-get install libtool" )
endif ( )
message ( FATAL_ERROR "libtool is required to build Protocol Buffers from source" )
endif ( )
if ( EXISTS "/usr/bin/aclocal" OR
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 6 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 5 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 4 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 3 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 1 " O R
E X I S T S " / u s r / b i n / a c l o c a l - 1 . 1 0 " )
message ( STATUS "Automake found." )
else ( )
message ( " aclocal has not been found." )
message ( " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo yum groupinstall 'Development Tools'" )
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install automake" )
else ( )
message ( " sudo apt-get install automake" )
endif ( )
message ( FATAL_ERROR "aclocal is required to build Protocol Buffers from source" )
endif ( )
2020-02-09 22:29:17 +00:00
endif ( )
2023-03-31 11:23:31 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
if ( ( NOT EXISTS /usr/local/bin/glibtoolize AND NOT EXISTS /opt/local/bin/glibtoolize ) OR
( N O T E X I S T S / u s r / l o c a l / b i n / a c l o c a l A N D N O T E X I S T S / o p t / l o c a l / b i n / a c l o c a l ) )
message ( " libtool/automake tools have not been found." )
message ( " You can try to install them by typing:" )
message ( " 'sudo port install libtool automake', if you use Macports, or 'brew install libtool automake', if you use Homebrew" )
message ( FATAL_ERROR "libtool/automake tools are required to build Protocol Buffers from source" )
endif ( )
if ( CMAKE_GENERATOR STREQUAL Xcode )
if ( EXISTS /opt/local/bin/glibtoolize OR EXISTS /opt/local/bin/aclocal )
if ( NOT EXISTS /usr/local/bin/glibtoolize OR NOT EXISTS /usr/local/bin/aclocal )
message ( " WARNING: libtool/automake binaries cannot be found by Xcode. Please do:" )
message ( "sudo ln -s /opt/local/bin/glibtoolize /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/aclocal /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/autom4te /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/automake /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/autoconf /usr/local/bin/" )
message ( "sudo ln -s /opt/local/bin/autoreconf /usr/local/bin/" )
message ( FATAL_ERROR "libtool/automake tools cannot be found by Xcode" )
endif ( )
2020-02-09 22:29:17 +00:00
endif ( )
endif ( )
endif ( )
2019-04-23 23:30:22 +00:00
2023-03-31 11:23:31 +00:00
set ( PROTOBUF_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
if ( PROTOBUF_MAKE_PROGRAM MATCHES "ninja" OR CMAKE_GENERATOR STREQUAL Xcode )
find_program ( MAKE_EXECUTABLE make
P A T H S
/ u s r / b i n
/ u s r / l o c a l / b i n
)
if ( NOT MAKE_EXECUTABLE )
message ( FATAL_ERROR "make is required to build Protocol Buffers from source." )
endif ( )
set ( PROTOBUF_MAKE_PROGRAM ${ MAKE_EXECUTABLE } )
2019-04-23 22:56:17 +00:00
endif ( )
2023-03-31 11:23:31 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
ExternalProject_Add ( protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION }
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / p r o t o c o l b u f f e r s / p r o t o b u f
G I T _ T A G v $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
U P D A T E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / a u t o g e n . s h
C O N F I G U R E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / c o n f i g u r e - - p r e f i x = $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
B U I L D _ C O M M A N D $ { P R O T O B U F _ M A K E _ P R O G R A M }
I N S T A L L _ C O M M A N D $ { P R O T O B U F _ M A K E _ P R O G R A M } D E S T D I R = i n s t a l l
)
else ( )
if ( CMAKE_MAKE_PROGRAM MATCHES "make" )
include ( ProcessorCount )
ProcessorCount ( NUMBER_OF_PROCESSORS )
if ( NUMBER_OF_PROCESSORS GREATER 1 )
set ( PROTOBUF_PARALLEL_BUILD "-j${NUMBER_OF_PROCESSORS}" )
endif ( )
2020-06-13 12:01:35 +00:00
endif ( )
2023-03-31 11:23:31 +00:00
ExternalProject_Add ( protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION }
P R E F I X $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
G I T _ R E P O S I T O R Y h t t p s : / / g i t h u b . c o m / p r o t o c o l b u f f e r s / p r o t o b u f
G I T _ T A G v $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
S O U R C E _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
B I N A R Y _ D I R $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
U P D A T E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / a u t o g e n . s h
C O N F I G U R E _ C O M M A N D $ { G N S S S D R _ B I N A R Y _ D I R } / t h i r d p a r t y / p r o t o b u f / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / c o n f i g u r e - - p r e f i x = $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N }
B U I L D _ C O M M A N D $ { P R O T O B U F _ M A K E _ P R O G R A M } $ { P R O T O B U F _ P A R A L L E L _ B U I L D }
I N S T A L L _ C O M M A N D $ { P R O T O B U F _ M A K E _ P R O G R A M } D E S T D I R = i n s t a l l
B U I L D _ B Y P R O D U C T S $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p r o t o b u f $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X }
$ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / b i n / p r o t o c
)
2020-06-13 12:01:35 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
2023-03-31 11:23:31 +00:00
if ( NOT TARGET protobuf::protoc )
add_executable ( protobuf::protoc IMPORTED )
add_dependencies ( protobuf::protoc protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION } )
endif ( )
unset ( Protobuf_PROTOC_EXECUTABLE )
set ( PROTOBUF_PROTOC_EXECUTABLE "${GNSSSDR_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" )
set_target_properties ( protobuf::protoc PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
I M P O R T E D _ L O C A T I O N " $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / b i n / p r o t o c "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p r o t o c $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X } "
)
file ( MAKE_DIRECTORY ${ GNSSSDR_BINARY_DIR } /protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION } /include )
if ( NOT TARGET protobuf::libprotobuf )
add_library ( protobuf::libprotobuf STATIC IMPORTED )
add_dependencies ( protobuf::libprotobuf protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION } )
endif ( )
set_target_properties ( protobuf::libprotobuf PROPERTIES
I M P O R T E D _ L I N K _ I N T E R F A C E _ L A N G U A G E S " C X X "
I M P O R T E D _ L O C A T I O N " $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p r o t o b u f $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X } "
I N T E R F A C E _ I N C L U D E _ D I R E C T O R I E S " $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / i n c l u d e "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { G N S S S D R _ B I N A R Y _ D I R } / p r o t o b u f - $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } / l i b / $ { C M A K E _ F I N D _ L I B R A R Y _ P R E F I X E S } p r o t o b u f $ { C M A K E _ S T A T I C _ L I B R A R Y _ S U F F I X } "
)
if ( CMAKE_VERSION VERSION_LESS "3.10" )
set ( Protobuf_PROTOC_EXECUTABLE ${ PROTOBUF_PROTOC_EXECUTABLE } )
endif ( )
else ( ) # CMake >= 3.13 and Abseil found
include ( BuildProtobuf )
2019-04-20 09:52:00 +00:00
endif ( )
2020-02-02 12:00:35 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
if ( ${ Protobuf_VERSION } VERSION_LESS ${ GNSSSDR_PROTOBUF_MIN_VERSION } )
2019-04-23 22:56:17 +00:00
if ( NOT ( ${ Protobuf_VERSION } EQUAL "0.0.0" ) )
set_package_properties ( Protobuf PROPERTIES
P U R P O S E " P r o t o c o l B u f f e r s found ( v ${ Protobuf_VERSION } ) i s t o o old ( > v ${ GNSSSDR_PROTOBUF_MIN_VERSION } needed ) . "
)
endif ( )
2019-04-20 09:52:00 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
set_package_properties ( Protobuf PROPERTIES
2021-05-11 09:56:01 +00:00
P U R P O S E " P r o t o c o l B u f f e r s v $ { G N S S S D R _ P R O T O C O L B U F F E R S _ L O C A L _ V E R S I O N } w i l l b e d o w n l o a d e d , b u i l t , a n d s t a t i c a l l y l i n k e d w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } ' . "
2019-04-21 09:51:49 +00:00
)
2019-04-20 09:52:00 +00:00
endif ( )
2019-04-23 22:56:17 +00:00
if ( ${ Protobuf_VERSION } VERSION_EQUAL "0.0.0" )
unset ( Protobuf_VERSION )
2018-11-24 17:40:34 +00:00
endif ( )
2019-08-04 21:15:31 +00:00
2016-11-27 22:47:45 +00:00
2019-04-20 09:52:00 +00:00
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
################################################################################
2020-10-30 11:24:23 +00:00
# Doxygen - https://www.doxygen.nl (OPTIONAL, used if found)
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
################################################################################
2020-01-28 23:11:06 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.6.9 )
find_package ( Doxygen )
else ( )
find_package ( Doxygen OPTIONAL_COMPONENTS dot )
endif ( )
2019-03-10 04:36:09 +00:00
set_package_properties ( Doxygen PROPERTIES
2020-10-30 11:24:23 +00:00
U R L " h t t p s : / / w w w . d o x y g e n . n l "
2019-03-10 04:36:09 +00:00
P U R P O S E " U s e d t o g e n e r a t e c o d e d o c u m e n t a t i o n b y d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } d o c ' "
T Y P E O P T I O N A L
)
2019-06-19 21:42:46 +00:00
if ( DOXYGEN_FOUND AND DOXYGEN_VERSION )
set_package_properties ( Doxygen PROPERTIES
D E S C R I P T I O N " G e n e r a t e s d o c u m e n t a t i o n f r o m a n n o t a t e d C + + sources ( found: v ${ DOXYGEN_VERSION } ) "
)
else ( )
set_package_properties ( Doxygen PROPERTIES
D E S C R I P T I O N " G e n e r a t e s d o c u m e n t a t i o n f r o m a n n o t a t e d C + + s o u r c e s "
)
endif ( )
2020-01-28 23:11:06 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2.3 )
find_package ( LATEX )
else ( )
find_package ( LATEX COMPONENTS PDFLATEX )
endif ( )
2019-03-10 04:36:09 +00:00
set_package_properties ( LATEX PROPERTIES
U R L " h t t p s : / / w w w . l a t e x - p r o j e c t . o r g "
D E S C R I P T I O N " H i g h - q u a l i t y t y p e s e t t i n g s y s t e m "
2020-10-30 11:24:23 +00:00
P U R P O S E " U s e d t o g e n e r a t e a P D F m a n u a l b y d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } p d f m a n u a l ' . "
2019-03-10 04:36:09 +00:00
T Y P E O P T I O N A L
)
2020-10-30 11:24:23 +00:00
if ( DEFINED MATHJAX2_ROOT )
set ( ENABLE_EXTERNAL_MATHJAX OFF )
endif ( )
if ( ENABLE_EXTERNAL_MATHJAX AND NOT DEFINED MATHJAX2_USE_ROOT )
set ( MATHJAX2_USE_ROOT "https://cdnjs.cloudflare.com/ajax/libs/mathjax/${GNSSSDR_MATHJAX_EXTERNAL_VERSION}" )
endif ( )
unset ( MATHJAX2_FOUND CACHE )
2020-10-29 18:56:28 +00:00
find_package ( MATHJAX2 )
set_package_properties ( MATHJAX2 PROPERTIES
U R L " h t t p s : / / w w w . m a t h j a x . o r g "
D E S C R I P T I O N " B e a u t i f u l a n d a c c e s s i b l e m a t h i n a l l b r o w s e r s "
2020-10-30 11:24:23 +00:00
P U R P O S E " U s e d t o g e n e r a t e e q u a t i o n s i n H T M L d o c s w h e n d o i n g ' $ { C M A K E _ M A K E _ P R O G R A M _ P R E T T Y _ N A M E } d o c ' . "
2020-10-29 18:56:28 +00:00
T Y P E O P T I O N A L
)
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
if ( DOXYGEN_FOUND )
2018-11-19 07:51:05 +00:00
message ( STATUS "Doxygen found." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can build the documentation with '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'." )
2022-07-28 08:37:36 +00:00
message ( STATUS " When done, point your browser to ${GNSSSDR_BINARY_DIR}/docs/html/index.html" )
2020-01-28 23:11:06 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.9.6 )
if ( DOXYGEN_DOT_FOUND )
set ( HAVE_DOT "YES" )
endif ( )
if ( NOT TARGET Doxygen::doxygen )
add_executable ( Doxygen::doxygen IMPORTED GLOBAL )
set_target_properties ( Doxygen::doxygen PROPERTIES
I M P O R T E D _ L O C A T I O N " $ { D O X Y G E N _ E X E C U T A B L E } "
)
endif ( )
else ( )
2020-02-29 13:33:09 +00:00
if ( TARGET Doxygen::dot )
set ( HAVE_DOT "YES" )
else ( )
set ( HAVE_DOT "NO" )
endif ( )
2020-01-28 23:11:06 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
file ( TO_NATIVE_PATH ${ GNSSSDR_SOURCE_DIR } top_srcdir )
file ( TO_NATIVE_PATH ${ GNSSSDR_BINARY_DIR } top_builddir )
2020-01-20 23:31:50 +00:00
set ( PDFMANUAL_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
if ( PDFMANUAL_MAKE_PROGRAM MATCHES "ninja" )
find_program ( PDFMANUAL_MAKE_EXECUTABLE make
P A T H S
/ u s r / b i n
/ u s r / l o c a l / b i n
)
if ( NOT PDFMANUAL_MAKE_EXECUTABLE )
if ( PDFLATEX_COMPILER )
message ( STATUS "Warning: make is required to build the PDF manual, so target pdfmanual will not be generated." )
endif ( )
set ( PDFLATEX_COMPILER FALSE )
endif ( )
set ( PDFMANUAL_MAKE_PROGRAM ${ PDFMANUAL_MAKE_EXECUTABLE } )
endif ( )
2018-11-19 07:51:05 +00:00
if ( PDFLATEX_COMPILER )
set ( GENERATE_PDF_DOCUMENTATION "YES" )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
set ( GENERATE_PDF_DOCUMENTATION "NO" )
2020-10-29 18:56:28 +00:00
endif ( )
if ( MATHJAX2_FOUND )
2018-11-19 07:51:05 +00:00
set ( GNSSSDR_USE_MATHJAX "YES" )
2020-10-29 18:56:28 +00:00
else ( )
set ( GNSSSDR_USE_MATHJAX "NO" )
2018-11-24 17:40:34 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
configure_file ( ${ GNSSSDR_SOURCE_DIR } /docs/doxygen/Doxyfile.in
$ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / d o x y g e n / D o x y f i l e
2018-11-19 07:51:05 +00:00
@ O N L Y
)
add_custom_target ( doc
2022-07-28 08:37:36 +00:00
D o x y g e n : : d o x y g e n $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / d o x y g e n / D o x y f i l e
W O R K I N G _ D I R E C T O R Y $ { G N S S S D R _ B I N A R Y _ D I R }
2020-01-20 23:31:50 +00:00
C O M M E N T " G e n e r a t i n g H T M L d o c u m e n t a t i o n f r o m s o u r c e c o d e w i t h D o x y g e n . . . " V E R B A T I M
2018-11-19 07:51:05 +00:00
)
2019-03-09 00:39:32 +00:00
if ( PDFLATEX_COMPILER )
2022-07-28 08:37:36 +00:00
message ( STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${GNSSSDR_BINARY_DIR}/docs/GNSS-SDR_manual.pdf" )
2018-11-19 07:51:05 +00:00
add_custom_target ( pdfmanual
2020-01-20 23:31:50 +00:00
C O M M A N D $ { P D F M A N U A L _ M A K E _ P R O G R A M }
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y r e f m a n . p d f $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / G N S S - S D R _ m a n u a l . p d f
2020-01-20 23:31:50 +00:00
C O M M A N D $ { P D F M A N U A L _ M A K E _ P R O G R A M } c l e a n
2018-11-19 07:51:05 +00:00
D E P E N D S d o c
2022-07-28 08:37:36 +00:00
W O R K I N G _ D I R E C T O R Y $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / l a t e x
2020-01-20 23:31:50 +00:00
C O M M E N T " G e n e r a t i n g P D F m a n u a l w i t h L a T e X a n d p d f l a t e x . . . " V E R B A T I M
2018-11-19 07:51:05 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-02-21 08:59:06 +00:00
message ( STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc-clean' will clean the documentation." )
2020-02-28 19:57:28 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.17 )
add_custom_target ( doc-clean
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / h t m l
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / l a t e x
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / G N S S - S D R _ m a n u a l . p d f
2020-02-28 19:57:28 +00:00
C O M M E N T " C l e a n i n g d o c u m e n t a t i o n . " V E R B A T I M
)
else ( )
add_custom_target ( doc-clean
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E r m - r f $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / h t m l
C O M M A N D $ { C M A K E _ C O M M A N D } - E r m - r f $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / l a t e x
C O M M A N D $ { C M A K E _ C O M M A N D } - E r m - f $ { G N S S S D R _ B I N A R Y _ D I R } / d o c s / G N S S - S D R _ m a n u a l . p d f
2020-02-28 19:57:28 +00:00
C O M M E N T " C l e a n i n g d o c u m e n t a t i o n . " V E R B A T I M
)
endif ( )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS " Doxygen has not been found in your system." )
message ( STATUS " You can get nice code documentation by using it!" )
2020-10-30 11:24:23 +00:00
message ( STATUS " Get it from https://www.doxygen.nl/download.html" )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2018-11-19 07:51:05 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( STATUS " or simply by doing 'sudo yum install doxygen-latex'." )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS " or simply by doing 'sudo apt-get install doxygen-latex'." )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2020-01-13 00:49:00 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2020-01-20 23:31:50 +00:00
message ( STATUS " or simply by doing 'sudo port install doxygen +docs', if you are using Macports," )
message ( STATUS " or 'brew cask install mactex', then restart Terminal and do 'brew install graphviz doxygen', if you use Homebrew." )
2018-11-24 17:40:34 +00:00
endif ( )
2020-10-30 11:24:23 +00:00
set ( ENABLE_EXTERNAL_MATHJAX OFF )
2018-11-24 17:40:34 +00:00
endif ( )
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
2019-03-10 04:36:09 +00:00
################################################################################
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
# OpenCL (OPTIONAL)
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
find_package ( OPENCL QUIET )
2019-03-10 04:36:09 +00:00
set_package_properties ( OPENCL PROPERTIES
P U R P O S E " U s e d i n s o m e p r o c e s s i n g b l o c k i m p l e m e n t a t i o n s . "
T Y P E O P T I O N A L
)
2019-08-02 12:52:40 +00:00
if ( NOT OPENCL_FOUND )
set ( ENABLE_OPENCL OFF )
endif ( )
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
if ( ENABLE_OPENCL )
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{DISABLE_OPENCL} )
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
set ( DISABLE_OPENCL TRUE )
2018-11-24 17:40:34 +00:00
endif ( )
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
if ( DISABLE_OPENCL )
2019-08-02 12:52:40 +00:00
set ( ENABLE_OPENCL OFF )
2018-11-24 17:40:34 +00:00
else ( )
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
if ( OPENCL_FOUND )
message ( STATUS "OpenCL has been found and will be used by some processing blocks" )
2019-06-26 21:20:12 +00:00
message ( STATUS " You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ..'" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2023-01-26 17:39:25 +00:00
if ( ENABLE_PACKAGING )
2019-08-02 12:52:40 +00:00
set ( ENABLE_OPENCL OFF )
2023-01-26 17:39:25 +00:00
message ( STATUS "ENABLE_PACKAGING is set to ON so the use of OpenCL has been disabled." )
2018-11-24 17:40:34 +00:00
endif ( )
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
if ( NOT OPENCL_FOUND )
message ( STATUS "Processing blocks using OpenCL will not be built." )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
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
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2015-08-25 17:01:02 +00:00
# CUDA (OPTIONAL)
2019-03-10 04:36:09 +00:00
################################################################################
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{CUDA_GPU_ACCEL} )
2018-11-19 07:51:05 +00:00
message ( STATUS "CUDA_GPU_ACCEL environment variable found." )
2015-08-25 17:01:02 +00:00
set ( ENABLE_CUDA ON )
2018-11-24 17:40:34 +00:00
endif ( )
2015-08-25 17:01:02 +00:00
if ( ENABLE_CUDA )
2020-08-28 10:02:01 +00:00
set ( CMAKE_CUDA_STANDARD 14 )
set ( CMAKE_CUDA_EXTENSIONS ON )
2019-06-24 18:02:19 +00:00
if ( CMAKE_VERSION VERSION_GREATER 3.11 )
include ( CheckLanguage )
check_language ( CUDA )
if ( CMAKE_CUDA_COMPILER )
enable_language ( CUDA )
set ( CUDA_FOUND TRUE )
else ( )
set ( ENABLE_CUDA OFF )
endif ( )
else ( )
find_package ( CUDA REQUIRED )
set_package_properties ( CUDA PROPERTIES
U R L " h t t p s : / / d e v e l o p e r . n v i d i a . c o m / c u d a - d o w n l o a d s "
P U R P O S E " U s e d i n s o m e p r o c e s s i n g b l o c k i m p l e m e n t a t i o n s . "
T Y P E R E Q U I R E D
)
2020-08-28 10:02:01 +00:00
if ( CUDA_FOUND )
set_package_properties ( CUDA PROPERTIES
D E S C R I P T I O N " L i b r a r y f o r p a r a l l e l p r o g r a m m i n g i n N v i d i a GPUs ( found: v ${ CUDA_VERSION_STRING } ) "
)
set ( CMAKE_CUDA_COMPILER_ID "NVIDIA" ) # only for reporting purposes
set ( CMAKE_CUDA_COMPILER_VERSION ${ CUDA_VERSION_STRING } ) # only for reporting purposes
else ( )
set_package_properties ( CUDA PROPERTIES
D E S C R I P T I O N " L i b r a r y f o r p a r a l l e l p r o g r a m m i n g i n N v i d i a G P U s "
)
2019-06-24 18:02:19 +00:00
set ( ENABLE_CUDA OFF )
endif ( )
endif ( )
endif ( )
if ( ENABLE_CUDA )
2018-11-19 07:51:05 +00:00
message ( STATUS "NVIDIA CUDA GPU Acceleration will be enabled." )
2019-03-10 04:36:09 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_CUDA=OFF ..'" )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "NVIDIA CUDA GPU Acceleration will be not enabled." )
2018-11-24 17:40:34 +00:00
endif ( )
2015-08-25 17:01:02 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2018-05-16 09:36:37 +00:00
# CUSTOM UDP PACKET SOURCE (OPTIONAL)
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
find_package ( PCAP )
2019-03-10 04:36:09 +00:00
set_package_properties ( PCAP PROPERTIES
P U R P O S E " U s e d f o r t h e c u s t o m U D P I P p a c k e t s o u r c e . "
T Y P E O P T I O N A L
)
2019-06-24 19:40:25 +00:00
if ( PCAP_FOUND )
set ( ENABLE_RAW_UDP ON )
endif ( )
2018-05-16 09:36:37 +00:00
if ( ENABLE_RAW_UDP )
2019-06-24 19:40:25 +00:00
message ( STATUS "Highly-optimized custom UDP IP packet source is enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_RAW_UDP=OFF ..'" )
2019-02-04 17:17:35 +00:00
if ( NOT PCAP_FOUND )
message ( FATAL_ERROR "PCAP required to compile custom UDP packet sample source (with ENABLE_RAW_UDP=ON)" )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2017-08-07 17:29:05 +00:00
2019-02-04 17:17:35 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2017-02-13 16:20:49 +00:00
# FPGA (OPTIONAL)
2019-03-10 04:36:09 +00:00
################################################################################
2017-02-13 16:20:49 +00:00
if ( ENABLE_FPGA )
2019-08-12 09:53:53 +00:00
message ( STATUS "FPGA offloading will be enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_FPGA=OFF ..'" )
2018-11-24 17:40:34 +00:00
else ( )
2019-08-12 09:53:53 +00:00
message ( STATUS "FPGA offloading will be not enabled." )
message ( STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for FPGA offloading." )
2018-11-24 17:40:34 +00:00
endif ( )
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
2017-08-07 17:29:05 +00:00
2012-12-24 11:42:23 +00:00
################################################################################
2012-12-24 02:33:50 +00:00
# Setup of optional drivers
2012-12-24 11:42:23 +00:00
################################################################################
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
2019-02-04 21:44:45 +00:00
##########################################
2019-02-04 17:17:35 +00:00
# gr-osmosdr - OPTIONAL
2019-02-04 21:44:45 +00:00
# https://github.com/osmocom/gr-osmosdr
##########################################
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{RTLSDR_DRIVER} )
2018-11-19 07:51:05 +00:00
message ( STATUS "RTLSDR_DRIVER environment variable found." )
2014-12-15 16:39:22 +00:00
set ( ENABLE_OSMOSDR ON )
2018-11-24 17:40:34 +00:00
endif ( )
2015-03-03 17:07:26 +00:00
2019-03-09 00:39:32 +00:00
find_package ( GROSMOSDR )
2019-03-10 04:36:09 +00:00
set_package_properties ( GROSMOSDR PROPERTIES
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h O s m o S D R a n d o t h e r f r o n t - ends ( HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc. ) . "
T Y P E O P T I O N A L
)
2014-12-15 16:39:22 +00:00
if ( ENABLE_OSMOSDR )
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
if ( GROSMOSDR_FOUND )
2018-11-19 07:51:05 +00:00
message ( STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ..'" )
2018-11-24 17:40:34 +00:00
else ( )
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
if ( ENABLE_PACKAGING )
2018-11-24 17:40:34 +00:00
message ( WARNING "gr-osmosdr has not been found. Source blocks depending on it will NOT be built." )
else ( )
message ( FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver" )
endif ( )
2019-06-24 19:29:35 +00:00
set ( ENABLE_OSMOSDR OFF )
2018-11-24 17:40:34 +00:00
endif ( )
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Enable it with 'cmake -DENABLE_OSMOSDR=ON ..' to add support for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based USB dongles, etc.)" )
2018-11-24 17:40:34 +00:00
endif ( )
2012-12-24 02:33:50 +00:00
2019-02-04 17:17:35 +00:00
2021-12-17 18:48:11 +00:00
2021-01-22 16:45:26 +00:00
##########################################
# gr-limesdr - OPTIONAL
# https://github.com/myriadrf/gr-limesdr
##########################################
find_package ( GRLIMESDR )
2021-12-06 19:56:28 +00:00
set_package_properties ( GRLIMESDR PROPERTIES
2021-01-22 16:45:26 +00:00
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h L i m e S D R . "
T Y P E O P T I O N A L
)
if ( ENABLE_LIMESDR )
if ( GRLIMESDR_FOUND )
message ( STATUS "The driver for LimeSDR will be compiled." )
message ( STATUS " You can disable it with 'cmake -DENABLE_LIMESDR=OFF ..'" )
else ( )
if ( ENABLE_PACKAGING )
message ( WARNING "gr-limesdr has not been found. Source blocks depending on it will NOT be built." )
else ( )
message ( FATAL_ERROR "gr-limesdr required to build gnss-sdr with the optional LIMESDR driver" )
endif ( )
set ( ENABLE_LIMESDR OFF )
endif ( )
else ( )
message ( STATUS "The (optional) driver for LimeSDR is not enabled." )
message ( STATUS " Enable it with 'cmake -DENABLE_LIMESDR=ON ..' to add support for LimeSDR." )
endif ( )
2021-12-17 18:48:11 +00:00
2019-02-04 17:17:35 +00:00
##############################################
# gr-iio - OPTIONAL
2019-02-04 21:44:45 +00:00
# IIO blocks for GNU Radio
# https://github.com/analogdevicesinc/gr-iio
2019-02-04 17:17:35 +00:00
##############################################
2019-10-05 19:12:54 +00:00
if ( GNURADIO_IIO_FOUND )
set ( GRIIO_FOUND TRUE )
set ( GR_IIO_INCLUDE_HAS_GNURADIO TRUE )
set ( GNURADIO_API_IIO TRUE )
else ( )
2021-04-04 09:24:55 +00:00
# Force to always search for gr-iio
unset ( GRIIO_FOUND CACHE )
unset ( IIO_INCLUDE_DIRS CACHE )
unset ( IIO_LIBRARIES CACHE )
2019-10-05 19:12:54 +00:00
find_package ( GRIIO )
set_package_properties ( GRIIO PROPERTIES
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h P l u t o S D R a n d F M C O M M S d e v i c e s . "
T Y P E O P T I O N A L
)
endif ( )
2019-10-08 17:34:18 +00:00
find_package ( LIBAD9361 )
set_package_properties ( LIBAD9361 PROPERTIES
2019-10-12 11:23:57 +00:00
P U R P O S E " U s e d f o r c o n f i g u r i n g d e v i c e s w i t h t h e A D 9 3 6 1 c h i p s e t . "
2019-10-08 17:34:18 +00:00
T Y P E O P T I O N A L
)
if ( NOT LIBAD9361_FOUND )
2019-10-09 17:05:31 +00:00
set ( ENABLE_AD9361 OFF )
2019-10-10 08:40:37 +00:00
set ( ENABLE_FMCOMMS2 OFF )
2019-10-08 17:34:18 +00:00
endif ( )
2019-09-07 14:41:27 +00:00
if ( ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2 )
if ( NOT GRIIO_FOUND )
message ( STATUS "gnuradio-iio not found, its installation is required." )
message ( STATUS "Please build and install the following projects:" )
message ( STATUS " * libiio from https://github.com/analogdevicesinc/libiio" )
message ( STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio" )
message ( STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio" )
if ( ENABLE_PACKAGING )
set ( ENABLE_PLUTOSDR OFF )
set ( ENABLE_FMCOMMS2 OFF )
else ( )
message ( FATAL_ERROR "gnuradio-iio is required for building gnss-sdr with -DENABLE_PLUTOSDR=ON or -DENABLE_FMCOMMS2=ON." )
endif ( )
endif ( )
endif ( )
2019-02-04 17:17:35 +00:00
2021-12-17 18:48:11 +00:00
2019-03-10 04:36:09 +00:00
#####################################################################
2019-02-04 17:17:35 +00:00
# libiio - OPTIONAL
2019-03-10 04:36:09 +00:00
# A library for interfacing with local and remote Linux IIO devices
2019-02-04 21:44:45 +00:00
# https://github.com/analogdevicesinc/libiio
2019-03-10 04:36:09 +00:00
#####################################################################
2019-03-09 00:39:32 +00:00
find_package ( LIBIIO )
set_package_properties ( LIBIIO PROPERTIES
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h t h e A D 9 3 6 1 c h i p s e t . "
T Y P E O P T I O N A L
)
2019-09-07 14:41:27 +00:00
if ( ENABLE_AD9361 OR ENABLE_FMCOMMS2 )
if ( NOT LIBIIO_FOUND )
message ( STATUS "libiio not found, its installation is required." )
message ( STATUS "Please build and install the following projects:" )
message ( STATUS " * libiio from https://github.com/analogdevicesinc/libiio" )
message ( STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio" )
message ( STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio" )
if ( ENABLE_PACKAGING )
set ( ENABLE_AD9361 OFF )
set ( ENABLE_FMCOMMS2 OFF )
else ( )
message ( FATAL_ERROR "libiio is required for building gnss-sdr with -DENABLE_AD9361=ON." )
endif ( )
endif ( )
endif ( )
2019-02-04 17:17:35 +00:00
2021-12-17 18:48:11 +00:00
2019-02-04 17:17:35 +00:00
##############################################
# TELEORBIT FLEXIBAND FRONTEND - OPTIONAL
##############################################
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{FLEXIBAND_DRIVER} )
2018-11-19 07:51:05 +00:00
message ( STATUS "FLEXIBAND_DRIVER environment variable found." )
2015-03-03 17:07:26 +00:00
set ( ENABLE_FLEXIBAND ON )
2018-11-24 17:40:34 +00:00
endif ( )
2015-03-03 17:07:26 +00:00
if ( FLEXIBAND_DRIVER )
set ( ENABLE_FLEXIBAND ON )
2018-11-24 17:40:34 +00:00
endif ( )
2015-03-03 17:07:26 +00:00
if ( ENABLE_FLEXIBAND )
2018-11-19 07:51:05 +00:00
message ( STATUS "The Teleorbit Flexiband front-end source will be compiled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ..'" )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Enable it with 'cmake -DENABLE_FLEXIBAND=ON ..' to add support for the Teleorbit Flexiband front-end." )
2018-11-24 17:40:34 +00:00
endif ( )
2019-03-09 00:39:32 +00:00
find_package ( TELEORBIT )
set_package_properties ( TELEORBIT PROPERTIES
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h t h e F l e x i b a n d f r o n t - e n d . "
T Y P E O P T I O N A L
)
2019-03-10 04:36:09 +00:00
if ( ENABLE_FLEXIBAND )
if ( NOT TELEORBIT_FOUND )
message ( FATAL_ERROR "Teleorbit Flexiband GNU Radio driver required to build gnss-sdr with the optional FLEXIBAND adapter" )
endif ( )
endif ( )
2019-03-09 00:39:32 +00:00
2019-02-04 17:17:35 +00:00
2021-12-17 18:48:11 +00:00
2019-02-04 21:44:45 +00:00
#######################################################
# CTTC's digital array beamformer prototype - OPTIONAL
#######################################################
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{RAW_ARRAY_DRIVER} )
2019-02-04 17:17:35 +00:00
message ( STATUS "RAW_ARRAY_DRIVER environment variable found." )
set ( ENABLE_ARRAY ON )
endif ( )
if ( RAW_ARRAY_DRIVER )
set ( ENABLE_ARRAY ON )
endif ( )
2019-03-09 00:39:32 +00:00
find_package ( GRDBFCTTC QUIET )
2019-03-10 04:36:09 +00:00
set_package_properties ( GRDBFCTTC PROPERTIES
U R L " h t t p s : / / g i t h u b . c o m / g n s s - s d r / g r - d b f c t t c s "
D E S C R I P T I O N " C T T C ' s a r r a y p r o t o t y p e G N U R a d i o b l o c k . "
P U R P O S E " U s e d f o r c o m m u n i c a t i o n w i t h C T T C ' s a n t e n n a a r r a y . "
T Y P E O P T I O N A L
)
2019-02-04 17:17:35 +00:00
if ( ENABLE_ARRAY )
message ( STATUS "CTTC's Antenna Array front-end driver will be compiled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_ARRAY=OFF ..'" )
2019-02-04 17:17:35 +00:00
else ( )
message ( STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Enable it with 'cmake -DENABLE_ARRAY=ON ..' to add support for the CTTC experimental array front-end." )
2018-11-24 17:40:34 +00:00
endif ( )
2013-10-18 18:26:06 +00:00
2012-12-25 10:28:29 +00:00
2016-11-27 22:47:45 +00:00
################################################################################
2019-02-04 21:44:45 +00:00
# GPerftools - https://github.com/gperftools/gperftools - OPTIONAL)
2016-11-27 22:47:45 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
find_package ( GPERFTOOLS )
2019-03-10 04:36:09 +00:00
set_package_properties ( GPERFTOOLS PROPERTIES
P U R P O S E " U s e d f o r p e r f o r m a n c e a n a l y s i s . "
T Y P E O P T I O N A L
)
2016-11-27 22:47:45 +00:00
if ( ENABLE_GPERFTOOLS )
2018-11-19 07:51:05 +00:00
if ( NOT GPERFTOOLS_FOUND )
2016-11-27 22:47:45 +00:00
message ( STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Binaries will be compiled without 'tcmalloc' and 'profiler' libraries." )
message ( STATUS " You can install GPerftools from https://github.com/gperftools/gperftools" )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "GPerftools libraries found." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Binaries will be compiled with 'tcmalloc' and 'profiler' libraries." )
2018-11-24 17:40:34 +00:00
endif ( )
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
# Set GPerftools related flags if it is available
2018-05-13 19:16:09 +00:00
# See https://github.com/gperftools/gperftools/blob/master/README
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
if ( GPERFTOOLS_FOUND )
2018-11-17 13:31:06 +00:00
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
2019-02-24 13:11:21 +00:00
add_compile_options ( -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free )
2018-11-24 17:40:34 +00:00
endif ( )
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
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2019-02-24 13:11:21 +00:00
add_compile_options ( -fno-builtin )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
endif ( )
2012-12-24 02:33:50 +00:00
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2016-11-27 22:47:45 +00:00
# GNU gprof (OPTIONAL) - https://sourceware.org/binutils/docs/gprof/
2019-03-10 04:36:09 +00:00
################################################################################
2015-05-03 08:15:51 +00:00
if ( ENABLE_GPROF )
2019-02-24 13:11:21 +00:00
add_compile_options ( -pg )
2018-11-19 07:51:05 +00:00
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg" )
2018-11-24 17:40:34 +00:00
endif ( )
2015-05-03 08:15:51 +00:00
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2016-11-27 22:47:45 +00:00
# Set compiler flags
2019-03-10 04:36:09 +00:00
################################################################################
2019-08-23 21:18:40 +00:00
set ( CXX_WARNING_FLAGS -Wall -Wextra )
2018-11-17 13:31:06 +00:00
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
2019-02-24 13:11:21 +00:00
# Add warning flags
# For "-Wall" see https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2019-02-24 19:22:15 +00:00
if ( NOT ( CMAKE_VERSION VERSION_LESS "3.3" ) )
2019-08-23 21:18:40 +00:00
add_compile_options ( "$<$<COMPILE_LANGUAGE:CXX>:${CXX_WARNING_FLAGS}>" )
2018-11-24 17:40:34 +00:00
else ( )
2019-08-23 21:18:40 +00:00
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CXX_WARNING_FLAGS}>" )
2019-02-24 19:22:15 +00:00
endif ( )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0" )
add_compile_options ( -Wno-missing-field-initializers )
endif ( )
2019-11-01 18:29:28 +00:00
if ( CMAKE_CROSSCOMPILING OR NOT ENABLE_PACKAGING )
2020-08-27 12:57:44 +00:00
if ( NOT ENABLE_CUDA )
add_compile_options ( -Wno-psabi )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2019-11-01 18:29:28 +00:00
if ( IS_ARM )
2019-11-02 09:22:35 +00:00
if ( ( CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "7.1.0" ) AND ( CMAKE_VERSION VERSION_GREATER "3.1" ) )
if ( CMAKE_CXX_STANDARD VERSION_LESS 17 )
set ( CXX_ALIGN_FLAG -faligned-new )
if ( NOT ( CMAKE_VERSION VERSION_LESS "3.3" ) )
add_compile_options ( "$<$<COMPILE_LANGUAGE:CXX>:${CXX_ALIGN_FLAG}>" )
else ( )
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CXX_ALIGN_FLAG}>" )
endif ( )
2019-11-01 18:35:47 +00:00
endif ( )
2019-11-01 18:29:28 +00:00
endif ( )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2019-08-23 21:18:40 +00:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if ( NOT ( CMAKE_VERSION VERSION_LESS "3.3" ) )
add_compile_options ( "$<$<COMPILE_LANGUAGE:CXX>:${CXX_WARNING_FLAGS}>" )
else ( )
add_compile_options ( "$<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${CXX_WARNING_FLAGS}>" )
endif ( )
endif ( )
2017-08-07 09:08:05 +00:00
2017-08-08 12:18:19 +00:00
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2018-12-08 22:16:10 +00:00
# clang-tidy https://clang.llvm.org/extra/clang-tidy/index.html
2019-03-10 04:36:09 +00:00
################################################################################
2018-12-08 22:16:10 +00:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if ( NOT ( CMAKE_VERSION VERSION_LESS "3.6" ) )
find_program (
C L A N G _ T I D Y _ E X E
N A M E S " c l a n g - t i d y "
D O C " P a t h t o c l a n g - t i d y e x e c u t a b l e "
)
if ( NOT CLANG_TIDY_EXE )
message ( STATUS "clang-tidy not found." )
else ( )
message ( STATUS "clang-tidy found: ${CLANG_TIDY_EXE}" )
2019-02-21 08:59:06 +00:00
if ( ENABLE_CLANG_TIDY )
message ( STATUS " clang-tidy will be used in compilation. You can disable it with 'cmake -DENABLE_CLANG_TIDY=OFF ..'" )
else ( )
message ( STATUS " You can enable clang-tidy usage in compilation with 'cmake -DENABLE_CLANG_TIDY=ON ..'" )
endif ( )
set ( DO_CLANG_TIDY "${CLANG_TIDY_EXE}" "-fix" )
2018-12-08 22:16:10 +00:00
set ( CMAKE_EXPORT_COMPILE_COMMANDS ON )
endif ( )
endif ( )
endif ( )
2013-07-04 13:47:40 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2013-07-10 21:07:43 +00:00
# Create uninstall target
2019-03-10 04:36:09 +00:00
################################################################################
2013-07-10 21:07:43 +00:00
configure_file (
2022-07-28 08:37:36 +00:00
$ { G N S S S D R _ S O U R C E _ D I R } / c m a k e / c m a k e _ u n i n s t a l l . c m a k e . i n
$ { G N S S S D R _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e
2019-03-23 13:24:49 +00:00
@ O N L Y
)
2013-07-10 21:07:43 +00:00
add_custom_target ( uninstall
2022-07-28 08:37:36 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - P $ { G N S S S D R _ B I N A R Y _ D I R } / c m a k e _ u n i n s t a l l . c m a k e
2019-03-23 13:24:49 +00:00
)
2013-01-22 20:40:25 +00:00
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
# Add subdirectories
2019-03-10 04:36:09 +00:00
################################################################################
2012-12-24 02:33:50 +00:00
add_subdirectory ( src )
2019-03-09 00:39:32 +00:00
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-09 00:39:32 +00:00
# Print summary
2019-03-10 04:36:09 +00:00
################################################################################
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_UHD ENABLE_UHD "Enables UHD_Signal_Source for using RF front-ends from the USRP family. Requires gr-uhd." )
add_feature_info ( ENABLE_OSMOSDR ENABLE_OSMOSDR "Enables Osmosdr_Signal_Source and RtlTcp_Signal_Source for using RF front-ends compatible with the OsmoSDR driver. Requires gr-osmosdr." )
2021-01-22 16:45:26 +00:00
add_feature_info ( ENABLE_LIMESDR ENABLE_LIMESDR "Enables Limesdr_Signal_Source. Requires gr-limesdr." )
2019-10-10 08:40:37 +00:00
add_feature_info ( ENABLE_FMCOMMS2 ENABLE_FMCOMMS2 "Enables Fmcomms2_Signal_Source for FMCOMMS2/3/4 devices. Requires gr-iio and libad9361-dev." )
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_PLUTOSDR ENABLE_PLUTOSDR "Enables Plutosdr_Signal_Source for using ADALM-PLUTO boards. Requires gr-iio." )
2019-10-10 08:40:37 +00:00
add_feature_info ( ENABLE_AD9361 ENABLE_AD9361 "Enables Ad9361_Fpga_Signal_Source for devices with the AD9361 chipset. Requires libiio and libad9361-dev." )
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_RAW_UDP ENABLE_RAW_UDP "Enables Custom_UDP_Signal_Source for custom UDP packet sample source. Requires libpcap." )
add_feature_info ( ENABLE_FLEXIBAND ENABLE_FLEXIBAND "Enables Flexiband_Signal_Source for using Teleorbit's Flexiband RF front-end. Requires gr-teleorbit." )
add_feature_info ( ENABLE_ARRAY ENABLE_ARRAY "Enables Raw_Array_Signal_Source and Array_Signal_Conditioner for using CTTC's antenna array. Requires gr-dbfcttc." )
2022-08-11 13:23:26 +00:00
add_feature_info ( ENABLE_ZMQ ENABLE_ZMQ "Enables ZMQ_Signal_Source for GNU Radio ZeroMQ messages. Requires gr-zeromq." )
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_GPERFTOOLS ENABLE_GPERFTOOLS "Enables performance analysis. Requires Gperftools." )
add_feature_info ( ENABLE_GPROF ENABLE_GPROF "Enables performance analysis with 'gprof'." )
add_feature_info ( ENABLE_CLANG_TIDY ENABLE_CLANG_TIDY "Runs clang-tidy along with the compiler. Requires Clang." )
add_feature_info ( ENABLE_PROFILING ENABLE_PROFILING "Runs volk_gnsssdr_profile at the end of the building." )
add_feature_info ( ENABLE_OPENCL ENABLE_OPENCL "Enables GPS_L1_CA_PCPS_OpenCl_Acquisition (experimental). Requires OpenCL." )
add_feature_info ( ENABLE_CUDA ENABLE_CUDA "Enables GPS_L1_CA_DLL_PLL_Tracking_GPU (experimental). Requires CUDA." )
2019-08-12 09:53:53 +00:00
add_feature_info ( ENABLE_FPGA ENABLE_FPGA "Enables building of processing blocks for FPGA offloading." )
2019-08-12 09:33:51 +00:00
add_feature_info ( ENABLE_ARMA_NO_DEBUG ENABLE_ARMA_NO_DEBUG "Enables passing the ARMA_NO_DEBUG macro to Armadillo, hence disabling bound checking." )
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_PACKAGING ENABLE_PACKAGING "Enables software packaging." )
add_feature_info ( ENABLE_OWN_GLOG ENABLE_OWN_GLOG "Forces the downloading and building of Google glog." )
add_feature_info ( ENABLE_OWN_ARMADILLO ENABLE_OWN_ARMADILLO "Forces the downloading and building of Armadillo." )
add_feature_info ( ENABLE_LOG ENABLE_LOG "Enables runtime internal logging with Google glog." )
2021-12-23 14:18:40 +00:00
add_feature_info ( ENABLE_ORC ENABLE_ORC "Use the Optimized Inner Loop Runtime Compiler (ORC) for building volk_gnsssdr." )
2020-06-10 15:22:03 +00:00
add_feature_info ( ENABLE_STRIP ENABLE_STRIP "Enables the generation of stripped binaries (without debugging symbols)." )
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_UNIT_TESTING ENABLE_UNIT_TESTING "Enables building of Unit Tests." )
add_feature_info ( ENABLE_UNIT_TESTING_MINIMAL ENABLE_UNIT_TESTING_MINIMAL "Enables building a minimal set of Unit Tests." )
add_feature_info ( ENABLE_UNIT_TESTING_EXTRA ENABLE_UNIT_TESTING_EXTRA "Enables building of Extra Unit Tests and downloading of external data files." )
add_feature_info ( ENABLE_SYSTEM_TESTING ENABLE_SYSTEM_TESTING "Enables building of System Tests." )
add_feature_info ( ENABLE_SYSTEM_TESTING_EXTRA ENABLE_SYSTEM_TESTING_EXTRA "Enables building of Extra System Tests and downloading of external tools." )
2022-07-04 08:05:54 +00:00
add_feature_info ( ENABLE_OWN_GNSSTK ENABLE_OWN_GNSSTK "Forces the downloading and building of gnsstk for system tests." )
2019-06-28 07:32:46 +00:00
add_feature_info ( ENABLE_GNSS_SIM_INSTALL ENABLE_GNSS_SIM_INSTALL "Enables downloading and building of gnss-sim." )
2019-06-24 19:29:35 +00:00
add_feature_info ( ENABLE_INSTALL_TESTS ENABLE_INSTALL_TESTS "Install test binaries when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} install'." )
2020-06-21 19:10:22 +00:00
add_feature_info ( ENABLE_BENCHMARKS ENABLE_BENCHMARKS "Enables building of code snippet benchmarks." )
2020-10-30 11:24:23 +00:00
add_feature_info ( ENABLE_EXTERNAL_MATHJAX ENABLE_EXTERNAL_MATHJAX "Use MathJax from an external CDN in HTML docs when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} doc'." )
2022-04-03 21:24:31 +00:00
add_feature_info ( ENABLE_CPUFEATURES ENABLE_CPUFEATURES "Make use of the cpu_features library." )
2021-12-17 18:48:11 +00:00
add_feature_info ( Boost_USE_STATIC_LIBS Boost_USE_STATIC_LIBS "Use Boost static libraries." )
2019-06-24 19:29:35 +00:00
2019-03-09 22:48:32 +00:00
message ( STATUS "" )
message ( STATUS "***************************************" )
message ( STATUS "* SUMMARY REPORT *" )
message ( STATUS "***************************************" )
message ( STATUS "" )
2020-02-03 21:39:52 +00:00
if ( CMAKE_CROSSCOMPILING )
message ( STATUS "Cross-compiling on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}" )
else ( )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
message ( STATUS "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}" )
endif ( )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
message ( STATUS "Building on ${MACOS_DISTRIBUTION}" )
endif ( )
2020-02-03 19:40:10 +00:00
endif ( )
2020-02-03 22:55:53 +00:00
message ( STATUS "CMake version: ${CMAKE_VERSION}" )
2020-05-15 09:31:10 +00:00
message ( STATUS "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}." )
message ( STATUS "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}." )
2020-08-28 10:02:01 +00:00
if ( CUDA_FOUND )
message ( STATUS "The CUDA compiler identification is ${CMAKE_CUDA_COMPILER_ID} ${CMAKE_CUDA_COMPILER_VERSION}. Standard: C++${CMAKE_CUDA_STANDARD}." )
endif ( )
2020-02-03 19:40:10 +00:00
message ( STATUS "" )
2022-07-28 08:37:36 +00:00
file ( REMOVE ${ GNSSSDR_BINARY_DIR } /features.log )
file ( WRITE ${ GNSSSDR_BINARY_DIR } /features.log "**********************************\n" )
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "* BUILDING CONFIGURATION SUMMARY *\n" )
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "**********************************\n\n" )
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "GNSS-SDR version: ${VERSION}\n" )
2020-02-03 19:40:10 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux|kFreeBSD|GNU" )
2020-02-03 21:50:56 +00:00
if ( CMAKE_CROSSCOMPILING )
2022-07-28 08:37:36 +00:00
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "Cross-compiling on ${LINUX_DISTRIBUTION} ${LINUX_VER} (${CMAKE_HOST_SYSTEM_PROCESSOR}) for ${CMAKE_SYSTEM_PROCESSOR} ${ARCHITECTURE_STRING}\n" )
2020-02-03 21:50:56 +00:00
else ( )
2022-07-28 08:37:36 +00:00
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "Building on GNU/Linux ${LINUX_DISTRIBUTION} ${LINUX_VER} ${ARCHITECTURE_STRING}\n" )
2020-02-03 21:50:56 +00:00
endif ( )
2020-02-03 19:40:10 +00:00
endif ( )
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2022-07-28 08:37:36 +00:00
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "Building on ${MACOS_DISTRIBUTION}\n" )
2020-02-03 19:40:10 +00:00
endif ( )
2022-07-28 08:37:36 +00:00
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "CMake version: ${CMAKE_VERSION}\n" )
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "The CXX compiler identification is ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}. Standard: C++${CMAKE_CXX_STANDARD}.\n" )
file ( APPEND ${ GNSSSDR_BINARY_DIR } /features.log "The C compiler identification is ${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION}. Standard: C${CMAKE_C_STANDARD}.\n\n" )
2019-03-09 22:48:32 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.4 )
feature_summary ( WHAT ALL )
2022-07-28 08:37:36 +00:00
feature_summary ( FILENAME ${ GNSSSDR_BINARY_DIR } /features.log APPEND WHAT ALL )
2019-03-09 22:48:32 +00:00
else ( )
2019-03-10 04:36:09 +00:00
feature_summary ( WHAT
R E Q U I R E D _ P A C K A G E S _ F O U N D
R E Q U I R E D _ P A C K A G E S _ N O T _ F O U N D
O P T I O N A L _ P A C K A G E S _ F O U N D
O P T I O N A L _ P A C K A G E S _ N O T _ F O U N D
2019-04-02 00:41:20 +00:00
E N A B L E D _ F E A T U R E S
D I S A B L E D _ F E A T U R E S
2019-03-10 04:36:09 +00:00
)
2022-07-28 08:37:36 +00:00
feature_summary ( FILENAME ${ GNSSSDR_BINARY_DIR } /features.log APPEND WHAT
2019-03-10 04:36:09 +00:00
R E Q U I R E D _ P A C K A G E S _ F O U N D
R E Q U I R E D _ P A C K A G E S _ N O T _ F O U N D
O P T I O N A L _ P A C K A G E S _ F O U N D
O P T I O N A L _ P A C K A G E S _ N O T _ F O U N D
2019-04-02 00:41:20 +00:00
E N A B L E D _ F E A T U R E S
D I S A B L E D _ F E A T U R E S
2019-03-10 04:36:09 +00:00
)
2019-03-09 00:39:32 +00:00
endif ( )
2019-03-10 19:08:49 +00:00
message ( STATUS "GNSS-SDR v${VERSION} is ready to be built." )