2019-02-03 18:24:44 +00:00
# Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
2012-12-24 02:33:50 +00:00
#
# This file is part of GNSS-SDR.
#
# GNSS-SDR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
2014-06-30 18:46:36 +00:00
# (at your option) any later version.
2012-12-24 02:33:50 +00:00
#
# GNSS-SDR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
2018-05-13 20:49:11 +00:00
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
2012-12-24 02:33:50 +00:00
#
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
2019-01-31 11:12:04 +00:00
cmake_minimum_required ( VERSION 2.8.12 )
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 )
list ( APPEND CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /cmake/Modules )
2014-09-30 23:09:44 +00:00
2012-12-24 02:33:50 +00:00
2019-04-02 00:41:20 +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 )
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
add_feature_info ( ENABLE_UHD ENABLE_UHD "Enables UHD_Signal_Source for using RF front-ends from the USRP family. Requires gr-uhd." )
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
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." )
2019-03-10 04:36:09 +00:00
option ( ENABLE_FMCOMMS2 "Enable the use of FMCOMMS4-EBZ + ZedBoard hardware, requires gr-iio" OFF )
add_feature_info ( ENABLE_FMCOMMS2 ENABLE_FMCOMMS2 "Enables Fmcomms2_Signal_Source for FMCOMMS2/3/4 devices. Requires gr-iio." )
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
add_feature_info ( ENABLE_PLUTOSDR ENABLE_PLUTOSDR "Enables Plutosdr_Signal_Source for using ADALM-PLUTO boards. Requires gr-iio." )
option ( ENABLE_AD9361 "Enable the use of AD9361 direct to FPGA hardware, requires libiio" OFF )
add_feature_info ( ENABLE_AD9361 ENABLE_AD9361 "Enables Ad9361_Fpga_Signal_Source for devices with the AD9361 chipset. Requires libiio." )
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 )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_RAW_UDP ENABLE_RAW_UDP "Enables Custom_UDP_Signal_Source for custom UDP packet sample source. Requires libpcap." )
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 )
add_feature_info ( ENABLE_FLEXIBAND ENABLE_FLEXIBAND "Enables Flexiband_Signal_Source for using Teleorbit's Flexiband RF front-end. Requires gr-teleorbit." )
option ( ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF )
add_feature_info ( ENABLE_GN3S ENABLE_GN3S "Enables Gn3s_Signal_Source for using the GN3S v2 dongle. Requires gr-gn3s." )
option ( ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF )
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." )
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
add_feature_info ( ENABLE_GPERFTOOLS ENABLE_GPERFTOOLS "Enables performance analysis. Requires Gperftools." )
2015-05-03 08:15:51 +00:00
option ( ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_GPROF ENABLE_GPROF "Enables performance analysis with 'gprof'." )
2015-05-03 08:15:51 +00:00
2019-02-21 08:59:06 +00:00
# Code correctness
option ( ENABLE_CLANG_TIDY "Enable the use of clang-tidy when compiling" OFF )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_CLANG_TIDY ENABLE_CLANG_TIDY "Runs clang-tidy along with the compiler. Requires Clang." )
2019-02-21 08:59:06 +00:00
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
add_feature_info ( ENABLE_PROFILING ENABLE_PROFILING "Runs volk_gnsssdr_profile at the end of the building." )
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
add_feature_info ( ENABLE_OPENCL ENABLE_OPENCL "Enables GPS_L1_CA_PCPS_OpenCl_Acquisition (experimental). Requires OpenCL." )
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
add_feature_info ( ENABLE_CUDA ENABLE_CUDA "Enables GPS_L1_CA_DLL_PLL_Tracking_GPU (experimental). Requires CUDA." )
option ( ENABLE_FPGA "Enable building of processing blocks implemented with FPGA" OFF )
add_feature_info ( ENABLE_FPGA ENABLE_FPGA "Enables building of processing blocks for FPGA off-loading." )
2015-05-03 08:15:51 +00:00
# Building and packaging options
2014-09-07 17:35:41 +00:00
option ( ENABLE_GENERIC_ARCH "Builds a portable binary" OFF )
2019-03-17 09:31:17 +00:00
add_feature_info ( ENABLE_GENERIC_ARCH ENABLE_GENERIC_ARCH "When disabled, flags such as '-march=native' are passed to the compiler." )
2019-03-09 00:39:32 +00:00
2014-11-11 22:50:38 +00:00
option ( ENABLE_PACKAGING "Enable software packaging" OFF )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_PACKAGING ENABLE_PACKAGING "Enables software packaging." )
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
add_feature_info ( ENABLE_OWN_GLOG ENABLE_OWN_GLOG "Forces the downloading and building of Google glog." )
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
add_feature_info ( ENABLE_OWN_ARMADILLO ENABLE_OWN_ARMADILLO "Forces the downloading and building of Armadillo." )
2015-05-23 09:20:26 +00:00
option ( ENABLE_LOG "Enable logging" ON )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_LOG ENABLE_LOG "Enables runtime internal logging with Google glog." )
2014-11-14 00:40:43 +00:00
if ( ENABLE_PACKAGING )
2014-11-11 22:50:38 +00:00
set ( ENABLE_GENERIC_ARCH ON )
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
add_feature_info ( ENABLE_UNIT_TESTING ENABLE_UNIT_TESTING "Enables building of Unit Tests." )
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
add_feature_info ( ENABLE_UNIT_TESTING_MINIMAL ENABLE_UNIT_TESTING_MINIMAL "Enables building a minimal set of Unit Tests." )
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
add_feature_info ( ENABLE_UNIT_TESTING_EXTRA ENABLE_UNIT_TESTING_EXTRA "Enables building of Extra Unit Tests and downloading of external data files." )
2017-01-10 17:57:38 +00:00
option ( ENABLE_SYSTEM_TESTING "Build system tests" OFF )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_SYSTEM_TESTING ENABLE_SYSTEM_TESTING "Enables building of System Tests." )
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
add_feature_info ( ENABLE_SYSTEM_TESTING_EXTRA ENABLE_SYSTEM_TESTING_EXTRA "Enables building of Extra System Tests and downloading of external tools." )
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 ( )
2017-01-10 17:57:38 +00:00
option ( ENABLE_OWN_GPSTK "Force to download, build and link GPSTk for system tests, even if it is already installed" OFF )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_OWN_GPSTK ENABLE_OWN_GPSTK "Forces the downloading and building of GPSTk for system tests." )
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
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
################################################################################
2018-12-14 18:41:13 +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 "
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 s y s t e m "
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
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ S O U R C E _ D I R }
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
)
endif ( NOT GIT_BRANCH )
# 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
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ S O U R C E _ D I R }
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
)
endif ( NOT GIT_COMMIT_HASH )
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 } )
2018-06-08 11:43:50 +00:00
set ( VERSION_INFO_MINOR_VERSION 10 )
2018-11-24 17:40:34 +00:00
else ( )
2018-06-08 11:43:50 +00:00
set ( VERSION_INFO_MINOR_VERSION 10.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
2013-01-19 17:10:57 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux" )
2018-11-19 07:51:05 +00:00
set ( OperatingSystem "Linux" )
set ( OS_IS_LINUX TRUE )
if ( ARCH_64BITS )
set ( ARCH_ "(64 bits)" )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
set ( ARCH_ "(32 bits)" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( EXISTS "/etc/lsb-release" )
execute_process ( COMMAND cat /etc/lsb-release
2018-11-24 17:40:34 +00:00
C O M M A N D g r e p D I S T R I B _ I D
C O M M A N D a w k - F = " { p r i n t $ 2 } "
C O M M A N D t r " \ n " " "
C O M M A N D s e d " s / / / "
O U T P U T _ V A R I A B L E L I N U X _ D I S T R I B U T I O N
R E S U L T _ V A R I A B L E L I N U X _ I D _ R E S U L T
2018-11-19 07:51:05 +00:00
)
execute_process ( COMMAND cat /etc/lsb-release
2018-11-24 17:40:34 +00:00
C O M M A N D g r e p D I S T R I B _ R E L E A S E
C O M M A N D a w k - F = " { p r i n t $ 2 } "
C O M M A N D t r " \ n " " "
C O M M A N D s e d " s / / / "
O U T P U T _ V A R I A B L E L I N U X _ V E R
R E S U L T _ V A R I A B L E L I N U X _ V E R _ R E S U L T
2018-11-19 07:51:05 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/linuxmint/info" )
2018-11-24 17:40:34 +00:00
set ( LINUX_DISTRIBUTION "LinuxMint" )
execute_process ( COMMAND cat /etc/linuxmint/info
C O M M A N D g r e p - m 1 R E L E A S E
C O M M A N D a w k - F = " { p r i n t $ 2 } "
C O M M A N D t r " \ n " " "
C O M M A N D s e d " s / / / "
O U T P U T _ V A R I A B L E L I N U X _ V E R
R E S U L T _ V A R I A B L E L I N U X _ V E R _ R E S U L T
)
endif ( )
endif ( )
2018-11-19 07:51:05 +00:00
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/os-release" )
2018-11-24 17:40:34 +00:00
execute_process ( COMMAND cat /etc/os-release
C O M M A N D g r e p - m 1 N A M E
C O M M A N D a w k - F = " { p r i n t $ 2 } "
C O M M A N D t r " \ n " " "
C O M M A N D s e d " s / / / "
O U T P U T _ V A R I A B L E L I N U X _ D I S T R I B U T I O N
R E S U L T _ V A R I A B L E L I N U X _ I D _ R E S U L T
)
execute_process ( COMMAND cat /etc/os-release
C O M M A N D g r e p V E R S I O N _ I D
C O M M A N D a w k - F = " { p r i n t $ 2 } "
C O M M A N D t r " \ n " " "
C O M M A N D s e d " s / / / "
O U T P U T _ V A R I A B L E L I N U X _ V E R
R E S U L T _ V A R I A B L E L I N U X _ V E R _ R E S U L T
)
if ( ${ LINUX_DISTRIBUTION } MATCHES "Debian" )
set ( LINUX_DISTRIBUTION "Debian" )
file ( READ /etc/debian_version LINUX_VER )
endif ( )
endif ( )
endif ( )
2018-11-19 07:51:05 +00:00
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/redhat-release" )
2018-11-24 17:40:34 +00:00
set ( LINUX_DISTRIBUTION "Red Hat" )
file ( READ /etc/redhat-release LINUX_VER )
endif ( )
endif ( )
2018-11-19 07:51:05 +00:00
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/debian_version" )
2018-11-24 17:40:34 +00:00
set ( LINUX_DISTRIBUTION "Debian" )
file ( READ /etc/debian_version LINUX_VER )
endif ( )
endif ( )
2018-11-19 07:51:05 +00:00
if ( NOT LINUX_DISTRIBUTION )
set ( LINUX_DISTRIBUTION "Generic" )
set ( LINUX_VER "Unknown" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-26 00:48:48 +00:00
if ( NOT LINUX_DISTRIBUTION )
set ( LINUX_DISTRIBUTION "Unknown" )
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" )
2018-11-19 07:51:05 +00:00
set ( OperatingSystem "Mac OS X" )
set ( OS_IS_MACOSX TRUE )
execute_process ( COMMAND uname -v OUTPUT_VARIABLE DARWIN_VERSION )
string ( REGEX MATCH "[0-9]+" DARWIN_VERSION ${ DARWIN_VERSION } )
if ( ${ DARWIN_VERSION } MATCHES "18" )
set ( MACOS_MOJAVE TRUE )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Mojave 10.14" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "17" )
set ( MACOS_HIGH_SIERRA TRUE )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS High Sierra 10.13" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "16" )
set ( MACOS_SIERRA TRUE )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on macOS Sierra 10.12" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "15" )
set ( MACOSX_EL_CAPITAN TRUE )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.11 El Capitan" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "14" )
set ( MACOSX_YOSEMITE TRUE )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.10 Yosemite" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "13" )
set ( MACOSX_MAVERICKS TRUE )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11" )
set ( CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++" )
set ( CMAKE_XCODE_ATTRIBUTE_GCC_VERSION= "com.apple.compilers.llvm.clang.1_0" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.9 Mavericks" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "12" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.8 Mountain Lion" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "11" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.7 Lion" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( ${ DARWIN_VERSION } MATCHES "10" )
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.6 Snow Leopard" )
2018-11-24 17:40:34 +00:00
endif ( )
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
2013-12-10 20:17:57 +00:00
if ( NOT CMAKE_BUILD_TYPE )
2018-11-19 07:51:05 +00:00
if ( ENABLE_GPERFTOOLS OR ENABLE_GPROF )
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
message ( STATUS "Build type not specified: defaulting to RelWithDebInfo." )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
set ( CMAKE_BUILD_TYPE "Release" )
message ( STATUS "Build type not specified: defaulting to Release." )
2018-11-24 17:40:34 +00:00
endif ( )
else ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "Build type set to ${CMAKE_BUILD_TYPE}." )
2018-11-24 17:40:34 +00:00
endif ( )
gnsssdr_check_build_type ( ${ CMAKE_BUILD_TYPE } )
2013-12-10 20:17:57 +00:00
set ( CMAKE_BUILD_TYPE ${ CMAKE_BUILD_TYPE } CACHE STRING "" )
2013-01-19 17:10:57 +00:00
2017-04-14 08:28:57 +00:00
# allow 'large' files in 32 bit builds
if ( UNIX )
2018-11-19 07:51:05 +00:00
add_definitions ( -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES )
2018-11-24 17:40:34 +00:00
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 ( )
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 ( )
2019-03-09 00:39:32 +00:00
add_feature_info ( ENABLE_INSTALL_TESTS ENABLE_INSTALL_TESTS "Install test binaries when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} install'." )
2014-10-28 00:00:04 +00:00
2016-11-27 22:47:45 +00:00
2019-03-10 04:36:09 +00:00
2014-10-27 04:19:26 +00:00
################################################################################
2017-08-07 17:29:05 +00:00
# Minimum required versions
################################################################################
set ( GNSSSDR_GCC_MIN_VERSION "4.7.2" )
set ( GNSSSDR_CLANG_MIN_VERSION "3.4.0" )
set ( GNSSSDR_APPLECLANG_MIN_VERSION "500" )
set ( GNSSSDR_GNURADIO_MIN_VERSION "3.7.3" )
2019-02-05 00:56:26 +00:00
set ( GNSSSDR_BOOST_MIN_VERSION "1.53" )
2017-08-07 17:29:05 +00:00
set ( GNSSSDR_PYTHON_MIN_VERSION "2.7" )
2018-07-24 10:01:50 +00:00
set ( GNSSSDR_PYTHON3_MIN_VERSION "3.4" )
2017-08-07 17:29:05 +00:00
set ( GNSSSDR_MAKO_MIN_VERSION "0.4.2" )
2018-04-03 17:17:44 +00:00
set ( GNSSSDR_ARMADILLO_MIN_VERSION "5.300.0" )
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" )
2017-08-07 17:29:05 +00:00
2017-08-08 12:18:19 +00:00
2017-11-04 18:22:40 +00:00
################################################################################
# Versions to download and build (but not installed) if not found
################################################################################
2018-11-12 10:03:50 +00:00
set ( GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.2" )
2019-03-22 08:33:29 +00:00
set ( GNSSSDR_GLOG_LOCAL_VERSION "0.4.0" )
2019-06-02 12:37:27 +00:00
set ( GNSSSDR_ARMADILLO_LOCAL_VERSION "9.500.x" )
2018-08-31 19:25:24 +00:00
set ( GNSSSDR_GTEST_LOCAL_VERSION "1.8.1" )
2017-11-04 18:22:40 +00:00
set ( GNSSSDR_GNSS_SIM_LOCAL_VERSION "master" )
2018-09-25 16:32:24 +00:00
set ( GNSSSDR_GPSTK_LOCAL_VERSION "2.10.6" )
2019-06-02 12:37:27 +00:00
set ( GNSSSDR_MATIO_LOCAL_VERSION "1.5.15" )
2018-11-11 11:27:01 +00:00
set ( GNSSSDR_PUGIXML_LOCAL_VERSION "1.9" )
2019-05-30 13:16:29 +00:00
set ( GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION "3.8.0" )
2017-11-04 18:22:40 +00:00
2018-11-18 20:24:54 +00:00
if ( CMAKE_VERSION VERSION_LESS "3.0.2" ) # Fix for CentOS 7
2018-11-19 07:51:05 +00:00
set ( GNSSSDR_GFLAGS_LOCAL_VERSION "2.2.1" )
2018-11-24 17:40:34 +00:00
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
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-02-17 12:36:13 +00:00
################################################################################
# Set C and C++ standard
################################################################################
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>" )
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>" )
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>" )
2019-02-17 12:36:13 +00:00
endif ( )
endif ( )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
if ( OS_IS_MACOSX )
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>" )
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>" )
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>" )
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>" )
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 )
endif ( )
endif ( )
2019-03-23 13:24:49 +00:00
2014-09-30 23:09:44 +00:00
################################################################################
# Check if the compiler defines the architecture as ARM
################################################################################
if ( NOT OS_IS_MACOSX )
2016-12-20 01:35:52 +00:00
if ( CMAKE_CROSSCOMPILING )
set ( IS_ARM TRUE )
2019-02-03 20:12:24 +00:00
if ( NOT CMAKE_NO_SYSTEM_FROM_IMPORTED )
set ( CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE )
endif ( )
2018-11-24 17:40:34 +00:00
else ( )
2016-12-20 01:35:52 +00:00
include ( TestForARM )
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
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}" )
endif ( )
2018-11-24 17:40:34 +00:00
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
U R L " h t t p s : / / g i t h u b . c o m / g o o g l e / g o o g l e t e s t "
D E S C R I P T I O N " S o u r c e c o d e o f G o o g l e ' s T e s t i n g F r a m e w o r k "
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
2019-03-10 04:36:09 +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 a n d 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
)
endif ( )
2012-12-25 10:28:29 +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 ( )
2013-07-04 13:47:40 +00:00
set ( Boost_ADDITIONAL_VERSIONS
2019-02-05 00:56:26 +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 "
2016-05-24 15:26:34 +00:00
" 1 . 7 0 . 0 " " 1 . 7 0 " " 1 . 7 1 . 0 " " 1 . 7 1 " " 1 . 7 2 . 0 " " 1 . 7 2 " " 1 . 7 3 . 0 " " 1 . 7 3 " " 1 . 7 4 . 0 " " 1 . 7 4 "
2017-08-07 17:29:05 +00:00
" 1 . 7 5 . 0 " " 1 . 7 5 " " 1 . 7 6 . 0 " " 1 . 7 6 " " 1 . 7 7 . 0 " " 1 . 7 7 " " 1 . 7 8 . 0 " " 1 . 7 8 " " 1 . 7 9 . 0 " " 1 . 7 9 "
2018-11-19 07:51:05 +00:00
" 1 . 8 0 . 0 " " 1 . 8 0 " " 1 . 8 1 . 0 " " 1 . 8 1 " " 1 . 8 2 . 0 " " 1 . 8 2 " " 1 . 8 3 . 0 " " 1 . 8 3 " " 1 . 8 4 . 0 " " 1 . 8 4 "
2013-07-04 13:47:40 +00:00
)
set ( Boost_USE_MULTITHREAD ON )
set ( Boost_USE_STATIC_LIBS OFF )
2019-02-05 08:33:14 +00:00
find_package ( Boost ${ GNSSSDR_BOOST_MIN_VERSION } COMPONENTS atomic chrono date_time filesystem serialization system thread REQUIRED )
2019-03-10 04:36:09 +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 "
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 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
)
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-02-03 18:24:44 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.5 )
if ( NOT TARGET Boost::boost )
add_library ( Boost::boost SHARED IMPORTED ) # Trick for CMake 2.8.12
2019-04-02 00:41:20 +00:00
set_target_properties ( Boost::boost 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 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 }
)
2019-02-03 18:24:44 +00:00
endif ( )
if ( NOT TARGET Boost::date_time )
add_library ( Boost::date_time SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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 }
)
2019-02-03 18:24:44 +00:00
endif ( )
if ( NOT TARGET Boost::system )
add_library ( Boost::system SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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 }
)
2019-02-03 18:24:44 +00:00
endif ( )
if ( NOT TARGET Boost::filesystem )
add_library ( Boost::filesystem SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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-02-03 18:24:44 +00:00
endif ( )
if ( NOT TARGET Boost::thread )
add_library ( Boost::thread SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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 }
)
2019-02-03 18:24:44 +00:00
endif ( )
if ( NOT TARGET Boost::serialization )
add_library ( Boost::serialization SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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 }
)
2019-02-03 18:24:44 +00:00
endif ( )
if ( NOT TARGET Boost::chrono )
add_library ( Boost::chrono SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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 }
)
2019-02-03 18:24:44 +00:00
endif ( )
2019-02-04 07:11:28 +00:00
if ( NOT TARGET Boost::atomic )
add_library ( Boost::atomic SHARED IMPORTED )
2019-04-02 00:41:20 +00:00
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 }
)
2019-02-04 07:11:28 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
endif ( )
2019-03-10 04:36:09 +00:00
2019-05-26 00:09:53 +00:00
# Fix for Boost Asio < 1.70 when using Clang in macOS
if ( ${ Boost_VERSION } VERSION_LESS 107000 )
# Check if we have std::string_view
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
)
endif ( )
2013-07-04 13:47:40 +00:00
2016-11-27 22:47:45 +00:00
2013-01-19 17:10:57 +00:00
################################################################################
2018-05-13 19:16:09 +00:00
# GNU Radio - https://gnuradio.org
2013-01-19 17:10:57 +00:00
################################################################################
2019-04-27 15:28:49 +00:00
set ( 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
U R L " h t t p s : / / w w w . e t t u s . c o m / s d r - s o f t w a r e / d e t a i l / u s r p - h a r d w a r e - d r i v e r "
D E S C R I P T I O N " U S R P H a r d w a r e D r i v e r "
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 )
else ( )
set ( GR_REQUIRED_COMPONENTS ${ GR_REQUIRED_COMPONENTS } UHD )
endif ( )
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
U R L " h t t p s : / / w w w . g n u r a d i o . o r g / "
2019-04-27 17:10:38 +00:00
D E S C R I P T I O N " T h e f r e e a n d o p e n s o f t w a r e r a d i o ecosystem ( found: v ${ GNURADIO_VERSION } ) "
2019-03-10 04:36:09 +00:00
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-04-27 15:28:49 +00:00
if ( GNURADIO_VERSION )
if ( GNURADIO_VERSION VERSION_LESS ${ GNSSSDR_GNURADIO_MIN_VERSION } )
2019-03-10 04:36:09 +00:00
unset ( GNURADIO_RUNTIME_FOUND )
2019-04-27 15:28:49 +00:00
message ( STATUS "The GNU Radio version installed in your system (v${GNURADIO_VERSION}) is too old." )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2013-12-10 20:17:57 +00:00
if ( NOT GNURADIO_RUNTIME_FOUND )
2018-11-19 07:51:05 +00:00
message ( STATUS "CMake cannot find GNU Radio >= ${GNSSSDR_GNURADIO_MIN_VERSION}" )
if ( OS_IS_LINUX )
2018-11-24 17:40:34 +00:00
message ( "Go to https://github.com/gnuradio/pybombs" )
message ( "and follow the instructions to install GNU Radio in your system." )
endif ( )
2018-11-19 07:51:05 +00:00
if ( OS_IS_MACOSX )
2018-11-24 17:40:34 +00:00
message ( "You can install it easily via Macports:" )
message ( " sudo port install gnuradio " )
message ( "Alternatively, you can use homebrew:" )
message ( " brew install gnuradio" )
endif ( )
2019-04-27 15:28:49 +00:00
message ( FATAL_ERROR "GNU Radio v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr." )
2019-02-03 18:24:44 +00:00
else ( )
if ( NOT TARGET Gnuradio::runtime )
add_library ( Gnuradio::runtime SHARED IMPORTED )
list ( GET GNURADIO_RUNTIME_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_RUNTIME_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::runtime 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ R U N T I M E _ D I R } "
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 U R A D I O _ R U N T I M E _ 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 N U R A D I O _ R U N T I M E _ L I B R A R I E S } "
2019-02-03 18:24:44 +00:00
)
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2013-12-10 20:17:57 +00:00
2016-01-06 10:01:16 +00:00
if ( NOT GNURADIO_ANALOG_FOUND )
2017-08-07 17:29:05 +00:00
message ( FATAL_ERROR "*** The gnuradio-analog library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr" )
2019-02-03 18:24:44 +00:00
else ( )
if ( NOT TARGET Gnuradio::analog )
add_library ( Gnuradio::analog SHARED IMPORTED )
list ( GET GNURADIO_ANALOG_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_ANALOG_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::analog 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ A N A L O G _ D I R } "
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 U R A D I O _ A N A 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 N U R A D I O _ A N A L O G _ L I B R A R I E S } "
2019-02-03 18:24:44 +00:00
)
endif ( )
2016-01-06 10:01:16 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
2013-07-06 02:15:09 +00:00
if ( NOT GNURADIO_BLOCKS_FOUND )
2017-08-07 17:29:05 +00:00
message ( FATAL_ERROR "*** The gnuradio-blocks library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr" )
2019-02-03 18:24:44 +00:00
else ( )
if ( NOT TARGET Gnuradio::blocks )
add_library ( Gnuradio::blocks SHARED IMPORTED )
list ( GET GNURADIO_BLOCKS_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_BLOCKS_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::blocks 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ B L O C K S _ D I R } "
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 U R A D I O _ B L O C K S _ 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 N U R A D I O _ B L O C K S _ L I B R A R I E S } "
2019-02-03 18:24:44 +00:00
)
endif ( )
2013-07-06 02:15:09 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
2013-07-06 02:15:09 +00:00
if ( NOT GNURADIO_FILTER_FOUND )
2017-08-07 17:29:05 +00:00
message ( FATAL_ERROR "*** The gnuradio-filter library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr" )
2019-02-03 18:24:44 +00:00
else ( )
if ( NOT TARGET Gnuradio::filter )
add_library ( Gnuradio::filter SHARED IMPORTED )
list ( GET GNURADIO_FILTER_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_FILTER_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::filter 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ F I L T E R _ D I R } "
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 U R A D I O _ F I L T E 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 " $ { G N U R A D I O _ F I L T E R _ L I B R A R I E S } "
2019-02-03 18:24:44 +00:00
)
endif ( )
2013-07-06 02:15:09 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
2013-07-06 02:15:09 +00:00
if ( NOT GNURADIO_FFT_FOUND )
2017-08-07 17:29:05 +00:00
message ( FATAL_ERROR "*** The gnuradio-fft library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr" )
2019-02-03 18:24:44 +00:00
else ( )
if ( NOT TARGET Gnuradio::fft )
add_library ( Gnuradio::fft SHARED IMPORTED )
list ( GET GNURADIO_FFT_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_FFT_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::fft 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ F F T _ D I R } "
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 U R A D I O _ F F T _ 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 N U R A D I O _ F F T _ L I B R A R I E S } "
2019-02-03 18:24:44 +00:00
)
endif ( )
2013-07-06 02:15:09 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
2016-01-06 10:01:16 +00:00
if ( NOT GNURADIO_PMT_FOUND )
2017-08-07 17:29:05 +00:00
message ( FATAL_ERROR "*** The gnuradio-pmt library v${GNSSSDR_GNURADIO_MIN_VERSION} or later is required to build gnss-sdr" )
2019-02-03 18:24:44 +00:00
else ( )
if ( NOT TARGET Gnuradio::pmt )
add_library ( Gnuradio::pmt SHARED IMPORTED )
list ( GET GNURADIO_PMT_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_PMT_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::pmt 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ P M T _ D I R } "
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 U R A D I O _ P M T _ 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 N U R A D I O _ P M T _ L I B R A R I E S } "
2019-02-03 18:24:44 +00:00
)
endif ( )
2013-07-06 02:15:09 +00:00
endif ( )
2013-01-01 11:24:42 +00:00
2019-03-09 00:39:32 +00:00
if ( ENABLE_UHD AND UHD_FOUND AND GNURADIO_UHD_FOUND )
if ( NOT TARGET Gnuradio::uhd )
add_library ( Gnuradio::uhd SHARED IMPORTED )
list ( GET GNURADIO_UHD_LIBRARIES 0 FIRST_DIR )
get_filename_component ( GNURADIO_UHD_DIR ${ FIRST_DIR } ABSOLUTE )
set_target_properties ( Gnuradio::uhd 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 "
I M P O R T E D _ L O C A T I O N " $ { G N U R A D I O _ U H D _ D I R } "
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 U R A D I O _ U H D _ 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 N U R A D I O _ U H D _ L I B R A R I E S } "
2019-03-09 00:39:32 +00:00
)
endif ( )
endif ( )
2014-11-17 19:42:50 +00:00
2016-01-06 01:05:34 +00:00
2014-11-17 19:42:50 +00:00
################################################################################
# VOLK - Vector-Optimized Library of Kernels
################################################################################
2018-11-21 07:28:50 +00:00
find_package ( VOLK )
2019-03-09 00:39:32 +00:00
set_package_properties ( VOLK PROPERTIES
U R L " h t t p : / / l i b v o l k . o r g "
D E S C R I P T I O N " V e c t o r - O p t i m i z e d L i b r a r y o f K e r n e l s "
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
)
2019-03-10 04:36:09 +00:00
if ( NOT VOLK_FOUND )
message ( FATAL_ERROR "*** VOLK is required to build gnss-sdr" )
endif ( )
2014-11-14 20:42:22 +00:00
2013-01-01 11:24:42 +00:00
2017-04-25 18:08:45 +00:00
################################################################################
2018-02-07 17:35:45 +00:00
# Log4cpp - http://log4cpp.sourceforge.net/
2017-04-25 18:08:45 +00:00
################################################################################
2018-11-21 07:28:50 +00:00
find_package ( LOG4CPP )
2019-03-09 00:39:32 +00:00
set_package_properties ( LOG4CPP PROPERTIES
U R L " h t t p : / / l o g 4 c p p . s o u r c e f o r g e . n e t / "
D E S C R I P T I O N " L i b r a r y o f C + + c l a s s e s f o r f l e x i b l e l o g g i n g t o f i l e s "
P U R P O S E " R e q u i r e d b y G N U R a d i o . "
T Y P E R E Q U I R E D
)
2019-03-10 04:36:09 +00:00
if ( NOT LOG4CPP_FOUND )
message ( FATAL_ERROR "*** Log4cpp is required to build gnss-sdr" )
endif ( )
2017-04-25 18:08:45 +00:00
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
D E S C R I P T I O N " V e c t o r - O p t i m i z e d L i b r a r y o f K e r n e l s f o r G N S S - S D R . "
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 )
2018-07-27 08:38:32 +00:00
message ( STATUS "Mako template library not found. See http://www.makotemplates.org/ " )
2016-12-26 10:42:38 +00:00
message ( STATUS " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2019-03-10 04:36:09 +00:00
message ( STATUS " sudo yum install ${PYTHON_NAME}-mako" )
2016-12-26 10:42:38 +00:00
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
2019-03-10 04:36:09 +00:00
message ( STATUS " sudo zypper install ${PYTHON_NAME}-Mako" )
2018-11-24 17:40:34 +00:00
else ( )
2019-03-10 04:36:09 +00:00
message ( STATUS " sudo apt-get install ${PYTHON_NAME}-mako" )
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
2016-12-25 19:40:29 +00:00
# Six
if ( NOT SIX_FOUND )
2016-12-26 11:27:07 +00:00
message ( STATUS "python-six not found. See https://pythonhosted.org/six/ " )
2016-12-26 10:42:38 +00:00
message ( STATUS " You can try to install it by typing:" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2019-03-10 04:36:09 +00:00
message ( STATUS " sudo yum install ${PYTHON_NAME}-six" )
2016-12-26 10:42:38 +00:00
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
2019-03-10 04:36:09 +00:00
message ( STATUS " sudo zypper install ${PYTHON_NAME}-six" )
2018-11-24 17:40:34 +00:00
else ( )
2019-03-10 04:36:09 +00:00
message ( STATUS " sudo apt-get install ${PYTHON_NAME}-six" )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-25 19:40:29 +00:00
message ( FATAL_ERROR "six - python 2 and 3 compatibility library required to build VOLK_GNSSSDR" )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-26 11:42:20 +00:00
2019-03-09 18:45:24 +00:00
set_package_properties ( Python3 PROPERTIES
U R L " h t t p s : / / w w w . p y t h o n . o r g / "
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 " 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
)
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 / "
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 " 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
)
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 / "
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 "
2019-03-10 04:46:07 +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 . "
2019-03-09 18:45:24 +00:00
T Y P E R E Q U I R E D
)
2018-02-05 13:53:07 +00:00
set ( READ_ENVIRO "" )
2016-12-25 19:40:29 +00:00
if ( ENABLE_PACKAGING )
2018-11-17 13:31:06 +00:00
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
2017-07-23 19:09:41 +00:00
set ( STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON -DCMAKE_VERBOSE_MAKEFILE=ON" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-10-04 20:35:44 +00:00
if ( NOT DEFINED ENV{PROTECT_PASSWORDS} )
2018-11-24 17:40:34 +00:00
set ( READ_ENVIRO ${ CMAKE_COMMAND } -E environment )
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 ( )
2016-12-25 19:40:29 +00:00
if ( OS_IS_MACOSX )
if ( CMAKE_GENERATOR STREQUAL Xcode )
set ( VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2016-12-26 11:42:20 +00:00
2017-04-06 19:16:44 +00:00
if ( CMAKE_CROSSCOMPILING )
set ( VOLK_GNSSSDR_COMPILER "" )
2018-11-24 17:40:34 +00:00
else ( )
2016-12-20 02:29:40 +00:00
set ( VOLK_GNSSSDR_COMPILER -DCMAKE_C_COMPILER= ${ CMAKE_C_COMPILER } -DCMAKE_CXX_COMPILER= ${ CMAKE_CXX_COMPILER } )
2018-11-24 17:40:34 +00:00
endif ( )
2016-12-20 01:35:52 +00:00
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_COMPILER }
2018-11-19 07:51:05 +00:00
- D C M A K E _ I N S T A L L _ P R E F I X = $ { C M A K E _ C U R R E N T _ 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
- 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 }
- D C M A K E _ I N C L U D E _ P A T H = $ { B o o s t _ I N C L U D E _ D I R }
- D E N A B L E _ O R C = O F F
$ { 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 }
)
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 }
2018-11-19 07:51:05 +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 _ C U R R E N T _ 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
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
)
2018-11-24 17:40:34 +00:00
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
P R E F I X $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ 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
C M A K E _ A R G S $ { R E A D _ E N V I R O } $ { V O L K _ G N S S S D R _ C M A K E _ A R G S }
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 " "
B U I L D _ C O M M A N D $ { R E A D _ E N V I R O } $ { V O L K _ G N S S S D R _ B U I L D _ C O M M A N D } v o l k _ g n s s s d r _ p r o f i l e
I N S T A L L _ D I R $ { C M A K E _ C U R R E N T _ 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 ( )
ExternalProject_Add ( volk_gnsssdr_module
P R E F I X $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ 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
C M A K E _ A R G S $ { R E A D _ E N V I R O } $ { V O L K _ G N S S S D R _ C M A K E _ A R G S }
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 " "
B U I L D _ C O M M A N D $ { R E A D _ E N V I R O } $ { V O L K _ G N S S S D R _ B U I L D _ C O M M A N D } v o l k _ g n s s s d r _ p r o f i l e
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 / $ { 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 }
2019-04-02 00:41:20 +00:00
$ { C M A K E _ C U R R E N T _ 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
2018-11-24 17:40:34 +00:00
I N S T A L L _ D I R $ { C M A K E _ C U R R E N T _ 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
endif ( )
2014-11-07 20:44:44 +00:00
find_package ( ORC )
2019-03-09 00:39:32 +00:00
set_package_properties ( ORC PROPERTIES
U R L " h t t p s : / / g s t r e a m e r . f r e e d e s k t o p . o r g / m o d u l e s / o r c . h t m l "
D E S C R I P T I O N " T h e O p t i m i z e d I n n e r L o o p s R u n t i m e C o m p i l e r "
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
)
2019-03-10 04:36:09 +00:00
if ( NOT ORC_FOUND )
set ( ORC_LIBRARIES "" )
set ( ORC_INCLUDE_DIRS "" )
endif ( )
2015-03-20 16:02:41 +00:00
2014-11-07 20:44:44 +00:00
add_library ( volk_gnsssdr UNKNOWN IMPORTED )
2017-06-21 06:54:47 +00:00
set_property ( TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${ CMAKE_CURRENT_BINARY_DIR } /volk_gnsssdr_module/install/lib/libvolk_gnsssdr ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2014-11-17 19:42:50 +00:00
set ( VOLK_GNSSSDR_INCLUDE_DIRS "${CMAKE_CURRENT_BINARY_DIR}/volk_gnsssdr_module/build/include/;${CMAKE_CURRENT_SOURCE_DIR}/src/algorithms/libs/volk_gnsssdr_module/volk_gnsssdr/include;${ORC_INCLUDE_DIRS}" )
2016-10-23 09:12:13 +00:00
set ( VOLK_GNSSSDR_LIBRARIES volk_gnsssdr ${ ORC_LIBRARIES } )
2014-11-07 17:23:59 +00:00
2019-02-03 18:24:44 +00:00
if ( NOT TARGET Volkgnsssdr::volkgnsssdr )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /volk_gnsssdr_module/build/include )
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 "
I M P O R T E D _ L O C A T I O N " $ { C M A K E _ C U R R E N T _ 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 / 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 } "
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 } "
)
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
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ 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
2019-03-10 04:36:09 +00:00
$ { C M A K E _ S O U R C 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
)
2018-11-24 17:40:34 +00:00
else ( )
add_custom_command ( TARGET volk_gnsssdr_module POST_BUILD
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ 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
2017-06-21 06:54:47 +00:00
$ { C M A K E _ S O U R C 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
B Y P R O D U C T S $ { C M A K E _ S O U R C 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
)
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
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { C M A K E _ C U R R E N T _ 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
2019-03-10 04:36:09 +00:00
$ { C M A K E _ S O U R C 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
)
endif ( )
2019-03-10 04:36:09 +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
################################################################################
2014-11-12 19:22:02 +00:00
set ( LOCAL_GFLAGS false )
2018-11-21 07:28:50 +00:00
find_package ( GFLAGS )
2019-03-10 04:36:09 +00:00
set_package_properties ( GFLAGS PROPERTIES
U R L " 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 "
D E S C R I P T I O N " C + + l i b r a r y t h a t i m p l e m e n t s c o m m a n d l i n e f l a g s p r o c e s s i n g "
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 )
2018-11-19 07:51:05 +00:00
message ( STATUS " gflags library has not been found." )
message ( STATUS " gflags v${GNSSSDR_GFLAGS_LOCAL_VERSION} will be downloaded and built automatically " )
2019-03-09 00:39:32 +00:00
message ( STATUS " when doing 'make'." )
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 }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 }
G I T _ R E P O S I T O R Y g i t : / / g i t h u b . c o m / g f l a g s / g f l a g s . g i t
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 }
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 N - 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 _ n o t h r e a d s _ L I B = O F F - 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 }
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 }
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 ( )
ExternalProject_Add ( gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 }
G I T _ R E P O S I T O R Y g i t : / / g i t h u b . c o m / g f l a g s / g f l a g s . g i t
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 }
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 N - 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 _ n o t h r e a d s _ L I B = O F F - 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 }
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 }
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 }
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 ( )
2018-11-19 07:51:05 +00:00
set ( GFlags_INCLUDE_DIRS
$ { C M A K E _ C U R R E N T _ 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 "
)
2019-02-03 18:24:44 +00:00
file ( GLOB GFlags_SHARED_LIBS
" $ { C M A K E _ C U R R E N T _ 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 H A R E D _ L I B R A R Y _ S U F F I X } * "
)
if ( NOT TARGET Gflags::gflags )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } /include )
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 "
I M P O R T E D _ L O C A T I O N " $ { C M A K E _ C U R R E N T _ 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 N C L U D E _ D I R E C T O R I E S " $ { C M A K E _ C U R R E N T _ 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 "
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 " $ { C M A K E _ C U R R E N T _ 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 "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { C M A K E _ C U R R E N T _ 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 } "
)
endif ( )
2018-11-19 07:51:05 +00:00
set ( LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE )
2019-03-09 00:39:32 +00:00
set_package_properties ( GFLAGS PROPERTIES
2019-03-10 04:36:09 +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 } w i l l b e d o w n l o a d e d a n d 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
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-03-10 04:36:09 +00:00
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
################################################################################
2014-11-14 00:40:43 +00:00
if ( NOT ${ ENABLE_OWN_GLOG } )
2018-11-19 07:51:05 +00:00
find_package ( GLOG )
if ( GLOG_INCLUDE_DIRS )
2014-12-07 11:05:38 +00:00
set ( GLOG_FOUND ON )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2019-03-10 04:36:09 +00:00
set_package_properties ( GLOG PROPERTIES
U R L " h t t p s : / / g i t h u b . c o m / g o o g l e / g l o g "
D E S C R I P T I O N " C + + i m p l e m e n t a t i o n o f t h e G o o g l e l o g g i n g m o d u l e "
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 ( )
2018-11-19 07:51:05 +00:00
message ( STATUS " glog v${GNSSSDR_GLOG_LOCAL_VERSION} will be downloaded and built automatically " )
2019-03-09 00:39:32 +00:00
message ( STATUS " when doing 'make'." )
2018-11-19 07:51:05 +00:00
if ( NOT ${ LOCAL_GFLAGS } )
add_library ( gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } UNKNOWN IMPORTED )
set_property ( TARGET gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}" )
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 } )
if ( ${ LOCAL_GFLAGS } )
set ( GFLAGS_LIBRARIES_TO_LINK ${ GFlags_SHARED_LIBS } )
set ( GFLAGS_LIBRARY_DIR_TO_LINK ${ CMAKE_CURRENT_BINARY_DIR } /gflags- ${ GNSSSDR_GFLAGS_LOCAL_VERSION } /lib )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
set ( GFLAGS_LIBRARIES_TO_LINK ${ GFlags_LIBS } )
set ( GFLAGS_LIBRARY_DIR_TO_LINK ${ GFlags_LIBRARY_DIRS } )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /tmp/configure_with_gflags
2014-05-18 10:53:16 +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 }
2016-11-05 08:20:24 +00:00
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 } - l c + + \ "
2015-03-20 16:02:41 +00:00
e x p o r t C X X F L A G S = \ " - s t d l i b = l i b c + + \ "
e x p o r t C C = c l a n g
2014-05-18 10:53:16 +00:00
e x p o r t C X X = c l a n g + +
2017-11-04 18:22:40 +00:00
c d $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 } /
2016-11-04 11:55:09 +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
2017-11-04 18:22:40 +00:00
c d $ { C M A K E _ C U R R E N T _ 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-04-02 00:41:20 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ 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 "
)
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /tmp/configure_with_gflags
2014-11-09 20:04:52 +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 }
2016-11-05 08:20:24 +00:00
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 }
2016-11-04 15:25:34 +00:00
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 }
2017-11-04 18:22:40 +00:00
c d $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 } /
2016-11-04 11:55:09 +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
2017-11-04 18:22:40 +00:00
c d $ { C M A K E _ C U R R E N T _ 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-04-02 00:41:20 +00:00
$ { C M A K E _ C U R R E N T _ S O U R C E _ 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 "
)
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /tmp/configure_with_gflags
D E S T I N A T I O N $ { C M A K E _ C U R R E N T _ 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 }
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
2019-04-02 00:41:20 +00:00
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
)
2016-11-04 15:25:34 +00:00
2018-11-19 07:51:05 +00:00
set ( GLOG_CONFIGURE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /configure_with_gflags )
# Ensure that aclocal and libtool are present
if ( OS_IS_LINUX )
if ( EXISTS "/usr/bin/libtoolize" )
2018-11-24 17:40:34 +00:00
if ( EXISTS "/usr/bin/aclocal" OR EXISTS "/usr/bin/aclocal-1.16" OR EXISTS "/usr/bin/aclocal-1.15" OR EXISTS "/usr/bin/aclocal-1.14" OR EXISTS "/usr/bin/aclocal-1.13" OR EXISTS "/usr/bin/aclocal-1.11" OR EXISTS "/usr/bin/aclocal-1.10" )
# 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 ( )
2018-11-19 07:51:05 +00:00
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" )
2018-11-24 17:40:34 +00:00
message ( " sudo yum groupinstall 'Development Tools'" )
2018-11-19 07:51:05 +00:00
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
2018-11-24 17:40:34 +00:00
message ( " sudo zypper install libtoool" )
else ( )
message ( " sudo apt-get install libtool" )
endif ( )
2018-11-19 07:51:05 +00:00
message ( FATAL_ERROR "libtool is required to build glog from source" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2016-11-04 15:25:34 +00:00
2019-04-23 22:56:17 +00:00
set ( GLOG_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
if ( GLOG_MAKE_PROGRAM MATCHES "ninja" )
find_program ( GLOG_MAKE_EXECUTABLE make
H I N T 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 ( )
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 ( 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 }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 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 >
2019-04-23 22:56:17 +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 } "
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 " "
)
2018-11-24 17:40:34 +00:00
else ( )
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 }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 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 >
2019-04-23 22:56:17 +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 } "
2018-11-19 07:51:05 +00:00
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 }
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 " "
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-02-03 18:24:44 +00:00
add_dependencies ( glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } Gflags::gflags )
2018-11-19 07:51:05 +00:00
# Set up variables
set ( GLOG_INCLUDE_DIRS
$ { C M A K E _ C U R R E N T _ S O U R C E _ 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 /
$ { C M A K E _ C U R R E N T _ 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
)
set ( GLOG_LIBRARIES
$ { C M A K E _ C U R R E N T _ 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-02-03 18:24:44 +00:00
# Create Glog::glog target
if ( NOT TARGET Glog::glog )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } /thirdparty/glog/glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /src )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } /src )
add_library ( Glog::glog STATIC IMPORTED )
add_dependencies ( Glog::glog glog- ${ GNSSSDR_GLOG_LOCAL_VERSION } )
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 " $ { C M A K E _ C U R R E N T _ 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 } "
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 " $ { C M A K E _ C U R R E N T _ 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 } "
)
endif ( )
2018-11-19 07:51:05 +00:00
set ( LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE )
2019-03-09 00:39:32 +00:00
set_package_properties ( GLOG PROPERTIES
2019-03-10 04:36:09 +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 a n d b u i l t w h e n d o i n g ' m a k 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 )
2018-11-19 07:51:05 +00:00
message ( STATUS "Logging is not enabled" )
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-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
# See http://www.netlib.org/blas/
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-22 10:00:13 +00:00
if ( OS_IS_MACOSX )
# 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 ( )
2019-03-22 10:00:13 +00:00
find_package ( BLAS )
set_package_properties ( BLAS PROPERTIES
U R L " h t t p : / / w w w . n e t l i b . o r g / b l a s / "
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:" )
2019-03-22 10:00:13 +00:00
if ( OS_IS_MACOSX )
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 ( )
2017-11-26 00:48:48 +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
# See http://www.netlib.org/lapack/
2019-03-10 04:36:09 +00:00
################################################################################
2019-03-22 10:00:13 +00:00
if ( NOT OS_IS_MACOSX )
find_package ( LAPACK )
set_package_properties ( LAPACK PROPERTIES
U R L " h t t p : / / w w w . n e t l i b . o r g / l a p a c k / "
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 ( )
2017-11-25 19:09:10 +00:00
2013-11-27 21:11:21 +00:00
2017-11-25 19:09:10 +00:00
################################################################################
# Armadillo - http://arma.sourceforge.net/
################################################################################
2012-12-24 02:33:50 +00:00
find_package ( Armadillo )
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 / "
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 "
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 )
if ( ${ ARMADILLO_VERSION_STRING } VERSION_LESS ${ GNSSSDR_ARMADILLO_MIN_VERSION } )
set ( ARMADILLO_FOUND false )
set ( ENABLE_OWN_ARMADILLO true )
2019-02-03 18:24:44 +00:00
else ( )
add_library ( Armadillo::armadillo SHARED IMPORTED )
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 "
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 } "
2019-02-03 18:24:44 +00:00
)
2018-11-24 17:40:34 +00:00
endif ( )
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 )
2018-11-19 07:51:05 +00:00
message ( STATUS " Armadillo has not been found." )
message ( STATUS " Armadillo ${GNSSSDR_ARMADILLO_LOCAL_VERSION} will be downloaded and built 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
#############################################
if ( NOT OS_IS_MACOSX )
find_package ( GFORTRAN )
2019-03-10 04:36:09 +00:00
set_package_properties ( GFORTRAN PROPERTIES
U R L " h t t p : / / g c c . g n u . o r g / w i k i / G F o r t r a n "
D E S C R I P T I O N " G N U F o r t r a n p r o j e c t "
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
#############################################
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( armadillo- ${ armadillo_RELEASE }
2018-11-19 07:51:05 +00:00
P R E F I X $ { C M A K E _ C U R R E N T _ 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 }
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 _ 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 B U I L D _ S H A R E D _ L I B S = O F F - D C M A K E _ C X X _ F L A G S = - s t d = c + + 1 1
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 }
U P D A T E _ C O M M A N D " "
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 }
2018-11-19 07:51:05 +00:00
P R E F I X $ { C M A K E _ C U R R E N T _ 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 }
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 _ 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 B U I L D _ S H A R E D _ L I B S = O F F - D C M A K E _ C X X _ F L A G S = - s t d = c + + 1 1
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 }
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 }
U P D A T E _ C O M M A N D " "
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-03-22 10:00:13 +00:00
set ( ARMADILLO_LIBRARIES ${ BLAS_LIBRARIES } ${ LAPACK_LIBRARIES } ${ GFORTRAN } ${ binary_dir } / ${ CMAKE_FIND_LIBRARY_PREFIXES } armadillo ${ CMAKE_STATIC_LIBRARY_SUFFIX } )
2018-11-19 07:51:05 +00:00
set ( LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE )
set ( ARMADILLO_VERSION_STRING ${ armadillo_RELEASE } )
2019-02-03 18:24:44 +00:00
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } /thirdparty/armadillo/armadillo- ${ armadillo_RELEASE } /include )
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 "
I M P O R T E D _ L O C A T I O 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 } "
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 " $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { 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 } "
2019-02-03 18:24:44 +00:00
)
2019-03-09 00:39:32 +00:00
set_package_properties ( Armadillo PROPERTIES
2019-03-10 04:36:09 +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 a n d 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
)
2018-11-24 17:40:34 +00:00
endif ( )
2019-03-10 04:36:09 +00:00
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 / "
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 "
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
)
2015-10-27 19:18:48 +00:00
find_library ( GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27
2018-11-24 17:40:34 +00:00
H I N T S / u s r / l i b
/ u s r / l i b 6 4
/ 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
/ 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
/ 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
)
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..." )
if ( OS_IS_MACOSX )
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 "
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 T o o l k i t "
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:" )
if ( OS_IS_LINUX )
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 ( )
2018-11-19 07:51:05 +00:00
if ( OS_IS_MACOSX )
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
U R L " h t t p s : / / g i t h u b . c o m / t b e u / m a t i o "
D E S C R I P T I O N " M A T L A B M A T F i l e I / O L i b r a r y "
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 ( )
2018-03-10 22:00:09 +00:00
message ( STATUS " Matio v${GNSSSDR_MATIO_LOCAL_VERSION} will be downloaded and built automatically" )
2019-03-09 00:39:32 +00:00
message ( STATUS " when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
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 / "
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 "
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
)
2017-11-26 09:49:42 +00:00
if ( ZLIB_FOUND )
get_filename_component ( ZLIB_BASE_DIR ${ ZLIB_INCLUDE_DIRS } DIRECTORY )
2018-02-23 22:46:16 +00:00
if ( OS_IS_LINUX )
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 ( )
2018-02-23 22:46:16 +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 ( )
2018-02-23 22:46:16 +00:00
message ( FATAL_ERROR "aclocal is required to build matio from source" )
2018-11-24 17:40:34 +00:00
endif ( )
endif ( )
2017-11-26 09:49:42 +00:00
find_package ( HDF5 )
2019-03-09 00:39:32 +00:00
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 / "
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 "
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
)
2017-11-26 09:49:42 +00:00
if ( HDF5_FOUND )
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 ( OS_IS_MACOSX )
if ( EXISTS /opt/local/include/hdf5.h )
set ( HDF5_BASE_DIR /opt/local )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-26 09:49:42 +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 ( )
2019-02-03 18:24:44 +00:00
2019-04-23 22:56:17 +00:00
set ( MATIO_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
if ( MATIO_MAKE_PROGRAM MATCHES "ninja" )
find_program ( MATIO_MAKE_EXECUTABLE make
H I N T 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." )
endif ( )
set ( MATIO_MAKE_PROGRAM ${ MATIO_MAKE_EXECUTABLE } )
endif ( )
2017-11-26 09:49:42 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
2018-11-24 17:40:34 +00:00
ExternalProject_Add ( matio- ${ GNSSSDR_MATIO_LOCAL_VERSION }
P R E F I X $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a t i o
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 >
2019-04-23 22:56:17 +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 }
2018-11-24 17:40:34 +00:00
)
else ( )
ExternalProject_Add ( matio- ${ GNSSSDR_MATIO_LOCAL_VERSION }
P R E F I X $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a t i o
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 >
2019-04-23 22:56:17 +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 }
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a t i o / 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 } m a t i o $ { C M A K E _ S H A R E D _ L I B R A R Y _ S U F F I X }
2018-11-24 17:40:34 +00:00
)
endif ( )
2017-11-26 09:49:42 +00:00
set ( MATIO_LOCAL true )
2019-02-03 18:24:44 +00:00
if ( NOT TARGET Matio::matio )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /matio/include )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_BINARY_DIR } /matio/lib )
add_library ( Matio::matio SHARED IMPORTED )
add_dependencies ( Matio::matio matio- ${ GNSSSDR_MATIO_LOCAL_VERSION } )
set_target_properties ( Matio::matio PROPERTIES
2019-03-10 04:36:09 +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 "
I M P O R T E D _ L O C A T I O N " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a t i o / 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 } m a t i o $ { C M A K E _ S H A R E D _ L I B R A R Y _ S U F F I X } "
2019-04-23 22:56:17 +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 $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a t i o / 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 $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / m a t i o / 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 } m a t i o $ { C M A K E _ S H A R E D _ L I B R A R Y _ S U F F I X }
2019-02-03 18:24:44 +00:00
)
endif ( )
2018-11-24 17:40:34 +00:00
else ( )
2017-11-26 09:49:42 +00:00
message ( STATUS " The hdf5 library has not been found in your system." )
message ( STATUS " Please try to install it by doing:" )
if ( OS_IS_MACOSX )
message ( STATUS " $ sudo port install hdf5" )
message ( STATUS " or" )
message ( STATUS " $ brew install hdf5" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-26 09:49:42 +00:00
if ( OS_IS_LINUX )
message ( STATUS " $ sudo apt-get install libhdf5-dev" )
2018-11-24 17:40:34 +00:00
endif ( )
2017-11-26 09:49:42 +00:00
message ( FATAL_ERROR "*** The hdf5 library is required to build gnss-sdr" )
2018-11-24 17:40:34 +00:00
endif ( )
else ( )
2017-11-26 09:49:42 +00:00
message ( FATAL_ERROR "*** The zlib library is required to build gnss-sdr" )
2018-11-24 17:40:34 +00:00
endif ( )
2019-03-09 00:39:32 +00:00
set_package_properties ( MATIO PROPERTIES
2019-03-10 04:36:09 +00:00
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 a n d 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
)
2018-11-24 17:40:34 +00:00
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
U R L " h t t p s : / / p u g i x m l . o r g / "
D E S C R I P T I O N " L i g h t - w e i g h t , s i m p l e a n d f a s t X M L p a r s e r f o r C + + "
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 )
2019-03-09 00:39:32 +00:00
message ( STATUS " PugiXML v${GNSSSDR_PUGIXML_LOCAL_VERSION} will be downloaded and built when doing '${CMAKE_MAKE_PROGRAM_PRETTY_NAME}'." )
2018-11-11 11:27:01 +00:00
set ( PUGIXML_COMPILER -DCMAKE_CXX_COMPILER= ${ CMAKE_CXX_COMPILER } -DCMAKE_C_COMPILER= ${ CMAKE_C_COMPILER } )
set ( TOOLCHAIN_ARG "" )
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 "" )
set ( TOOLCHAIN_ARG "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/cmake/Toolchains/oe-sdk_cross.cmake" )
2018-11-24 17:40:34 +00:00
endif ( )
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 }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 }
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 _ A R G S $ { P U G I X M L _ C O M P I L E R } $ { T O O L C H A I N _ A R G }
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 " "
2018-11-11 11:27:01 +00:00
)
2018-11-24 17:40:34 +00:00
else ( )
ExternalProject_Add ( pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 }
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 }
S O U R C E _ D I R $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 _ A R G S $ { P U G I X M L _ C O M P I L E R } $ { T O O L C H A I N _ A R G }
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 " "
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 }
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
if ( NOT TARGET Pugixml::pugixml )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_SOURCE_DIR } /thirdparty/pugixml/pugixml- ${ GNSSSDR_PUGIXML_LOCAL_VERSION } /src )
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 "
I M P O R T E D _ L O C A T I O N " $ { C M A K E _ C U R R E N T _ 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 } "
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 " $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 "
I N T E R F A C E _ L I N K _ L I B R A R I E S " $ { C M A K E _ C U R R E N T _ 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 } "
)
endif ( )
2018-11-10 18:16:13 +00:00
2019-03-09 00:39:32 +00:00
set_package_properties ( PUGIXML PROPERTIES
2019-03-10 04:36:09 +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 a n d 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
)
endif ( )
2019-03-10 04:36:09 +00:00
2017-11-26 09:49:42 +00:00
2016-11-27 22:47:45 +00:00
2019-04-20 09:52:00 +00:00
################################################################################
# Protocol Buffers https://github.com/protocolbuffers/protobuf
################################################################################
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 / "
2019-04-27 10:19:15 +00:00
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-04-21 09:51:49 +00:00
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 ( )
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
H I N T S
/ u s r / b i n /
/ u s r / l o c a l / b i n /
)
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 } )
2019-04-21 09:51:49 +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 ( )
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 }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 " $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 = $ { C M A K E _ C U R R E N T _ 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 } "
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 }
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 } i n s t a l l
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 }
2019-04-23 22:56:17 +00:00
$ { C M A K E _ C U R R E N T _ 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
)
endif ( )
2019-04-21 09:51:49 +00:00
else ( )
2019-04-23 22:56:17 +00:00
if ( OS_IS_LINUX )
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 ( )
endif ( )
2019-04-23 23:30:22 +00:00
2019-04-23 22:56:17 +00:00
set ( PROTOBUF_MAKE_PROGRAM ${ CMAKE_MAKE_PROGRAM } )
if ( PROTOBUF_MAKE_PROGRAM MATCHES "ninja" )
find_program ( MAKE_EXECUTABLE make
H I N T 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 } )
endif ( )
2019-04-21 09:51:49 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.2 )
ExternalProject_Add ( protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 = $ { C M A K E _ C U R R E N T _ 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-23 22:56:17 +00:00
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 } i n s t a l l
2019-04-21 09:51:49 +00:00
)
2019-04-20 09:52:00 +00:00
else ( )
2019-04-21 09:51:49 +00:00
ExternalProject_Add ( protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION }
P R E F I X $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 $ { C M A K E _ C U R R E N T _ S O U R C E _ 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 = $ { C M A K E _ C U R R E N T _ 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-23 22:56:17 +00:00
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 } i n s t a l l
2019-04-21 09:51:49 +00:00
B U I L D _ B Y P R O D U C T S $ { C M A K E _ C U R R E N T _ 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 }
2019-04-23 22:56:17 +00:00
$ { C M A K E _ C U R R E N T _ 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 19:57:28 +00:00
)
2019-04-20 09:52:00 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
if ( NOT TARGET protobuf::protoc )
add_executable ( protobuf::protoc IMPORTED )
add_dependencies ( protobuf::protoc protobuf- ${ GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION } )
2019-04-20 09:52:00 +00:00
endif ( )
2019-04-21 09:51:49 +00:00
unset ( Protobuf_PROTOC_EXECUTABLE )
set ( PROTOBUF_PROTOC_EXECUTABLE "${CMAKE_CURRENT_BINARY_DIR}/protobuf-${GNSSSDR_PROTOCOLBUFFERS_LOCAL_VERSION}/bin/protoc" )
set_target_properties ( protobuf::protoc PROPERTIES
2019-04-20 17:11:17 +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 "
2019-04-21 09:51:49 +00:00
I M P O R T E D _ L O C A T I O N " $ { C M A K E _ C U R R E N T _ 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 " $ { C M A K E _ C U R R E N T _ 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 } "
2019-04-20 17:11:17 +00:00
)
2019-04-21 09:51:49 +00:00
endif ( )
file ( MAKE_DIRECTORY ${ CMAKE_CURRENT_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 " $ { C M A K E _ C U R R E N T _ 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 " $ { C M A K E _ C U R R E N T _ 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 " $ { C M A K E _ C U R R E N T _ 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 } "
)
2019-04-20 09:52:00 +00:00
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
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 a n d 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-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 )
endif ( )
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
################################################################################
2019-03-09 00:39:32 +00:00
# Doxygen - http://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
################################################################################
find_package ( Doxygen )
2019-03-10 04:36:09 +00:00
set_package_properties ( Doxygen PROPERTIES
U R L " h t t p : / / w w w . d o x y g e n . n l "
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 "
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-03-09 00:39:32 +00:00
find_package ( LATEX )
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 "
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 ' "
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'." )
message ( STATUS " When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html" )
2018-11-19 07:51:05 +00:00
set ( HAVE_DOT ${ DOXYGEN_DOT_FOUND } )
file ( TO_NATIVE_PATH ${ CMAKE_SOURCE_DIR } top_srcdir )
file ( TO_NATIVE_PATH ${ CMAKE_BINARY_DIR } top_builddir )
if ( PDFLATEX_COMPILER )
set ( GENERATE_PDF_DOCUMENTATION "YES" )
set ( GNSSSDR_USE_MATHJAX "NO" )
2018-11-24 17:40:34 +00:00
else ( )
2018-11-19 07:51:05 +00:00
set ( GENERATE_PDF_DOCUMENTATION "NO" )
set ( GNSSSDR_USE_MATHJAX "YES" )
2018-11-24 17:40:34 +00:00
endif ( )
2018-11-19 07:51:05 +00:00
configure_file ( ${ CMAKE_SOURCE_DIR } /docs/doxygen/Doxyfile.in
$ { C M A K E _ 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
@ O N L Y
)
add_custom_target ( doc
$ { D O X Y G E N _ E X E C U T A B L E } $ { C M A K E _ 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 $ { C M A K E _ B I N A R Y _ D I R }
2019-03-09 00:39:32 +00:00
C O M M E N T " G e n e r a t i n g s o u r c e c o d e d o c u m e n t a t i o n 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 )
2019-02-21 08:59:06 +00:00
message ( STATUS " '${CMAKE_MAKE_PROGRAM_PRETTY_NAME} pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf" )
2018-11-19 07:51:05 +00:00
add_custom_target ( pdfmanual
C O M M A N D $ { C M A K E _ M A K E _ P R O G R A M }
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 $ { C M A K E _ 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
C O M M A N D $ { C M A K E _ M A K E _ P R O G R A M } c l e a n
D E P E N D S d o c
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ B I N A R Y _ D I R } / d o c s / l a t e x
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 D o x y g e n . " V E R B A T I M
)
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." )
2018-11-19 07:51:05 +00:00
add_custom_target ( doc-clean
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 $ { C M A K E _ 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 $ { C M A K E _ 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 $ { C M A K E _ 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
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
)
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!" )
message ( STATUS " Get it from http://www.stack.nl/~dimitri/doxygen/index.html" )
if ( OS_IS_LINUX )
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 ( )
2018-11-19 07:51:05 +00:00
if ( OS_IS_MACOSX )
message ( STATUS " or simply by doing 'sudo port install doxygen +latex'." )
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
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
U R L " h t t p s : / / w w w . k h r o n o s . o r g / o p e n c l / "
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 "
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
)
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 )
2018-11-21 07:28:50 +00:00
find_package ( 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 )
set ( OPENCL_FOUND FALSE )
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-02-21 08:59:06 +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 ( )
2014-09-07 17:35:41 +00:00
if ( ENABLE_GENERIC_ARCH )
set ( OPENCL_FOUND FALSE )
message ( STATUS "ENABLE_GENERIC_ARCH 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 ( )
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
set ( OPENCL_FOUND FALSE )
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
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 )
2018-11-24 17:40:34 +00:00
find_package ( CUDA REQUIRED )
2019-03-09 00:39:32 +00:00
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 "
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 "
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
)
2019-03-10 04:36:09 +00:00
message ( STATUS "NVIDIA CUDA GPU Acceleration will be enabled." )
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." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Enable it with 'cmake -DENABLE_CUDA=ON ..' to add support for GPU-based acceleration using CUDA." )
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
U R L " h t t p s : / / w w w . t c p d u m p . o r g "
D E S C R I P T I O N " A p o r t a b l e C / C + + l i b r a r y f o r n e t w o r k t r a f f i c c a p t u r e "
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
)
2018-05-16 09:36:37 +00:00
if ( ENABLE_RAW_UDP )
2019-02-04 17:17:35 +00:00
message ( STATUS "High-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 )
2018-11-19 07:51:05 +00:00
message ( STATUS "FPGA Acceleration 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 ( )
2018-11-19 07:51:05 +00:00
message ( STATUS "Fpga Acceleration will be not enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Enable it with 'cmake -DENABLE_FPGA=ON ..' to add support for GPU-based acceleration using the FPGA." )
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
################################################################################
2015-03-03 17:07:26 +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
U R L " h t t p s : / / o s m o c o m . o r g / p r o j e c t s / g r - o s m o s d r / w i k i "
D E S C R I P T I O N " o s m o c o m G N U R a d i o b l o c k s "
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 ( )
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
##############################################
# 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-03-09 00:39:32 +00:00
find_package ( GRIIO )
set_package_properties ( GRIIO PROPERTIES
U R L " h t t p s : / / g i t h u b . c o m / a n a l o g d e v i c e s i n c / g r - i i o "
D E S C R I P T I O N " I I O b l o c k s f o r G N U R a d i o "
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
)
2019-02-04 17:17:35 +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
U R L " h t t p s : / / g i t h u b . c o m / a n a l o g d e v i c e s i n c / l i b i i o "
D E S C R I P T I O N " A l i b r a r y f o r i n t e r f a c i n g w i t h L i n u x I I O d e v i c e s "
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-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
D E S C R I P T I O N " T h e T e l e o r b i t ' s F l e x i b a n d 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 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
2019-03-10 04:36:09 +00:00
######################
2019-02-04 17:17:35 +00:00
# GN3S - OPTIONAL
2019-03-10 04:36:09 +00:00
######################
2019-04-02 01:31:46 +00:00
if ( DEFINED ENV{GN3S_DRIVER} )
2019-02-04 17:17:35 +00:00
message ( STATUS "GN3S_DRIVER environment variable found." )
set ( ENABLE_GN3S ON )
endif ( )
if ( GN3S_DRIVER )
set ( ENABLE_GN3S ON )
endif ( )
2019-03-09 00:39:32 +00:00
find_package ( GRGN3S QUIET )
2019-03-10 04:36:09 +00:00
set_package_properties ( GRGN3S 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 - g n 3 s "
D E S C R I P T I O N " T h e G N 3 S v 2 f r o n t - e n d 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 t h e G N 3 S v 2 f r o n t - e n d . "
T Y P E O P T I O N A L
)
2019-02-04 17:17:35 +00:00
if ( ENABLE_GN3S )
message ( STATUS "The GN3S driver will be compiled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " You can disable it with 'cmake -DENABLE_GN3S=OFF ..'" )
2019-02-04 17:17:35 +00:00
else ( )
message ( STATUS "The (optional and experimental) GN3S driver is not enabled." )
2019-02-21 08:59:06 +00:00
message ( STATUS " Enable it with 'cmake -DENABLE_GN3S=ON ..' to add support for the GN3S dongle." )
2019-02-04 17:17:35 +00:00
endif ( )
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." )
2019-02-04 17:17:35 +00:00
endif ( )
2019-03-10 04:36:09 +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
U R L " h t t p s : / / g i t h u b . c o m / g p e r f t o o l s / g p e r f t o o l s "
D E S C R I P T I O N " C o l l e c t i o n o f p e r f o r m a n c e a n a l y s i s t o o l s "
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
################################################################################
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 18:17:32 +00:00
set ( cxx_warning_flags -Wall -Wextra )
2019-02-24 19:22:15 +00:00
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 ( )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0" )
add_compile_options ( -Wno-missing-field-initializers )
endif ( )
2019-02-24 13:11:21 +00:00
if ( CMAKE_CROSSCOMPILING )
add_compile_options ( -Wno-psabi )
endif ( )
2018-11-24 17:40:34 +00:00
endif ( )
2017-08-07 09:08:05 +00:00
2016-11-27 22:47:45 +00:00
# Processor-architecture related flags
2018-05-13 19:16:09 +00:00
# See https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html
2019-02-24 13:11:21 +00:00
if ( ( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" ) AND NOT WIN32 )
if ( OS_IS_MACOSX )
add_compile_options ( -march=corei7 -mfpmath=sse )
else ( )
if ( NOT ENABLE_GENERIC_ARCH )
if ( IS_ARM )
# ARM-specific options
# See https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html
if ( NOT CMAKE_CROSSCOMPILING )
if ( ARM_VERSION STREQUAL "arm" )
# Unknown arm version - try our best to detect
add_compile_options ( -mcpu=native )
else ( )
add_compile_options ( -march= ${ ARM_VERSION } )
endif ( )
endif ( )
else ( )
add_compile_options ( -march=native -mfpmath=sse )
endif ( )
endif ( )
endif ( )
endif ( )
2012-12-24 11:20:23 +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 (
2014-11-04 00:10:58 +00:00
$ { C M A K E _ C U R R E N T _ 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
2013-07-10 21:07:43 +00:00
$ { C M A K E _ C U R R E N T _ 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
2019-03-23 13:24:49 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - P $ { C M A K E _ C U R R E N T _ 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
)
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-03-09 22:48:32 +00:00
message ( STATUS "" )
message ( STATUS "***************************************" )
message ( STATUS "* SUMMARY REPORT *" )
message ( STATUS "***************************************" )
message ( STATUS "" )
if ( CMAKE_VERSION VERSION_LESS 3.4 )
feature_summary ( WHAT ALL )
feature_summary ( FILENAME ${ CMAKE_CURRENT_BINARY_DIR } /features.log WHAT ALL )
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
)
feature_summary ( FILENAME ${ CMAKE_CURRENT_BINARY_DIR } /features.log 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
)
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." )