2015-01-08 18:49:59 +00:00
# Copyright (C) 2010-2015 (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
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
#
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
2012-12-24 02:33:50 +00:00
########################################################################
if ( ${ CMAKE_SOURCE_DIR } STREQUAL ${ CMAKE_BINARY_DIR } )
2015-03-20 14:23:16 +00:00
message ( WARNING "In-tree build is bad practice. Try 'cd build && cmake ../' " )
2012-12-24 02:33:50 +00:00
endif ( ${ CMAKE_SOURCE_DIR } STREQUAL ${ CMAKE_BINARY_DIR } )
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
cmake_minimum_required ( VERSION 2.8 )
project ( gnss-sdr CXX C )
list ( APPEND CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /cmake/Modules )
file ( RELATIVE_PATH RELATIVE_CMAKE_CALL ${ CMAKE_CURRENT_BINARY_DIR } ${ CMAKE_CURRENT_SOURCE_DIR } )
2014-09-30 23:09:44 +00:00
2016-10-25 11:01:20 +00:00
if ( NOT CMAKE_PREFIX_PATH )
if ( DEFINED ENV{PYBOMBS_PREFIX} )
set ( CMAKE_PREFIX_PATH $ENV{ PYBOMBS_PREFIX } )
endif ( DEFINED ENV{PYBOMBS_PREFIX} )
if ( DEFINED ENV{SNAP} )
set ( CMAKE_PREFIX_PATH $ENV{ SNAP } )
endif ( DEFINED ENV{SNAP} )
endif ( NOT CMAKE_PREFIX_PATH )
2012-12-24 02:33:50 +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)
# Enable them here or at the command line by doing 'cmake -DENABLE_XXX=ON ../'
2012-12-24 02:33:50 +00:00
########################################################################
2015-05-03 08:15:51 +00:00
# Support of optional RF front-ends
2014-12-15 18:25:36 +00:00
option ( ENABLE_OSMOSDR "Enable the use of OsmoSDR and other front-ends (RTL-based dongles, HackRF, bladeRF, etc.) as signal source (experimental)" OFF )
2015-05-03 08:15:51 +00:00
option ( ENABLE_FLEXIBAND "Enable the use of the signal source adater for the Teleorbit Flexiband GNURadio driver" OFF )
option ( ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF )
option ( ENABLE_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF )
# 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 )
2015-05-03 08:15:51 +00:00
option ( ENABLE_GPROF "Enable the use of the GNU profiler tool 'gprof'" OFF )
# 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 )
2015-05-03 08:15:51 +00:00
option ( ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF )
2015-08-25 17:01:02 +00:00
option ( ENABLE_CUDA "Enable building of processing blocks implemented with CUDA (experimental, requires CUDA SDK)" OFF )
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 )
2014-11-11 22:50:38 +00:00
option ( ENABLE_PACKAGING "Enable software packaging" OFF )
2014-11-14 00:40:43 +00:00
option ( ENABLE_OWN_GLOG "Download glog and link it to gflags" OFF )
2015-05-23 09:20:26 +00:00
option ( ENABLE_LOG "Enable logging" ON )
2014-11-14 00:40:43 +00:00
if ( ENABLE_PACKAGING )
2014-11-11 22:50:38 +00:00
set ( ENABLE_GENERIC_ARCH ON )
2014-11-14 00:40:43 +00:00
endif ( ENABLE_PACKAGING )
2012-12-24 02:33:50 +00:00
2016-10-01 23:59:12 +00:00
# Testing
2016-10-02 22:09:49 +00:00
option ( ENABLE_SYSTEM_TESTING "Builds system tests" OFF )
2016-10-01 23:59:12 +00:00
option ( ENABLE_UNIT_TESTING "Builds unit tests" ON )
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
###############################
2015-03-20 16:02:41 +00:00
# GNSS-SDR version information
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-07-04 15:39:33 +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 } )
# Get the current working branch
execute_process (
C O M M A N D g i t 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
)
# Get the latest abbreviated commit hash of the working branch
execute_process (
C O M M A N D g i t 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 ${ THIS_IS_A_RELEASE } )
2014-04-10 20:05:04 +00:00
2012-12-24 02:33:50 +00:00
set ( VERSION_INFO_MAJOR_VERSION 0 )
2014-04-10 20:05:04 +00:00
set ( VERSION_INFO_API_COMPAT 0 )
2015-01-13 10:11:23 +00:00
if ( ${ THIS_IS_A_RELEASE } )
2016-07-04 14:55:16 +00:00
set ( VERSION_INFO_MINOR_VERSION 8 )
2015-01-13 10:11:23 +00:00
else ( ${ THIS_IS_A_RELEASE } )
2016-07-04 14:55:16 +00:00
set ( VERSION_INFO_MINOR_VERSION 8.git- ${ GIT_BRANCH } - ${ GIT_COMMIT_HASH } )
2015-01-13 10:11:23 +00:00
endif ( ${ THIS_IS_A_RELEASE } )
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
########################################################################
# Environment setup
########################################################################
2012-12-29 21:07:43 +00:00
include ( ExternalProject )
2012-12-25 10:28:29 +00:00
2013-12-10 20:17:57 +00:00
# Detect 64-bits machine
if ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
set ( ARCH_64BITS TRUE )
endif ( CMAKE_SIZEOF_VOID_P EQUAL 8 )
2013-01-27 20:50:38 +00:00
set ( OS_IS_MACOSX "" )
set ( OS_IS_LINUX "" )
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" )
set ( OperatingSystem "Linux" )
2013-01-27 20:50:38 +00:00
set ( OS_IS_LINUX TRUE )
2013-12-10 20:17:57 +00:00
if ( ARCH_64BITS )
set ( ARCH_ "(64 bits)" )
else ( ARCH_64BITS )
set ( ARCH_ "(32 bits)" )
endif ( ARCH_64BITS )
2013-12-11 23:27:46 +00:00
if ( EXISTS "/etc/lsb-release" )
2013-12-10 20:17:57 +00:00
execute_process ( COMMAND cat /etc/lsb-release
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
)
execute_process ( COMMAND cat /etc/lsb-release
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
)
2013-12-11 23:27:46 +00:00
endif ( EXISTS "/etc/lsb-release" )
2013-12-14 14:36:33 +00:00
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/linuxmint/info" )
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 ( EXISTS "/etc/linuxmint/info" )
2015-03-20 16:02:41 +00:00
endif ( NOT LINUX_DISTRIBUTION )
2013-12-10 20:17:57 +00:00
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/os-release" )
2013-12-11 23:27:46 +00:00
execute_process ( COMMAND cat /etc/os-release
2013-12-14 14:36:33 +00:00
C O M M A N D g r e p - m 1 N A M E
2013-12-10 20:17:57 +00:00
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
)
2013-12-14 14:36:33 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Debian" )
set ( LINUX_DISTRIBUTION "Debian" )
2014-10-18 07:10:13 +00:00
file ( READ /etc/debian_version LINUX_VER )
2013-12-14 14:36:33 +00:00
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Debian" )
2015-03-20 16:02:41 +00:00
endif ( EXISTS "/etc/os-release" )
2013-12-10 20:17:57 +00:00
endif ( NOT LINUX_DISTRIBUTION )
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/redhat-release" )
set ( LINUX_DISTRIBUTION "Red Hat" )
file ( READ /etc/redhat-release LINUX_VER )
endif ( EXISTS "/etc/redhat-release" )
endif ( NOT LINUX_DISTRIBUTION )
if ( NOT LINUX_DISTRIBUTION )
if ( EXISTS "/etc/debian_version" )
set ( LINUX_DISTRIBUTION "Debian" )
file ( READ /etc/debian_version LINUX_VER )
endif ( EXISTS "/etc/debian_version" )
endif ( NOT LINUX_DISTRIBUTION )
if ( NOT LINUX_DISTRIBUTION )
set ( LINUX_DISTRIBUTION "Generic" )
set ( LINUX_VER "Unknown" )
2015-03-20 16:02:41 +00:00
endif ( NOT LINUX_DISTRIBUTION )
2014-06-30 18:46:36 +00:00
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on ${LINUX_DISTRIBUTION} GNU/Linux Release ${LINUX_VER} ${ARCH_}" )
2013-01-19 17:10:57 +00:00
endif ( ${ CMAKE_SYSTEM_NAME } MATCHES "Linux" )
2013-12-10 20:17:57 +00:00
# Detect Mac OS X Version
2013-01-19 17:10:57 +00:00
if ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
set ( OperatingSystem "Mac OS X" )
2013-01-27 20:50:38 +00:00
set ( OS_IS_MACOSX TRUE )
2013-11-09 10:51:11 +00:00
exec_program ( uname ARGS -v OUTPUT_VARIABLE DARWIN_VERSION )
string ( REGEX MATCH "[0-9]+" DARWIN_VERSION ${ DARWIN_VERSION } )
2016-09-21 18:37:52 +00:00
if ( ${ DARWIN_VERSION } MATCHES "16" )
set ( MACOS_SIERRA 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 macOS Sierra 10.12" )
endif ( ${ DARWIN_VERSION } MATCHES "16" )
2015-09-08 00:16:03 +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" )
endif ( ${ DARWIN_VERSION } MATCHES "15" )
2014-10-18 07:43:44 +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" )
endif ( ${ DARWIN_VERSION } MATCHES "14" )
2013-11-09 10:51:11 +00:00
if ( ${ DARWIN_VERSION } MATCHES "13" )
set ( MACOSX_MAVERICKS TRUE )
2013-11-13 21:07:33 +00:00
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" )
2014-06-30 18:46:36 +00:00
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.9 Mavericks" )
2013-11-09 10:51:11 +00:00
endif ( ${ DARWIN_VERSION } MATCHES "13" )
2013-12-10 20:17:57 +00:00
if ( ${ DARWIN_VERSION } MATCHES "12" )
2014-06-30 18:46:36 +00:00
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.8 Mountain Lion" )
2013-12-10 20:17:57 +00:00
endif ( ${ DARWIN_VERSION } MATCHES "12" )
if ( ${ DARWIN_VERSION } MATCHES "11" )
2014-06-30 18:46:36 +00:00
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.7 Lion" )
2013-12-10 20:17:57 +00:00
endif ( ${ DARWIN_VERSION } MATCHES "11" )
if ( ${ DARWIN_VERSION } MATCHES "10" )
2014-06-30 18:46:36 +00:00
message ( STATUS "Configuring GNSS-SDR v${VERSION} to be built on Mac OS X 10.6 Snow Leopard" )
2013-12-10 20:17:57 +00:00
endif ( ${ DARWIN_VERSION } MATCHES "10" )
2013-01-19 17:10:57 +00:00
endif ( ${ CMAKE_SYSTEM_NAME } MATCHES "Darwin" )
2014-08-10 18:00:10 +00:00
2013-12-10 20:17:57 +00:00
#select the release build type by default to get optimization flags
if ( NOT CMAKE_BUILD_TYPE )
2015-05-03 08:15:51 +00:00
if ( ENABLE_GPERFTOOLS OR ENABLE_GPROF )
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
message ( STATUS "Build type not specified: defaulting to RelWithDebInfo." )
else ( ENABLE_GPERFTOOLS OR ENABLE_GPROF )
set ( CMAKE_BUILD_TYPE "Release" )
message ( STATUS "Build type not specified: defaulting to Release." )
endif ( ENABLE_GPERFTOOLS OR ENABLE_GPROF )
else ( NOT CMAKE_BUILD_TYPE )
message ( STATUS "Build type set to ${CMAKE_BUILD_TYPE}." )
2013-12-10 20:17:57 +00:00
endif ( NOT CMAKE_BUILD_TYPE )
set ( CMAKE_BUILD_TYPE ${ CMAKE_BUILD_TYPE } CACHE STRING "" )
2013-01-19 17:10:57 +00:00
2013-12-10 20:17:57 +00:00
# Append -O2 optimization flag for Debug builds
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O2" )
2013-10-01 20:32:04 +00:00
2014-10-28 00:00:04 +00:00
2014-10-27 04:19:26 +00:00
################################################################################
# Checkout cmake version
################################################################################
if ( CMAKE_VERSION VERSION_LESS 2.8.8 )
message ( STATUS "Your CMake version is too old and does not support some features required by GNSS-SDR. CMake version must be at least 2.8.8. For more information check https://github.com/joakimkarlsson/bandit/issues/40" )
message ( FATAL_ERROR "Fatal error: CMake >= 2.8.8 required." )
endif ( CMAKE_VERSION VERSION_LESS 2.8.8 )
2014-10-28 00:00:04 +00:00
2014-05-07 20:08:41 +00:00
################################################################################
# Checkout compiler version
################################################################################
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
if ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 )
2014-05-30 17:07:01 +00:00
message ( STATUS "Your GCC version is too old and does not support some C++11 features required by GNSS-SDR. GCC version must be at least 4.7" )
if ( ${ LINUX_DISTRIBUTION } MATCHES "Ubuntu" )
if ( ${ LINUX_VER } MATCHES "12.04" )
message ( STATUS "For instructions on how to upgrade GCC, check http://askubuntu.com/a/271561" )
endif ( ${ LINUX_VER } MATCHES "12.04" )
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Ubuntu" )
message ( FATAL_ERROR "Fatal error: GCC >= 4.7 required." )
2014-05-07 20:08:41 +00:00
endif ( CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7 )
endif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" )
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
2014-09-30 23:09:44 +00:00
################################################################################
# Check if the compiler defines the architecture as ARM
################################################################################
if ( NOT OS_IS_MACOSX )
include ( TestForARM )
endif ( NOT OS_IS_MACOSX )
################################################################################
# Check for availability of SSE
################################################################################
if ( NOT ENABLE_GENERIC_ARCH )
include ( TestForSSE )
endif ( NOT ENABLE_GENERIC_ARCH )
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 )
if ( EXISTS $ENV{ GTEST_DIR } )
set ( GTEST_DIR $ENV{ GTEST_DIR } )
endif ( EXISTS $ENV{ GTEST_DIR } )
if ( GTEST_DIR )
message ( STATUS "Googletest root folder set at ${GTEST_DIR}" )
find_path ( LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS ${ GTEST_DIR } )
if ( LIBGTEST_DEV_DIR )
message ( STATUS "Googletest has been found." )
else ( LIBGTEST_DEV_DIR )
message ( FATAL_ERROR " Googletest source code has not been found at ${GTEST_DIR}." )
endif ( LIBGTEST_DEV_DIR )
find_path ( GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS ${ GTEST_DIR } /include )
else ( GTEST_DIR )
find_path ( LIBGTEST_DEV_DIR NAMES src/gtest-all.cc PATHS /usr/src/gtest /opt/local/src/gtest-1.7.0 )
find_path ( GTEST_INCLUDE_DIRS NAMES gtest/gtest.h PATHS /usr/include /opt/local/src/gtest-1.7.0/include )
if ( LIBGTEST_DEV_DIR )
message ( STATUS "Googletest (libgtest-dev package) has been found." )
else ( LIBGTEST_DEV_DIR )
message ( STATUS " Googletest has not been found." )
message ( STATUS " Googletest will be downloaded and built automatically " )
message ( STATUS " when doing 'make'. " )
endif ( LIBGTEST_DEV_DIR )
endif ( GTEST_DIR )
endif ( ENABLE_UNIT_TESTING OR ENABLE_SYSTEM_TESTING )
2012-12-25 10:28:29 +00:00
2013-07-04 13:47:40 +00:00
################################################################################
# Boost - http://www.boost.org
################################################################################
if ( UNIX AND EXISTS "/usr/lib64" )
2013-12-14 10:23:33 +00:00
list ( APPEND BOOST_LIBRARYDIR "/usr/lib64" ) # Fedora 64-bit fix
2013-07-04 13:47:40 +00:00
endif ( UNIX AND EXISTS "/usr/lib64" )
set ( Boost_ADDITIONAL_VERSIONS
" 1 . 4 5 . 0 " " 1 . 4 5 " " 1 . 4 6 . 0 " " 1 . 4 6 " " 1 . 4 8 . 0 " " 1 . 4 8 " " 1 . 4 9 . 0 " " 1 . 4 9 "
" 1 . 5 0 . 0 " " 1 . 5 0 " " 1 . 5 1 . 0 " " 1 . 5 1 " " 1 . 5 3 . 0 " " 1 . 5 3 " " 1 . 5 4 . 0 " " 1 . 5 4 "
" 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 "
2013-07-04 13:47:40 +00:00
)
set ( Boost_USE_MULTITHREAD ON )
set ( Boost_USE_STATIC_LIBS OFF )
2015-03-20 16:02:41 +00:00
find_package ( Boost COMPONENTS date_time system filesystem thread serialization chrono REQUIRED )
2013-07-04 13:47:40 +00:00
if ( NOT Boost_FOUND )
2014-12-21 21:46:57 +00:00
message ( FATAL_ERROR "Fatal error: Boost (version >=1.45.0) required." )
2013-07-04 13:47:40 +00:00
endif ( NOT Boost_FOUND )
2013-01-19 17:10:57 +00:00
################################################################################
2016-05-24 15:26:34 +00:00
# GNU Radio - http://gnuradio.org
2013-01-19 17:10:57 +00:00
################################################################################
2016-02-02 22:32:48 +00:00
set ( GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS FFT FILTER PMT )
2013-12-11 23:27:46 +00:00
find_package ( Gnuradio )
2014-12-23 17:54:09 +00:00
if ( PC_GNURADIO_RUNTIME_VERSION )
if ( PC_GNURADIO_RUNTIME_VERSION VERSION_LESS 3.7.3 )
set ( GNURADIO_RUNTIME_FOUND )
message ( STATUS "The GNU Radio version installed in your system is too old." )
endif ( PC_GNURADIO_RUNTIME_VERSION VERSION_LESS 3.7.3 )
endif ( PC_GNURADIO_RUNTIME_VERSION )
2013-12-10 20:17:57 +00:00
if ( NOT GNURADIO_RUNTIME_FOUND )
2014-12-23 17:54:09 +00:00
message ( STATUS "CMake cannot find GNU Radio >= 3.7.3" )
2013-12-10 20:17:57 +00:00
if ( OS_IS_LINUX )
2016-05-24 15:26:34 +00:00
message ( "Go to https://github.com/gnuradio/pybombs" )
2013-12-10 20:17:57 +00:00
message ( "and follow the instructions to install GNU Radio in your system." )
2014-12-23 17:54:09 +00:00
message ( FATAL_ERROR "GNU Radio 3.7.3 or later is required to build gnss-sdr" )
2013-12-10 20:17:57 +00:00
endif ( OS_IS_LINUX )
if ( OS_IS_MACOSX )
2016-05-24 15:26:34 +00:00
message ( "You can install it easily via Macports:" )
message ( " sudo port install gnuradio " )
message ( "Alternatively, you can use homebrew:" )
message ( " brew tap odrisci/gnuradio" )
message ( " brew install gnuradio" )
2014-12-23 17:54:09 +00:00
message ( FATAL_ERROR "GNU Radio 3.7.3 or later is required to build gnss-sdr" )
2013-12-10 20:17:57 +00:00
endif ( OS_IS_MACOSX )
endif ( NOT GNURADIO_RUNTIME_FOUND )
2016-01-06 10:01:16 +00:00
if ( NOT GNURADIO_ANALOG_FOUND )
message ( FATAL_ERROR "*** The gnuradio-analog library v3.7.3 or later is required to build gnss-sdr" )
endif ( )
2013-07-06 02:15:09 +00:00
if ( NOT GNURADIO_BLOCKS_FOUND )
2016-01-06 10:01:16 +00:00
message ( FATAL_ERROR "*** The gnuradio-blocks library v3.7.3 or later is required to build gnss-sdr" )
2013-07-06 02:15:09 +00:00
endif ( )
if ( NOT GNURADIO_FILTER_FOUND )
2016-01-06 10:01:16 +00:00
message ( FATAL_ERROR "*** The gnuradio-filter library v3.7.3 or later is required to build gnss-sdr" )
2013-07-06 02:15:09 +00:00
endif ( )
if ( NOT GNURADIO_FFT_FOUND )
2016-01-06 10:01:16 +00:00
message ( FATAL_ERROR "*** The gnuradio-fft library v3.7.3 or later is required to build gnss-sdr" )
2013-07-06 02:15:09 +00:00
endif ( )
2016-01-06 10:01:16 +00:00
if ( NOT GNURADIO_PMT_FOUND )
message ( FATAL_ERROR "*** The gnuradio-pmt library v3.7.3 or later is required to build gnss-sdr" )
2013-07-06 02:15:09 +00:00
endif ( )
2013-01-01 11:24:42 +00:00
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
################################################################################
2014-11-14 20:42:22 +00:00
find_package ( Volk )
if ( NOT VOLK_FOUND )
message ( FATAL_ERROR "*** VOLK is required to build gnss-sdr" )
endif ( )
2013-01-01 11:24:42 +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
################################################################################
2014-11-07 19:51:01 +00:00
find_package ( VolkGnssSdr )
2014-11-14 00:40:43 +00:00
if ( ENABLE_PACKAGING )
if ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
set ( STRIP_VOLK_GNSSSDR_PROFILE "-DENABLE_STRIP=ON" )
endif ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
endif ( ENABLE_PACKAGING )
2014-11-17 19:42:50 +00:00
set ( VOLK_GNSSSDR_BUILD_COMMAND "make" )
2015-08-28 18:06:24 +00:00
if ( PYTHON_EXECUTABLE )
set ( USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}" )
endif ( PYTHON_EXECUTABLE )
2014-11-17 19:42:50 +00:00
if ( OS_IS_MACOSX )
2015-08-28 18:06:24 +00:00
if ( NOT PYTHON_EXECUTABLE )
find_file ( MAC_PYTHON python
P A T H S / o p t / l o c a l / b i n
/ u s r / l o c a l / b i n )
if ( MAC_PYTHON )
set ( USE_THIS_PYTHON "-DPYTHON_EXECUTABLE=${MAC_PYTHON}" )
endif ( MAC_PYTHON )
endif ( NOT PYTHON_EXECUTABLE )
2014-11-17 19:42:50 +00:00
if ( CMAKE_GENERATOR STREQUAL Xcode )
2015-04-30 07:18:15 +00:00
set ( VOLK_GNSSSDR_BUILD_COMMAND "xcodebuild" "-configuration" "Debug" "-target" )
2014-11-17 19:42:50 +00:00
endif ( CMAKE_GENERATOR STREQUAL Xcode )
endif ( OS_IS_MACOSX )
2014-11-07 19:51:01 +00:00
if ( NOT VOLK_GNSSSDR_FOUND )
2016-01-06 01:05:34 +00:00
message ( STATUS " volk_gnsssdr will be built along with gnss-sdr when doing 'make'" )
2016-06-16 19:07:46 +00:00
set ( CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11" )
set ( C_FLAGS "${CMAKE_C_FLAGS} -std=c11" )
2015-09-06 15:06:00 +00:00
set ( VOLK_GNSSSDR_CMAKE_ARGS -DCMAKE_C_COMPILER= ${ CMAKE_C_COMPILER }
- D C M A K E _ C X X _ C O M P I L E R = $ { C M A K E _ C X X _ C O M P I L E R }
- D C M A K E _ 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
2016-07-02 16:54:39 +00:00
- 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 }
2016-06-16 19:07:46 +00:00
- D C M A K E _ C X X _ F L A G S = $ { C X X _ F L A G S }
- D C M A K E _ C _ F L A G S = $ { C _ F L A G S }
2016-09-21 18:37:52 +00:00
$ { S T R I P _ V O L K _ G N S S S D R _ P R O F I L E }
2015-09-06 15:06:00 +00:00
$ { U S E _ T H I S _ P Y T H O N } )
2015-03-20 20:24:02 +00:00
if ( CMAKE_TOOLCHAIN_FILE )
set ( VOLK_GNSSSDR_CMAKE_ARGS ${ VOLK_GNSSSDR_CMAKE_ARGS } -DCMAKE_TOOLCHAIN_FILE= ${ CMAKE_TOOLCHAIN_FILE } )
endif ( CMAKE_TOOLCHAIN_FILE )
2014-11-07 20:44:44 +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
2015-03-20 20:24:02 +00:00
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 $ { V O L K _ G N S S S D R _ C M A K E _ A R G S }
2014-11-07 20:44:44 +00:00
D O W N L O A D _ C O M M A N D " "
U P D A T E _ C O M M A N D " "
P A T C H _ C O M M A N D " "
2014-11-17 19:42:50 +00:00
B U I L D _ C O M M A N D $ { V O L K _ G N S S S D R _ B U I L D _ C O M M A N D } 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
2014-11-07 20:44:44 +00:00
)
find_package ( ORC )
if ( NOT ORC_FOUND )
set ( ORC_LIBRARIES "" )
set ( ORC_INCLUDE_DIRS "" )
endif ( NOT ORC_FOUND )
2015-03-20 16:02:41 +00:00
2014-11-07 20:44:44 +00:00
add_library ( volk_gnsssdr UNKNOWN IMPORTED )
2014-11-17 19:42:50 +00:00
set_property ( TARGET volk_gnsssdr PROPERTY IMPORTED_LOCATION ${ CMAKE_CURRENT_BINARY_DIR } /volk_gnsssdr_module/install/lib/libvolk_gnsssdr.a )
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
2014-11-07 20:44:44 +00:00
add_custom_command ( TARGET volk_gnsssdr_module POST_BUILD
2016-07-06 18:25:39 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y $ { 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
$ { 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 )
2016-09-21 18:37:52 +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
2016-09-21 18:37:52 +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 )
2014-11-07 19:51:01 +00:00
endif ( NOT VOLK_GNSSSDR_FOUND )
2014-09-07 23:56:09 +00:00
2013-11-13 21:07:33 +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 )
2015-03-24 18:53:10 +00:00
set ( gflags_RELEASE 2.1.2 )
2013-01-01 11:24:42 +00:00
find_package ( GFlags )
2014-11-09 20:04:52 +00:00
if ( NOT GFlags_FOUND )
2013-12-20 00:11:14 +00:00
message ( STATUS " gflags library has not been found." )
message ( STATUS " gflags will be downloaded and built automatically " )
message ( STATUS " when doing 'make'. " )
2015-04-30 07:18:15 +00:00
2013-01-01 11:24:42 +00:00
ExternalProject_Add (
g f l a g s - $ { g f l a g s _ R E L E A S E }
2013-01-11 14:13:07 +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 } / g f l a g s - $ { g f l a g s _ R E L E A S E }
2015-04-30 13:16:44 +00:00
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
2015-03-24 18:53:10 +00:00
G I T _ T A G v $ { g f l a g s _ R E L E A S E }
2013-01-01 11:24:42 +00:00
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 f l a g s _ 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 } / g f l a g s - $ { g f l a g s _ R E L E A S E }
2015-03-24 18:53:10 +00:00
C M A K E _ A R G S - D B U I L D _ S H A R E D _ L I B S = O 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 }
2013-01-01 11:24:42 +00:00
B U I L D _ C O M M A N D m a k e
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 " "
)
2015-03-20 16:02:41 +00:00
set ( GFlags_INCLUDE_DIRS
2015-03-24 18:53:10 +00:00
$ { 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 f l a g s _ R E L E A S E } / 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 "
2013-01-01 11:24:42 +00:00
)
2015-03-20 16:02:41 +00:00
2013-12-20 03:02:47 +00:00
add_library ( gflags UNKNOWN IMPORTED )
2015-03-24 18:53:10 +00:00
set_property ( TARGET gflags PROPERTY IMPORTED_LOCATION ${ CMAKE_CURRENT_BINARY_DIR } /gflags- ${ gflags_RELEASE } /lib/ ${ CMAKE_FIND_LIBRARY_PREFIXES } gflags.a )
2013-12-20 03:02:47 +00:00
add_dependencies ( gflags gflags- ${ gflags_RELEASE } )
set ( GFlags_LIBS gflags )
2015-03-24 18:53:10 +00:00
file ( GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*" )
2013-01-01 11:24:42 +00:00
set ( GFlags_LIBRARY gflags- ${ gflags_RELEASE } )
2015-03-24 18:53:10 +00:00
set ( GFlags_LIBRARY_PATH ${ CMAKE_CURRENT_BINARY_DIR } /gflags- ${ gflags_RELEASE } /lib )
2013-01-01 11:24:42 +00:00
link_directories ( ${ GFlags_LIBRARY_PATH } )
2013-12-20 03:02:47 +00:00
set ( GFlags_lib ${ GFlags_LIBS } CACHE FILEPATH "Local Gflags library" )
2013-01-01 11:24:42 +00:00
set ( GFlags_LIBRARY_PATH ${ GFlags_LIBS } )
2013-12-20 03:02:47 +00:00
set ( LOCAL_GFLAGS true CACHE STRING "GFlags downloaded and built automatically" FORCE )
2014-11-09 20:04:52 +00:00
endif ( NOT GFlags_FOUND )
2013-01-01 11:24:42 +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 } )
find_package ( GLOG )
2014-12-07 11:05:38 +00:00
if ( GLOG_INCLUDE_DIRS )
set ( GLOG_FOUND ON )
endif ( GLOG_INCLUDE_DIRS )
2014-11-14 00:40:43 +00:00
endif ( NOT ${ ENABLE_OWN_GLOG } )
2015-03-24 20:44:03 +00:00
set ( glog_RELEASE 0.3.4 )
2014-11-11 22:50:38 +00:00
if ( NOT GLOG_FOUND OR ${ LOCAL_GFLAGS } )
2013-12-20 00:11:14 +00:00
message ( STATUS " glog library has not been found" )
2013-07-04 13:47:40 +00:00
if ( NOT GFlags_FOUND )
2013-12-20 00:11:14 +00:00
message ( STATUS " or it is likely not linked to gflags." )
2013-07-04 13:47:40 +00:00
endif ( NOT GFlags_FOUND )
2013-12-20 00:11:14 +00:00
message ( STATUS " glog will be downloaded and built automatically " )
message ( STATUS " when doing 'make'. " )
2014-11-09 20:04:52 +00:00
if ( NOT ${ LOCAL_GFLAGS } )
add_library ( gflags- ${ gflags_RELEASE } UNKNOWN IMPORTED )
set_property ( TARGET gflags- ${ gflags_RELEASE } PROPERTY IMPORTED_LOCATION "${GFlags_LIBS}" )
endif ( NOT ${ LOCAL_GFLAGS } )
2015-03-20 16:02:41 +00:00
2014-11-09 20:04:52 +00:00
if ( ${ LOCAL_GFLAGS } )
2014-11-11 22:50:38 +00:00
set ( TARGET_GFLAGS ${ gflags } )
2014-05-18 10:53:16 +00:00
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /tmp/configure_with_gflags
" #!/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 }
2015-03-24 18:53:10 +00:00
e x p o r t L D F L A G S = - L $ { 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 f l a g s _ R E L E A S E } / l i b
2014-05-18 10:53:16 +00:00
e x p o r t L I B S = $ { G F l a g s _ S H A R E D _ L I B S }
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 + +
2014-11-12 20:58:57 +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 l o g _ R E L E A S E } / c o n f i g u r e " )
2014-05-18 10:53:16 +00:00
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /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 l o g _ R E L E A S E }
F I L E _ P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D
G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E )
2014-11-09 20:04:52 +00:00
else ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
2014-05-18 10:53:16 +00:00
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /tmp/configure_with_gflags
2013-01-01 11:24:42 +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 }
2015-03-24 18:53:10 +00:00
e x p o r t L D F L A G S = - L $ { 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 f l a g s _ R E L E A S E } / l i b
2013-01-11 14:13:07 +00:00
e x p o r t L I B S = $ { G F l a g s _ S H A R E D _ L I B S }
2014-11-12 20:58:57 +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 l o g _ R E L E A S E } / c o n f i g u r e " )
2014-11-09 20:04:52 +00:00
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /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 l o g _ R E L E A S E }
F I L E _ P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D
G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E )
2015-03-20 16:02:41 +00:00
endif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
2014-11-09 20:04:52 +00:00
else ( ${ LOCAL_GFLAGS } )
2014-11-11 22:50:38 +00:00
set ( TARGET_GFLAGS gflags- ${ gflags_RELEASE } )
if ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
2014-11-09 20:04:52 +00:00
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /tmp/configure_with_gflags
" #!/bin/sh
e x p o r t C P P F L A G S = - I $ { G F l a g s _ I N C L U D E _ D I R S }
e x p o r t L D F L A G S = - L $ { G F l a g s _ L I B R A R Y _ D I R S }
e x p o r t L I B S = \ " $ { G F l a g s _ L I B S } - 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-11-09 20:04:52 +00:00
e x p o r t C X X = c l a n g + +
2014-11-12 20:58:57 +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 l o g _ R E L E A S E } / c o n f i g u r e " )
2014-11-09 20:04:52 +00:00
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /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 l o g _ R E L E A S E }
F I L E _ P E R M I S S I O N S O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E G R O U P _ R E A D
G R O U P _ E X E C U T E W O R L D _ R E A D W O R L D _ E X E C U T E )
2014-11-11 22:50:38 +00:00
else ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
file ( WRITE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /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 }
2015-03-24 18:53:10 +00:00
e x p o r t L D F L A G S = - L $ { 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 f l a g s _ R E L E A S E } / l i b
2014-11-09 20:04:52 +00:00
e x p o r t L I B S = $ { G F l a g s _ S H A R E D _ L I B S }
2014-11-12 20:58:57 +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 l o g _ R E L E A S E } / c o n f i g u r e " )
2014-11-11 22:50:38 +00:00
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /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 l o g _ R E L E A S E }
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
2013-07-04 13:47:40 +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 )
2015-03-20 16:02:41 +00:00
endif ( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
2014-11-09 20:04:52 +00:00
endif ( ${ LOCAL_GFLAGS } )
2013-07-04 13:47:40 +00:00
2015-03-20 16:02:41 +00:00
set ( GLOG_CONFIGURE ${ CMAKE_CURRENT_BINARY_DIR } /glog- ${ glog_RELEASE } /configure_with_gflags )
2015-03-24 20:44:03 +00:00
ExternalProject_Add (
g l o g - $ { g l o g _ R E L E A S E }
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 l o g _ 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 h u b . c o m / g o o g l e / g l o g /
G I T _ T A G v $ { g l o g _ R E L E A S 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 } / t h i r d p a r t y / g l o g / g l o g - $ { g l o g _ 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 } / g l o g - $ { g l o g _ R E L E A S E }
C O N F I G U R E _ C O M M A N D $ { G L O G _ C O N F I G U R E } - - p r e f i x = < I N S T A L L _ D I R >
B U I L D _ C O M M A N D m a k e
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 " "
)
2012-12-29 21:07:43 +00:00
# Set up variables
2015-03-20 16:02:41 +00:00
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 l o g _ R E L E A S E } / s r c /
2012-12-29 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 } / g l o g - $ { g l o g _ R E L E A S E } / s r c
)
2015-03-20 16:02:41 +00:00
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 l o g _ R E L E A S E } / . 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 . a
2012-12-29 21:07:43 +00:00
)
2013-12-20 03:02:47 +00:00
set ( LOCAL_GLOG true CACHE STRING "Glog downloaded and built automatically" FORCE )
2015-03-20 16:02:41 +00:00
else ( NOT GLOG_FOUND OR ${ LOCAL_GFLAGS } )
2014-06-20 01:34:19 +00:00
add_library ( glog- ${ glog_RELEASE } UNKNOWN IMPORTED )
set_property ( TARGET glog- ${ glog_RELEASE } PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}" )
2014-11-11 22:50:38 +00:00
endif ( NOT GLOG_FOUND OR ${ LOCAL_GFLAGS } )
2012-12-24 02:33:50 +00:00
2015-05-23 09:20:26 +00:00
if ( NOT ENABLE_LOG )
message ( STATUS "Logging is not enabled" )
add_definitions ( -DGOOGLE_STRIP_LOG=1 )
endif ( NOT ENABLE_LOG )
2013-01-11 14:13:07 +00:00
2012-12-24 02:33:50 +00:00
################################################################################
# Armadillo - http://arma.sourceforge.net/
################################################################################
2013-11-27 21:11:21 +00:00
if ( OS_IS_LINUX )
2014-08-01 10:27:11 +00:00
#############################################################################
2015-03-20 16:02:41 +00:00
# Check that LAPACK is found in the system
2014-08-01 10:27:11 +00:00
# LAPACK is required for matrix decompositions (eg. SVD) and matrix inverse.
#############################################################################
2013-12-05 18:36:45 +00:00
find_library ( LAPACK lapack )
if ( NOT LAPACK )
message ( " The LAPACK library has not been found." )
2013-11-27 21:11:21 +00:00
message ( " You can try to install it by typing:" )
2013-12-21 11:39:16 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-20 16:02:41 +00:00
message ( " sudo yum install lapack-devel" )
2013-12-30 02:11:32 +00:00
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
message ( " sudo zypper install lapack-devel" )
2013-12-10 20:17:57 +00:00
else ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-20 16:02:41 +00:00
message ( " sudo apt-get install liblapack-dev" )
2013-12-10 20:17:57 +00:00
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2013-11-27 21:11:21 +00:00
message ( FATAL_ERROR "LAPACK is required to build gnss-sdr" )
2013-12-05 18:36:45 +00:00
endif ( NOT LAPACK )
2014-08-01 10:27:11 +00:00
#############################################################################
2014-06-07 08:23:32 +00:00
# Check that BLAS is found in the system
2014-08-01 10:27:11 +00:00
# BLAS is used for matrix multiplication.
2014-08-01 11:49:55 +00:00
# Without BLAS, matrix multiplication will still work, but might be slower.
2014-08-01 10:27:11 +00:00
#############################################################################
2014-06-07 08:23:32 +00:00
find_library ( BLAS blas )
2013-12-05 18:36:45 +00:00
if ( NOT BLAS )
message ( " The BLAS library has not been found." )
2013-11-27 21:11:21 +00:00
message ( " You can try to install it by typing:" )
2013-12-10 20:17:57 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-20 16:02:41 +00:00
message ( " sudo yum install blas-devel" )
2013-12-10 20:17:57 +00:00
else ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-20 16:02:41 +00:00
message ( " sudo apt-get install libopenblas-dev" )
2013-12-10 20:17:57 +00:00
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2013-11-27 21:11:21 +00:00
message ( FATAL_ERROR "BLAS is required to build gnss-sdr" )
2013-12-05 18:36:45 +00:00
endif ( NOT BLAS )
2014-06-07 08:23:32 +00:00
#############################################
2015-03-22 10:33:28 +00:00
# Check if GFORTRAN is found in the system
2014-06-07 08:23:32 +00:00
#############################################
2013-12-05 18:36:45 +00:00
find_library ( GFORTRAN NAMES gfortran
P A T H S / u s r / l i b
2016-05-12 21:10:00 +00:00
/ u s r / l i b 6 4
2013-12-05 18:36:45 +00:00
/ u s r / l o c a l / l i b
2014-05-11 20:19:53 +00:00
/ u s r / l o c a l / l i b / i 3 8 6
2013-12-05 18:36:45 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - l i n u x - g n u
/ u s r / l i b / g c c / i 6 8 6 - l i n u x - g n u
/ u s r / l i b / g c c / i 3 8 6 - l i n u x - g n u
2013-12-11 23:27:46 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - l i n u x - g n u / 4 . 6 # Ubuntu 12.04
2013-12-10 22:46:30 +00:00
/ u s r / l i b / g c c / i 6 8 6 - l i n u x - g n u / 4 . 6
2013-12-05 18:36:45 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - l i n u x - g n u / 4 . 7
/ u s r / l i b / g c c / i 6 8 6 - l i n u x - g n u / 4 . 7
/ u s r / l i b / g c c / x 8 6 _ 6 4 - l i n u x - g n u / 4 . 8
/ u s r / l i b / g c c / i 6 8 6 - l i n u x - g n u / 4 . 8
2014-09-29 19:24:42 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - l i n u x - g n u / 4 . 9
/ u s r / l i b / g c c / i 6 8 6 - l i n u x - g n u / 4 . 9
2013-12-10 20:17:57 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - r e d h a t - l i n u x / 4 . 7 . 2 # Fedora 18
/ u s r / l i b / g c c / i 6 8 6 - r e d h a t - l i n u x / 4 . 7 . 2
/ u s r / l i b / g c c / x 8 6 _ 6 4 - r e d h a t - l i n u x / 4 . 8 . 1 # Fedora 19
2014-10-18 07:35:40 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - r e d h a t - l i n u x / 4 . 8 . 3 # Fedora 20
/ u s r / l i b / g c c / x 8 6 _ 6 4 - r e d h a t - l i n u x / 4 . 9 . 1 # Fedora 21
2013-12-10 20:17:57 +00:00
/ u s r / l i b / g c c / i 6 8 6 - r e d h a t - l i n u x / 4 . 8 . 1
2014-10-18 07:35:40 +00:00
/ u s r / l i b / g c c / i 6 8 6 - r e d h a t - l i n u x / 4 . 8 . 3
/ u s r / l i b / g c c / i 6 8 6 - r e d h a t - l i n u x / 4 . 9 . 1
2013-12-11 23:27:46 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - r e d h a t - l i n u x / 4 . 4 . 4 # CentOS 6
/ u s r / l i b / g c c / i 6 8 6 - r e d h a t - l i n u x / 4 . 4 . 4
/ u s r / l i b / g c c / x 8 6 _ 6 4 - r e d h a t - l i n u x / 4 . 8 . 2
/ u s r / l i b / g c c / i 6 8 6 - r e d h a t - l i n u x / 4 . 8 . 2
2013-12-30 02:11:32 +00:00
/ u s r / l i b / g c c / i 5 8 6 - s u s e - l i n u x / 4 . 8 # OpenSUSE 13.1
2014-10-18 07:35:40 +00:00
/ u s r / l i b / g c c / i 5 8 6 - s u s e - l i n u x / 4 . 9
2013-12-30 02:11:32 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - s u s e - l i n u x / 4 . 8
2014-10-18 07:35:40 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - s u s e - l i n u x / 4 . 9
2014-01-08 16:04:41 +00:00
/ u s r / l i b / g c c / i 4 8 6 - l i n u x - g n u # Debian 7
/ u s r / l i b / g c c / i 4 8 6 - l i n u x - g n u / 4 . 4
/ u s r / l i b / g c c / i 4 8 6 - l i n u x - g n u / 4 . 6
/ u s r / l i b / g c c / i 4 8 6 - l i n u x - g n u / 4 . 7
/ u s r / l i b / g c c / i 4 8 6 - l i n u x - g n u / 4 . 8
2014-09-29 19:24:42 +00:00
/ u s r / l i b / g c c / i 4 8 6 - l i n u x - g n u / 4 . 9
2014-12-08 12:03:01 +00:00
/ u s r / l i b / g c c / i 5 8 6 - l i n u x - g n u / 4 . 9
2014-10-18 07:35:40 +00:00
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 4 . 4 # Debian armhf
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 4 . 5
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 4 . 6
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 4 . 7
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 4 . 8
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 4 . 9
2014-12-08 12:03:01 +00:00
/ u s r / l i b / g c c / a a r c h 6 4 - l i n u x - g n u / 4 . 9 # Debian arm64
2014-12-08 18:58:45 +00:00
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i / 4 . 7 # Debian armel
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i / 4 . 9
2016-05-12 18:36:06 +00:00
/ u s r / l i b / g c c / x 8 6 _ 6 4 - l i n u x - g n u / 5
/ u s r / l i b / g c c / i 6 8 6 - l i n u x - g n u / 5
2016-05-12 21:11:51 +00:00
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i / 5
2016-09-21 18:37:52 +00:00
/ u s r / l i b / g c c / a r m - l i n u x - g n u e a b i h f / 5
2016-05-12 18:36:06 +00:00
/ u s r / l i b / g c c / a a r c h 6 4 - l i n u x - g n u / 5
2013-12-05 18:36:45 +00:00
)
if ( NOT GFORTRAN )
2015-03-22 10:33:28 +00:00
message ( STATUS "The gfortran library has not been found." )
message ( STATUS " You can try to install it by typing:" )
2013-12-10 20:17:57 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-22 10:36:40 +00:00
message ( STATUS " sudo yum install gcc-fortran" )
2013-12-30 02:11:32 +00:00
elseif ( ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" )
2015-03-22 10:36:40 +00:00
message ( STATUS " sudo zypper install gcc-fortran" )
2013-12-10 20:17:57 +00:00
else ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-22 10:36:40 +00:00
message ( STATUS " sudo apt-get install gfortran" )
2013-12-10 20:17:57 +00:00
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2013-12-05 18:36:45 +00:00
endif ( NOT GFORTRAN )
2013-11-27 21:11:21 +00:00
endif ( OS_IS_LINUX )
2012-12-24 02:33:50 +00:00
find_package ( Armadillo )
if ( NOT ARMADILLO_FOUND )
2015-03-22 10:33:28 +00:00
message ( STATUS " Armadillo has not been found." )
message ( STATUS " Armadillo will be downloaded and built automatically " )
message ( STATUS " when doing 'make'. " )
2015-03-20 16:02:41 +00:00
2016-05-25 19:17:43 +00:00
if ( CMAKE_VERSION VERSION_LESS 3.1 )
# ExternalProject in CMake > 3.1 cannot open .xz files
set ( armadillo_RELEASE 6.700.7 )
set ( armadillo_MD5 "8116185e1d7391eed3bf6c500f81b4d8" )
set ( ARMA_FILE_EXTENSION "gz" )
else ( CMAKE_VERSION VERSION_LESS 3.1 )
2016-08-20 08:44:19 +00:00
set ( armadillo_RELEASE 7.400.1 )
set ( armadillo_MD5 "27fb0b62c02bf3f9ace1edd6e100dc78" )
2016-05-25 19:17:43 +00:00
set ( ARMA_FILE_EXTENSION "xz" )
endif ( CMAKE_VERSION VERSION_LESS 3.1 )
2015-03-20 16:02:41 +00:00
2014-05-31 09:18:24 +00:00
ExternalProject_Add (
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 }
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 }
2016-05-25 19:17:43 +00:00
U R L h t t p : / / s o u r c e f o r g e . n e t / p r o j e c t s / a r m a / f i l e s / 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 } . t a r . $ { A R M A _ F I L E _ E X T E N S I O N }
2014-05-31 09:18:24 +00:00
D O W N L O A D _ D I R $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / d o w n l o a d / 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 }
2014-08-01 08:52:20 +00:00
U R L _ M D 5 $ { a r m a d i l l o _ M D 5 }
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
2014-05-31 09:18:24 +00:00
B U I L D _ I N _ S O U R C E 1
B U I L D _ C O M M A N D m a k e
2015-03-20 16:02:41 +00:00
U P D A T E _ C O M M A N D " "
2014-05-31 09:18:24 +00:00
I N S T A L L _ C O M M A N D " "
)
2013-01-03 01:48:34 +00:00
# Set up variables
ExternalProject_Get_Property ( armadillo- ${ armadillo_RELEASE } binary_dir )
2015-03-20 16:02:41 +00:00
set ( ARMADILLO_INCLUDE_DIRS ${ binary_dir } /include )
2014-06-06 22:12:50 +00:00
find_library ( LAPACK NAMES lapack HINTS /usr/lib /usr/local/lib /usr/lib64 )
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 ( OS_IS_MACOSX )
find_library ( BLAS blas )
endif ( OS_IS_MACOSX )
2014-08-01 10:27:11 +00:00
find_package ( OpenBLAS )
if ( OPENBLAS_FOUND )
2014-08-01 11:49:55 +00:00
set ( BLAS ${ OPENBLAS } )
2014-08-01 10:27:11 +00:00
endif ( OPENBLAS_FOUND )
2015-03-22 10:33:28 +00:00
if ( NOT GFORTRAN )
set ( GFORTRAN "" )
endif ( NOT GFORTRAN )
2014-08-01 10:27:11 +00:00
set ( ARMADILLO_LIBRARIES ${ BLAS } ${ LAPACK } ${ GFORTRAN } ${ binary_dir } / ${ CMAKE_FIND_LIBRARY_PREFIXES } armadillo.a )
2014-01-08 10:20:11 +00:00
set ( LOCAL_ARMADILLO true CACHE STRING "Armadillo downloaded and built automatically" FORCE )
2013-01-19 17:10:57 +00:00
# Save a copy at the thirdparty folder
file ( COPY ${ CMAKE_CURRENT_BINARY_DIR } /armadillo- ${ armadillo_RELEASE }
D E S T I N A T I O N $ { 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
)
2014-06-20 01:34:19 +00:00
else ( NOT ARMADILLO_FOUND )
2015-03-20 16:02:41 +00:00
set ( armadillo_RELEASE ${ ARMADILLO_VERSION_STRING } )
2014-06-20 01:34:19 +00:00
add_library ( armadillo- ${ armadillo_RELEASE } UNKNOWN IMPORTED )
set_property ( TARGET armadillo- ${ armadillo_RELEASE } PROPERTY IMPORTED_LOCATION "${ARMADILLO_LIBRARIES}" )
2013-01-03 01:48:34 +00:00
endif ( NOT ARMADILLO_FOUND )
2012-12-24 02:33:50 +00:00
2013-10-18 18:26:06 +00:00
2013-11-27 21:11:21 +00:00
################################################################################
2015-09-14 23:41:18 +00:00
# GnuTLS - http://www.gnutls.org/
2013-11-27 21:11:21 +00:00
################################################################################
2015-09-14 23:41:18 +00:00
find_package ( GnuTLS )
2015-10-27 19:18:48 +00:00
find_library ( GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27
2016-09-21 18:37:52 +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
2015-10-27 19:18:48 +00:00
/ 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
)
2016-09-21 18:37:52 +00:00
2015-10-27 19:18:48 +00:00
if ( NOT GNUTLS_OPENSSL_LIBRARY )
message ( STATUS "Looking for OpenSSL instead..." )
find_package ( OpenSSL )
if ( OPENSSL_FOUND )
set ( GNUTLS_INCLUDE_DIR ${ OPENSSL_INCLUDE_DIR } )
set ( GNUTLS_LIBRARIES "" )
set ( GNUTLS_OPENSSL_LIBRARY ${ OPENSSL_SSL_LIBRARY } )
else ( OPENSSL_FOUND )
message ( " The GnuTLS library with openssl compatibility enabled has not been found." )
2015-10-27 19:39:02 +00:00
message ( " You can try to install the required libraries by typing:" )
2015-10-27 19:18:48 +00:00
if ( OS_IS_LINUX )
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" )
2015-10-27 19:18:48 +00:00
else ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
message ( " sudo apt-get install libgnutls-openssl-dev" )
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
endif ( OS_IS_LINUX )
if ( OS_IS_MACOSX )
message ( " sudo port install gnutls" )
endif ( OS_IS_MACOSX )
message ( FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr" )
endif ( OPENSSL_FOUND )
endif ( NOT GNUTLS_OPENSSL_LIBRARY )
2013-11-27 21:11:21 +00:00
2013-10-18 18:26:06 +00:00
2014-11-14 20:42:22 +00:00
################################################################################
2016-02-02 22:32:48 +00:00
# USRP Hardware Driver (UHD) - OPTIONAL
2014-11-14 20:42:22 +00:00
################################################################################
find_package ( UHD )
if ( NOT UHD_FOUND )
set ( ENABLE_UHD OFF )
2016-02-02 22:32:48 +00:00
message ( STATUS " The USRP Hardware Driver (UHD) signal source will not be built," )
message ( STATUS " so all USRP-based front-ends will not be usable." )
message ( STATUS " Please check http://files.ettus.com/manual/" )
2014-11-14 20:42:22 +00:00
else ( NOT UHD_FOUND )
2016-02-02 22:54:48 +00:00
set ( GR_REQUIRED_COMPONENTS UHD )
find_package ( Gnuradio )
2014-11-14 20:42:22 +00:00
set ( ENABLE_UHD ON )
endif ( NOT UHD_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
################################################################################
2014-11-14 20:42:22 +00:00
# Doxygen - http://www.stack.nl/~dimitri/doxygen/index.html (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 )
if ( DOXYGEN_FOUND )
message ( STATUS "Doxygen found." )
message ( STATUS "You can build the documentation with 'make doc'." )
2016-05-12 17:35:55 +00:00
message ( STATUS "When done, point your browser to ${CMAKE_BINARY_DIR}/html/index.html" )
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 ( HAVE_DOT ${ DOXYGEN_DOT_FOUND } )
file ( TO_NATIVE_PATH ${ CMAKE_SOURCE_DIR } top_srcdir )
file ( TO_NATIVE_PATH ${ CMAKE_BINARY_DIR } top_builddir )
find_package ( LATEX )
if ( PDFLATEX_COMPILER )
set ( GENERATE_PDF_DOCUMENTATION "YES" )
set ( GNSSSDR_USE_MATHJAX "NO" )
else ( PDFLATEX_COMPILER )
set ( GENERATE_PDF_DOCUMENTATION "NO" )
set ( GNSSSDR_USE_MATHJAX "YES" )
endif ( PDFLATEX_COMPILER )
configure_file ( ${ CMAKE_SOURCE_DIR } /docs/doxygen/Doxyfile.in
2016-05-12 17:35:55 +00:00
$ { 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
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
@ O N L Y
)
add_custom_target ( doc
2016-05-12 17:35:55 +00:00
$ { 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 }
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
C O M M E N T " G e n e r a t i n g A P I 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
)
if ( LATEX_COMPILER )
2016-05-12 17:35:55 +00:00
message ( STATUS "'make pdfmanual' will generate a manual at ${CMAKE_BINARY_DIR}/docs/GNSS-SDR_manual.pdf" )
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
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 }
2016-05-12 17:35:55 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E c o p y r e f m a n . p d f $ { 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
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
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
2016-05-12 17:35:55 +00:00
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
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
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
)
endif ( LATEX_COMPILER )
message ( STATUS "'make doc-clean' will clean the documentation." )
add_custom_target ( doc-clean
2016-05-12 17:35:55 +00:00
C O M M A N D $ { C M A K E _ C O M M A N D } - E r e m o v e _ d i r e c t o r y $ { 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
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
C O M M E N T " C l e a n i n g d o c u m e n t a t i o n . " V E R B A T I M
)
else ( DOXYGEN_FOUND )
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" )
2015-03-20 16:02:41 +00:00
message ( " or simply by doing 'sudo yum install doxygen-latex'." )
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
else ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
2015-03-20 16:02:41 +00:00
message ( " or simply by doing 'sudo apt-get install doxygen-latex'." )
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
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "Red Hat" )
endif ( OS_IS_LINUX )
if ( OS_IS_MACOSX )
message ( STATUS " or simply by doing 'sudo port install doxygen +latex'." )
endif ( OS_IS_MACOSX )
endif ( DOXYGEN_FOUND )
###############################################################################
# OpenCL (OPTIONAL)
###############################################################################
if ( ENABLE_OPENCL )
find_package ( OpenCL )
if ( $ENV{ DISABLE_OPENCL } )
set ( DISABLE_OPENCL TRUE )
endif ( $ENV{ DISABLE_OPENCL } )
if ( DISABLE_OPENCL )
set ( OPENCL_FOUND FALSE )
else ( DISABLE_OPENCL )
if ( OPENCL_FOUND )
message ( STATUS "OpenCL has been found and will be used by some processing blocks" )
message ( STATUS "You can disable OpenCL use by doing 'cmake -DENABLE_OPENCL=OFF ../' " )
endif ( OPENCL_FOUND )
endif ( DISABLE_OPENCL )
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." )
endif ( ENABLE_GENERIC_ARCH )
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." )
endif ( NOT OPENCL_FOUND )
else ( ENABLE_OPENCL )
set ( OPENCL_FOUND FALSE )
endif ( ENABLE_OPENCL )
2015-08-25 17:01:02 +00:00
###############################################################################
# CUDA (OPTIONAL)
###############################################################################
if ( $ENV{ CUDA_GPU_ACCEL } )
message ( STATUS "CUDA_GPU_ACCEL environment variable found." )
set ( ENABLE_CUDA ON )
endif ( $ENV{ CUDA_GPU_ACCEL } )
if ( ENABLE_CUDA )
FIND_PACKAGE ( CUDA REQUIRED )
message ( STATUS "NVIDIA CUDA GPU Acceleration will be enabled." )
message ( STATUS "You can disable it with 'cmake -DENABLE_CUDA=OFF ../'" )
else ( ENABLE_CUDA )
message ( STATUS "NVIDIA CUDA GPU Acceleration will be not enabled." )
message ( STATUS "Enable it with 'cmake -DENABLE_CUDA=ON ../' to add support for GPU-based acceleration using CUDA." )
endif ( ENABLE_CUDA )
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
################################################################################
2015-07-12 11:56:49 +00:00
# GPerftools - https://github.com/gperftools/gperftools (OPTIONAL)
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_GPERFTOOLS )
find_package ( Gperftools )
if ( NOT GPERFTOOLS_FOUND )
2014-08-11 11:39:12 +00:00
message ( STATUS "Although ENABLE_GPERFTOOLS has been set to ON, GPerftools has not been found." )
message ( STATUS "Binaries will be compiled without 'tcmalloc' and 'profiler' libraries." )
2015-07-12 11:56:49 +00:00
message ( STATUS "You can install GPerftools from https://github.com/gperftools/gperftools" )
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
else ( NOT GPERFTOOLS_FOUND )
2014-08-11 11:39:12 +00:00
message ( STATUS "GPerftools libraries found." )
message ( STATUS "Binaries will be compiled with 'tcmalloc' and 'profiler' libraries." )
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
endif ( NOT GPERFTOOLS_FOUND )
endif ( ENABLE_GPERFTOOLS )
2012-12-24 11:42:23 +00:00
################################################################################
2012-12-24 02:33:50 +00:00
# Setup of optional drivers
2012-12-24 11:42:23 +00:00
################################################################################
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
if ( $ENV{ GN3S_DRIVER } )
message ( STATUS "GN3S_DRIVER environment variable found." )
set ( ENABLE_GN3S ON )
endif ( $ENV{ GN3S_DRIVER } )
if ( GN3S_DRIVER )
set ( ENABLE_GN3S ON )
endif ( GN3S_DRIVER )
if ( ENABLE_GN3S )
message ( STATUS "The GN3S driver will be compiled." )
2015-03-20 16:02:41 +00:00
message ( STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'" )
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
else ( ENABLE_GN3S )
message ( STATUS "The (optional and experimental) GN3S driver is not enabled." )
2015-03-20 16:02:41 +00:00
message ( STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle." )
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
endif ( ENABLE_GN3S )
if ( $ENV{ RAW_ARRAY_DRIVER } )
message ( STATUS "RAW_ARRAY_DRIVER environment variable found." )
set ( ENABLE_ARRAY ON )
endif ( $ENV{ RAW_ARRAY_DRIVER } )
2015-03-03 17:07:26 +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
if ( RAW_ARRAY_DRIVER )
set ( ENABLE_ARRAY ON )
endif ( RAW_ARRAY_DRIVER )
2015-03-03 17:07:26 +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
if ( ENABLE_ARRAY )
message ( STATUS "CTTC's Antenna Array front-end driver will be compiled." )
2015-03-20 16:02:41 +00:00
message ( STATUS "You can disable it with 'cmake -DENABLE_ARRAY=OFF ../'" )
2014-02-18 19:40:44 +00:00
# copy firmware to install folder
# Build project gr-dbfcttc
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
else ( ENABLE_ARRAY )
message ( STATUS "The (optional) CTTC's Antenna Array front-end driver is not enabled." )
message ( STATUS "Enable it with 'cmake -DENABLE_ARRAY=ON ../' to add support for the CTTC experimental array front-end." )
endif ( ENABLE_ARRAY )
if ( $ENV{ RTLSDR_DRIVER } )
message ( STATUS "RTLSDR_DRIVER environment variable found." )
2014-12-15 16:39:22 +00:00
set ( ENABLE_OSMOSDR ON )
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
endif ( $ENV{ RTLSDR_DRIVER } )
2015-03-03 17:07:26 +00:00
2014-12-15 16:39:22 +00:00
if ( ENABLE_OSMOSDR )
2014-12-23 21:41:28 +00:00
message ( STATUS "The driver for OsmoSDR and other front-ends (HackRF, bladeRF, Realtek's RTL2832U-based dongles, etc.) will be compiled." )
2015-03-20 16:02:41 +00:00
message ( STATUS "You can disable it with 'cmake -DENABLE_OSMOSDR=OFF ../'" )
2014-12-15 16:39:22 +00:00
else ( ENABLE_OSMOSDR )
message ( STATUS "The (optional) driver for OsmoSDR and related front-ends is not enabled." )
2014-12-23 21:41:28 +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.)" )
2014-12-15 16:39:22 +00:00
endif ( ENABLE_OSMOSDR )
2012-12-24 02:33:50 +00:00
2015-07-22 16:16:54 +00:00
2015-03-03 17:07:26 +00:00
if ( $ENV{ FLEXIBAND_DRIVER } )
message ( STATUS "FLEXIBAND_DRIVER environment variable found." )
set ( ENABLE_FLEXIBAND ON )
endif ( $ENV{ FLEXIBAND_DRIVER } )
if ( FLEXIBAND_DRIVER )
set ( ENABLE_FLEXIBAND ON )
endif ( FLEXIBAND_DRIVER )
if ( ENABLE_FLEXIBAND )
message ( STATUS "CTTC's Antenna Array front-end driver will be compiled." )
2015-03-20 16:02:41 +00:00
message ( STATUS "You can disable it with 'cmake -DENABLE_FLEXIBAND=OFF ../'" )
2015-03-03 17:07:26 +00:00
else ( ENABLE_FLEXIBAND )
message ( STATUS "The (optional) Teleorbit Flexiband front-end driver adapter is not enabled." )
message ( STATUS "Enable it with 'cmake -DENABLE_FLEXIBAND=ON ../' to add support for the Teleorbit Flexiband front-end." )
endif ( ENABLE_FLEXIBAND )
2013-10-18 18:26:06 +00:00
2012-12-24 11:20:23 +00:00
########################################################################
# Set compiler flags
########################################################################
# Enable C++11 support in GCC
# For "-std=c++0x" GCC's support for C++11 see http://gcc.gnu.org/projects/cxx0x.html
if ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
2014-12-24 10:29:16 +00:00
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -Wall -Wextra" ) #Add warning flags: For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2012-12-24 11:20:23 +00:00
endif ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
2013-07-04 13:47:40 +00:00
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2016-10-27 06:24:42 +00:00
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++" )
2013-12-21 11:11:05 +00:00
if ( CMAKE_BUILD_TYPE MATCHES "Release" )
2015-03-20 16:02:41 +00:00
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-unused-private-field" )
2013-12-21 11:11:05 +00:00
endif ( CMAKE_BUILD_TYPE MATCHES "Release" )
2013-07-04 13:47:40 +00:00
endif ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2012-12-24 11:20:23 +00:00
2013-01-24 20:04:39 +00:00
# Processor-architecture related flags
# See http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
2014-09-29 19:24:42 +00:00
if ( NOT ARCH_COMPILER_FLAGS )
if ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
if ( OS_IS_MACOSX )
set ( ARCH_COMPILER_FLAGS "-march=corei7 -mfpmath=sse" )
else ( OS_IS_MACOSX )
2014-12-09 18:34:51 +00:00
if ( NOT ${ ENABLE_GENERIC_ARCH } )
2014-09-30 22:30:07 +00:00
if ( IS_ARM ) # ARM-specific options (https://gcc.gnu.org/onlinedocs/gcc/ARM-Options.html)
if ( ARM_VERSION STREQUAL "arm" )
# Unknown arm version - try our best to detect
set ( ARCH_COMPILER_FLAGS "-mcpu=native" )
else ( ARM_VERSION STREQUAL "arm" )
set ( ARCH_COMPILER_FLAGS "-march=${ARM_VERSION}" )
endif ( ARM_VERSION STREQUAL "arm" )
else ( IS_ARM )
set ( ARCH_COMPILER_FLAGS "-march=native -mfpmath=sse" )
endif ( IS_ARM )
2014-12-09 18:34:51 +00:00
endif ( NOT ${ ENABLE_GENERIC_ARCH } )
2014-09-29 19:24:42 +00:00
endif ( OS_IS_MACOSX )
endif ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
endif ( NOT ARCH_COMPILER_FLAGS )
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} ${ARCH_COMPILER_FLAGS}" )
2012-12-25 10:28:29 +00:00
if ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
#http://gcc.gnu.org/wiki/Visibility
add_definitions ( -fvisibility=hidden )
endif ( )
Improving handling of optional processing blocks and linking libraries.
New options ENABLE_GN3S, ENABLE_RTLSDR, ENABLE_OPENCL, ENABLE_ARRAY and
ENABLE_GPERFTOOLS, all set by default to OFF. Users can enable that
features by 'cmake -DENABLE_XXX=ON ../ '. OpenCL is now not used by
default since it was giving problems in some platforms. Old variables
(RTSDR_DRIVER, GN3S_DRIVER, RAW_ARRAY_DRIVER and DISABLE_OPENCL) are
still honored and can be used in the same way, but the new ENABLE_XXX
are recommended for the sake of more uniform naming. Main CMakeFile.txt
has been rearranged, putting options first, then searching for the
required libraries, and then the optional ones. If Gperftools is enabled
and found, binaries are linked to the tcmalloc and profiler libraries,
and using the adequate flags. Fixed building in Mac OSX if Armadillo and
OpenBLAS were not installed in the system.
2014-08-07 19:04:01 +00:00
if ( ENABLE_GPERFTOOLS )
# Set GPerftools related flags if it is available
# See http://gperftools.googlecode.com/svn/trunk/README
if ( GPERFTOOLS_FOUND )
if ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
2015-03-20 16:02:41 +00:00
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free" )
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
endif ( CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32 )
if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
2015-03-20 16:02:41 +00:00
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin" )
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
endif ( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
endif ( GPERFTOOLS_FOUND )
endif ( ENABLE_GPERFTOOLS )
2012-12-24 02:33:50 +00:00
2015-05-03 08:15:51 +00:00
if ( ENABLE_GPROF )
2015-05-06 16:10:11 +00:00
#if(CMAKE_COMPILER_IS_GNUCXX)
2015-05-03 08:15:51 +00:00
set ( MY_CXX_FLAGS "${MY_CXX_FLAGS} -pg" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pg" )
set ( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -pg" )
2015-05-06 16:10:11 +00:00
#endif(CMAKE_COMPILER_IS_GNUCXX)
2015-05-03 08:15:51 +00:00
endif ( ENABLE_GPROF )
2014-11-02 14:13:44 +00:00
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${MY_CXX_FLAGS}" )
2012-12-24 11:20:23 +00:00
2015-03-20 16:02:41 +00:00
if ( OS_IS_LINUX )
2015-10-09 06:15:41 +00:00
if ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" OR ${ LINUX_DISTRIBUTION } MATCHES "ArchLinux" )
2013-12-10 20:17:57 +00:00
link_libraries ( pthread )
2015-10-09 06:15:41 +00:00
endif ( ${ LINUX_DISTRIBUTION } MATCHES "Fedora" OR ${ LINUX_DISTRIBUTION } MATCHES "openSUSE" OR ${ LINUX_DISTRIBUTION } MATCHES "ArchLinux" )
2015-03-20 16:02:41 +00:00
endif ( OS_IS_LINUX )
2013-12-10 20:17:57 +00:00
2013-07-04 13:47:40 +00:00
2013-07-10 21:07:43 +00:00
########################################################################
# Create uninstall target
########################################################################
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
2014-11-04 00:10:58 +00:00
@ O N L Y )
2013-07-10 21:07:43 +00:00
add_custom_target ( uninstall
2014-11-04 00:10:58 +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
2012-12-24 02:33:50 +00:00
########################################################################
# Add subdirectories (in order of deps)
########################################################################
add_subdirectory ( src )
2014-11-10 01:12:56 +00:00
2014-11-14 00:40:43 +00:00
if ( ENABLE_PACKAGING )
2014-11-11 22:50:38 +00:00
include ( GnssSdrPackaging )
2014-11-14 00:40:43 +00:00
endif ( ENABLE_PACKAGING )