2014-01-07 12:55:09 +00:00
|
|
|
# Copyright (C) 2010-2014 (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})
|
2013-01-22 20:40:25 +00:00
|
|
|
message(FATAL_ERROR "Prevented in-tree build. This 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})
|
|
|
|
|
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
|
|
|
########################################################################
|
|
|
|
|
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_GN3S "Enable the use of the GN3S dongle as signal source (experimental)" OFF)
|
|
|
|
option(ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF)
|
|
|
|
option(ENABLE_RTLSDR "Enable the use of RTL dongles as signal source (experimental)" OFF)
|
|
|
|
option(ENABLE_OPENCL "Enable building of processing blocks implemented with OpenCL (experimental)" OFF)
|
|
|
|
option(ENABLE_GPERFTOOLS "Enable linking to Gperftools libraries (tcmalloc and profiler)" OFF)
|
2014-09-07 17:35:41 +00:00
|
|
|
option(ENABLE_GENERIC_ARCH "Builds a portable binary" OFF)
|
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
|
|
|
|
|
|
|
###############################
|
|
|
|
# GNSS-SDR version information
|
|
|
|
###############################
|
2014-04-10 20:05:04 +00:00
|
|
|
# Get the current working branch
|
|
|
|
execute_process(
|
|
|
|
COMMAND git rev-parse --abbrev-ref HEAD
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_BRANCH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
|
|
|
|
# Get the latest abbreviated commit hash of the working branch
|
|
|
|
execute_process(
|
|
|
|
COMMAND git log -1 --format=%h
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
|
|
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
|
|
|
)
|
|
|
|
|
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)
|
2014-09-08 14:34:16 +00:00
|
|
|
set(VERSION_INFO_MINOR_VERSION 4.git-${GIT_BRANCH}-${GIT_COMMIT_HASH})
|
2013-01-19 17:10:57 +00:00
|
|
|
set(VERSION ${VERSION_INFO_MAJOR_VERSION}.${VERSION_INFO_API_COMPAT}.${VERSION_INFO_MINOR_VERSION})
|
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
|
|
|
|
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
|
|
|
|
|
|
|
# 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
|
|
|
|
COMMAND grep DISTRIB_ID
|
|
|
|
COMMAND awk -F= "{ print $2 }"
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE LINUX_DISTRIBUTION
|
|
|
|
RESULT_VARIABLE LINUX_ID_RESULT
|
|
|
|
)
|
|
|
|
execute_process(COMMAND cat /etc/lsb-release
|
|
|
|
COMMAND grep DISTRIB_RELEASE
|
|
|
|
COMMAND awk -F= "{ print $2 }"
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE LINUX_VER
|
|
|
|
RESULT_VARIABLE LINUX_VER_RESULT
|
|
|
|
)
|
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
|
|
|
|
COMMAND grep -m1 RELEASE
|
|
|
|
COMMAND awk -F= "{ print $2 }"
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE LINUX_VER
|
|
|
|
RESULT_VARIABLE LINUX_VER_RESULT
|
|
|
|
)
|
|
|
|
endif(EXISTS "/etc/linuxmint/info")
|
|
|
|
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
|
|
|
COMMAND grep -m1 NAME
|
2013-12-10 20:17:57 +00:00
|
|
|
COMMAND awk -F= "{ print $2 }"
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE LINUX_DISTRIBUTION
|
|
|
|
RESULT_VARIABLE LINUX_ID_RESULT
|
|
|
|
)
|
|
|
|
execute_process(COMMAND cat /etc/os-release
|
|
|
|
COMMAND grep VERSION_ID
|
|
|
|
COMMAND awk -F= "{ print $2 }"
|
|
|
|
COMMAND tr "\n" " "
|
|
|
|
COMMAND sed "s/ //"
|
|
|
|
OUTPUT_VARIABLE LINUX_VER
|
|
|
|
RESULT_VARIABLE LINUX_VER_RESULT
|
|
|
|
)
|
2013-12-14 14:36:33 +00:00
|
|
|
if(${LINUX_DISTRIBUTION} MATCHES "Debian")
|
|
|
|
set(LINUX_DISTRIBUTION "Debian")
|
|
|
|
endif(${LINUX_DISTRIBUTION} MATCHES "Debian")
|
2013-12-10 20:17:57 +00:00
|
|
|
endif(EXISTS "/etc/os-release")
|
|
|
|
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")
|
|
|
|
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})
|
|
|
|
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)
|
2014-08-10 18:00:10 +00:00
|
|
|
if(ENABLE_GPERFTOOLS)
|
|
|
|
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
|
|
|
|
message(STATUS "Build type not specified: defaulting to RelWithDebInfo.")
|
|
|
|
else(ENABLE_GPERFTOOLS)
|
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
|
|
message(STATUS "Build type not specified: defaulting to Release.")
|
|
|
|
endif(ENABLE_GPERFTOOLS)
|
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-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
|
|
|
|
2012-12-25 10:28:29 +00:00
|
|
|
################################################################################
|
|
|
|
# Googletest - http://code.google.com/p/googletest/
|
|
|
|
################################################################################
|
2012-12-28 15:40:03 +00:00
|
|
|
enable_testing()
|
2014-05-28 18:24:29 +00:00
|
|
|
if(EXISTS $ENV{GTEST_DIR})
|
2014-05-07 20:08:41 +00:00
|
|
|
set(GTEST_DIR $ENV{GTEST_DIR})
|
2014-05-28 18:24:29 +00:00
|
|
|
endif(EXISTS $ENV{GTEST_DIR})
|
2012-12-25 10:28:29 +00:00
|
|
|
if(GTEST_DIR)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(STATUS "GTEST root folder at ${GTEST_DIR}")
|
2012-12-25 10:28:29 +00:00
|
|
|
else()
|
2013-12-10 20:17:57 +00:00
|
|
|
message (STATUS " Googletest has not been found because the environment variable ")
|
|
|
|
message (STATUS " GTEST_DIR is not defined.")
|
|
|
|
message (STATUS " Googletest will be downloaded and built automatically ")
|
|
|
|
message (STATUS " when doing 'make'. ")
|
2012-12-25 10:28:29 +00:00
|
|
|
endif(GTEST_DIR)
|
|
|
|
|
|
|
|
|
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")
|
2013-12-14 10:23:33 +00:00
|
|
|
if(GNURADIO_INSTALL_PREFIX)
|
|
|
|
if(EXISTS "${GNURADIO_INSTALL_PREFIX}/lib/libboost_thread-mt.so")
|
|
|
|
list(APPEND BOOST_LIBRARYDIR "${GNURADIO_INSTALL_PREFIX}/lib") # Boost installed by PyBOMBS
|
|
|
|
list(APPEND BOOST_INCLUDEDIR "${GNURADIO_INSTALL_PREFIX}/include") # Boost installed by PyBOMBS
|
|
|
|
endif(EXISTS "${GNURADIO_INSTALL_PREFIX}/lib/libboost_thread-mt.so")
|
|
|
|
endif(GNURADIO_INSTALL_PREFIX)
|
2013-07-04 13:47:40 +00:00
|
|
|
set(Boost_ADDITIONAL_VERSIONS
|
|
|
|
"1.45.0" "1.45" "1.46.0" "1.46" "1.48.0" "1.48" "1.49.0" "1.49"
|
|
|
|
"1.50.0" "1.50" "1.51.0" "1.51" "1.53.0" "1.53" "1.54.0" "1.54"
|
|
|
|
"1.55.0" "1.55" "1.56.0" "1.56" "1.57.0" "1.57" "1.58.0" "1.58" "1.59.0" "1.59"
|
|
|
|
"1.60.0" "1.60" "1.61.0" "1.61" "1.62.0" "1.62" "1.63.0" "1.63" "1.64.0" "1.64"
|
|
|
|
"1.65.0" "1.65" "1.66.0" "1.66" "1.67.0" "1.67" "1.68.0" "1.68" "1.69.0" "1.69"
|
|
|
|
)
|
|
|
|
set(Boost_USE_MULTITHREAD ON)
|
|
|
|
set(Boost_USE_STATIC_LIBS OFF)
|
|
|
|
find_package(Boost COMPONENTS date_time system filesystem thread serialization REQUIRED)
|
|
|
|
if(NOT Boost_FOUND)
|
|
|
|
message(FATAL_ERROR "Fatal error: Boost (version >=1.42.0) required.")
|
|
|
|
endif(NOT Boost_FOUND)
|
|
|
|
|
|
|
|
|
2013-01-19 17:10:57 +00:00
|
|
|
################################################################################
|
2013-01-22 19:16:23 +00:00
|
|
|
# GNU Radio - http://gnuradio.org/redmine/projects/gnuradio/wiki
|
2013-01-19 17:10:57 +00:00
|
|
|
################################################################################
|
2013-12-11 23:27:46 +00:00
|
|
|
find_package(Gnuradio)
|
2013-12-10 20:17:57 +00:00
|
|
|
if(NOT GNURADIO_RUNTIME_FOUND)
|
2014-05-07 20:08:41 +00:00
|
|
|
message(STATUS "CMake cannot find GNU Radio >= 3.7")
|
2013-12-10 20:17:57 +00:00
|
|
|
if(OS_IS_LINUX)
|
|
|
|
message("Go to http://gnuradio.org/redmine/projects/pybombs/wiki")
|
|
|
|
message("and follow the instructions to install GNU Radio in your system.")
|
|
|
|
message(FATAL_ERROR "GNU Radio 3.7 or later is required to build gnss-sdr")
|
|
|
|
endif(OS_IS_LINUX)
|
|
|
|
if(OS_IS_MACOSX)
|
|
|
|
message("You can install it easily via Macports.")
|
|
|
|
message("Open a terminal and type:")
|
|
|
|
message("sudo port install gnuradio ")
|
|
|
|
message(FATAL_ERROR "GNU Radio 3.7 or later is required to build gnss-sdr")
|
|
|
|
endif(OS_IS_MACOSX)
|
|
|
|
endif(NOT GNURADIO_RUNTIME_FOUND)
|
|
|
|
|
2013-12-11 23:27:46 +00:00
|
|
|
find_package(Volk)
|
|
|
|
find_package(UHD)
|
|
|
|
|
2013-07-06 02:15:09 +00:00
|
|
|
if(NOT GNURADIO_BLOCKS_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-blocks 3.7 or later is required to build gnss-sdr")
|
2013-07-06 02:15:09 +00:00
|
|
|
endif()
|
|
|
|
if(NOT UHD_FOUND)
|
2013-12-11 23:27:46 +00:00
|
|
|
message(FATAL_ERROR "*** UHD is required to build gnss-sdr. Please check http://code.ettus.com/redmine/ettus/projects/uhd/wiki")
|
2013-07-06 02:15:09 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GNURADIO_UHD_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-uhd 3.7 or later is required to build gnss-sdr")
|
2013-07-06 02:15:09 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GNURADIO_FILTER_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-filter 3.7 or later is required to build gnss-sdr")
|
2013-07-06 02:15:09 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GNURADIO_FFT_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-fft 3.7 or later is required to build gnss-sdr")
|
2013-07-06 02:15:09 +00:00
|
|
|
endif()
|
|
|
|
if(NOT VOLK_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** VOLK is required to build gnss-sdr")
|
2013-11-13 21:07:33 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GNURADIO_ANALOG_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-analog 3.7 or later is required to build gnss-sdr")
|
2013-11-13 21:07:33 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GNURADIO_FEC_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-fec 3.7 or later is required to build gnss-sdr")
|
2013-11-13 21:07:33 +00:00
|
|
|
endif()
|
|
|
|
if(NOT GNURADIO_TRELLIS_FOUND)
|
2013-12-10 20:17:57 +00:00
|
|
|
message(FATAL_ERROR "*** gnuradio-trellis 3.7 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
|
|
|
|
|
|
|
|
2013-11-13 21:07:33 +00:00
|
|
|
|
2013-01-01 11:24:42 +00:00
|
|
|
################################################################################
|
|
|
|
# gflags - http://code.google.com/p/gflags/
|
|
|
|
################################################################################
|
2013-07-04 13:47:40 +00:00
|
|
|
set(LOCAL_GFLAGS false CACHE STRING "GFlags installed on the system")
|
2013-07-06 02:47:50 +00:00
|
|
|
set(GFlags_ROOT_DIR false)
|
2013-01-01 11:24:42 +00:00
|
|
|
find_package(GFlags)
|
|
|
|
|
2013-12-20 03:02:47 +00:00
|
|
|
if (NOT GFlags_FOUND OR LOCAL_GLOG)
|
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'. ")
|
2013-01-01 11:24:42 +00:00
|
|
|
set(gflags_RELEASE 2.0 CACHE STRING "Local gflags release")
|
|
|
|
set(gflags_MD5 "5fd4554d2ba84bf222a2fec0870d28df")
|
2014-05-18 10:53:16 +00:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/tmp/configure_osx
|
|
|
|
"#!/bin/sh
|
|
|
|
export CXXFLAGS=\"-stdlib=libc++\"
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}/configure")
|
|
|
|
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/tmp/configure_osx
|
|
|
|
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
|
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
|
|
|
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
set(CONF_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/configure_osx)
|
|
|
|
else("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/tmp/configure_linux
|
|
|
|
"#!/bin/sh
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}/configure")
|
|
|
|
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/tmp/configure_linux
|
|
|
|
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
|
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
|
|
|
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
set(CONF_SCRIPT ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/configure_linux)
|
|
|
|
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
2013-07-04 13:47:40 +00:00
|
|
|
|
2013-01-01 11:24:42 +00:00
|
|
|
ExternalProject_Add(
|
|
|
|
gflags-${gflags_RELEASE}
|
2013-01-11 14:13:07 +00:00
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
2013-01-01 11:24:42 +00:00
|
|
|
URL http://gflags.googlecode.com/files/gflags-${gflags_RELEASE}.zip
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/gflags-${gflags_RELEASE}
|
|
|
|
URL_MD5 ${gflags_MD5}
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/gflags/gflags-${gflags_RELEASE}
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
2014-05-18 10:53:16 +00:00
|
|
|
CONFIGURE_COMMAND ${CONF_SCRIPT} --prefix=${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}
|
2013-01-01 11:24:42 +00:00
|
|
|
BUILD_COMMAND make
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
PATCH_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
set(GFlags_INCLUDE_DIRS
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/src CACHE PATH "Local Gflags headers"
|
|
|
|
)
|
2013-12-20 03:02:47 +00:00
|
|
|
|
|
|
|
add_library(gflags UNKNOWN IMPORTED)
|
|
|
|
set_property(TARGET gflags PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}gflags.a)
|
|
|
|
add_dependencies(gflags gflags-${gflags_RELEASE})
|
|
|
|
set(GFlags_LIBS gflags)
|
2013-07-06 02:47:50 +00:00
|
|
|
set(GFlags_ROOT_DIR ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE} CACHE PATH "GFlags root folder" FORCE)
|
2013-01-23 19:32:20 +00:00
|
|
|
file(GLOB GFlags_SHARED_LIBS "${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}gflags${CMAKE_SHARED_LIBRARY_SUFFIX}*")
|
2013-01-01 11:24:42 +00:00
|
|
|
set(GFlags_LIBRARY gflags-${gflags_RELEASE})
|
2013-12-20 03:02:47 +00:00
|
|
|
set(GFlags_LIBRARY_PATH ${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs )
|
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)
|
|
|
|
endif(NOT GFlags_FOUND OR LOCAL_GLOG)
|
2013-01-01 11:24:42 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
################################################################################
|
2012-12-27 21:11:50 +00:00
|
|
|
# glog - http://code.google.com/p/google-glog/
|
2012-12-24 02:33:50 +00:00
|
|
|
################################################################################
|
2012-12-29 21:07:43 +00:00
|
|
|
find_package(GLOG)
|
2014-06-20 01:34:19 +00:00
|
|
|
set(glog_RELEASE 0.3.3)
|
2013-01-01 11:24:42 +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'. ")
|
2013-02-01 17:47:01 +00:00
|
|
|
set(glog_RELEASE 0.3.3)
|
|
|
|
set(glog_MD5 "a6fd2c22f8996846e34c763422717c18")
|
2013-07-04 13:47:40 +00:00
|
|
|
if(LOCAL_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
|
|
|
|
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
|
|
|
export LDFLAGS=-L${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs
|
|
|
|
export LIBS=${GFlags_SHARED_LIBS}
|
|
|
|
export CXXFLAGS=\"-stdlib=libc++\"
|
|
|
|
export CC=clang
|
|
|
|
export CXX=clang++
|
|
|
|
../../thirdparty/glog/glog-${glog_RELEASE}/configure")
|
|
|
|
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
|
|
|
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
|
|
|
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
|
|
|
else("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
2013-01-01 11:24:42 +00:00
|
|
|
"#!/bin/sh
|
|
|
|
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
|
|
|
export LDFLAGS=-L${CMAKE_CURRENT_BINARY_DIR}/gflags-${gflags_RELEASE}/.libs
|
2013-01-11 14:13:07 +00:00
|
|
|
export LIBS=${GFlags_SHARED_LIBS}
|
|
|
|
../../thirdparty/glog/glog-${glog_RELEASE}/configure")
|
2013-01-01 11:24:42 +00:00
|
|
|
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
|
|
|
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
|
|
|
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
2014-05-18 10:53:16 +00:00
|
|
|
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
2013-01-01 11:24:42 +00:00
|
|
|
else(LOCAL_GFLAGS)
|
2013-07-04 13:47:40 +00:00
|
|
|
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
|
|
|
"#!/bin/sh
|
|
|
|
export CPPFLAGS=-I${GFlags_INCLUDE_DIRS}
|
|
|
|
export LDFLAGS=-L${GFlags_LIBRARY_DIRS}
|
|
|
|
export LIBS=${GFlags_LIBS}
|
|
|
|
../../thirdparty/glog/glog-${glog_RELEASE}/configure")
|
|
|
|
file(COPY ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/tmp/configure_with_gflags
|
|
|
|
DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ
|
|
|
|
GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
|
2013-01-01 11:24:42 +00:00
|
|
|
endif(LOCAL_GFLAGS)
|
2013-07-04 13:47:40 +00:00
|
|
|
|
|
|
|
set(GLOG_CONFIGURE ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/configure_with_gflags)
|
2014-05-18 10:53:16 +00:00
|
|
|
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
ExternalProject_Add(
|
|
|
|
glog-${glog_RELEASE}
|
|
|
|
DEPENDS gflags-${gflags_RELEASE}
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
SVN_REPOSITORY http://google-glog.googlecode.com/svn/trunk
|
|
|
|
SVN_REVISION -r "142"
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/glog-${glog_RELEASE}
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
|
|
|
BUILD_COMMAND make
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
PATCH_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
else("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
|
|
ExternalProject_Add(
|
|
|
|
glog-${glog_RELEASE}
|
|
|
|
DEPENDS gflags-${gflags_RELEASE}
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
URL http://google-glog.googlecode.com/files/glog-${glog_RELEASE}.tar.gz
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/glog-${glog_RELEASE}
|
|
|
|
URL_MD5 ${glog_MD5}
|
|
|
|
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}
|
|
|
|
CONFIGURE_COMMAND ${GLOG_CONFIGURE} --prefix=<INSTALL_DIR>
|
|
|
|
BUILD_COMMAND make
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
PATCH_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
endif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
2012-12-29 21:07:43 +00:00
|
|
|
# Set up variables
|
|
|
|
set(GLOG_INCLUDE_DIRS
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/glog/glog-${glog_RELEASE}/src/
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/src
|
|
|
|
)
|
|
|
|
set(GLOG_LIBRARIES
|
2013-01-01 11:24:42 +00:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/glog-${glog_RELEASE}/.libs/${CMAKE_FIND_LIBRARY_PREFIXES}glog.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)
|
2014-06-20 01:34:19 +00:00
|
|
|
else(NOT GLOG_FOUND OR LOCAL_GFLAGS)
|
|
|
|
add_library(glog-${glog_RELEASE} UNKNOWN IMPORTED)
|
|
|
|
set_property(TARGET glog-${glog_RELEASE} PROPERTY IMPORTED_LOCATION "${GLOG_LIBRARIES}")
|
2013-01-01 11:24:42 +00:00
|
|
|
endif(NOT GLOG_FOUND OR LOCAL_GFLAGS)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
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
|
|
|
#############################################################################
|
2014-06-07 08:23:32 +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")
|
2013-12-10 20:17:57 +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")
|
|
|
|
message(" sudo apt-get install liblapack-dev")
|
|
|
|
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")
|
|
|
|
message(" sudo yum install blas-devel")
|
|
|
|
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
2014-05-31 10:31:04 +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
|
|
|
#############################################
|
|
|
|
# Check that GFORTRAN is found in the system
|
|
|
|
#############################################
|
2013-12-05 18:36:45 +00:00
|
|
|
find_library(GFORTRAN NAMES gfortran
|
|
|
|
PATHS /usr/lib
|
|
|
|
/usr/local/lib
|
2014-05-11 20:19:53 +00:00
|
|
|
/usr/local/lib/i386
|
2013-12-05 18:36:45 +00:00
|
|
|
/usr/lib/gcc/x86_64-linux-gnu
|
|
|
|
/usr/lib/gcc/i686-linux-gnu
|
|
|
|
/usr/lib/gcc/i386-linux-gnu
|
2013-12-11 23:27:46 +00:00
|
|
|
/usr/lib/gcc/x86_64-linux-gnu/4.6 # Ubuntu 12.04
|
2013-12-10 22:46:30 +00:00
|
|
|
/usr/lib/gcc/i686-linux-gnu/4.6
|
2013-12-05 18:36:45 +00:00
|
|
|
/usr/lib/gcc/x86_64-linux-gnu/4.7
|
|
|
|
/usr/lib/gcc/i686-linux-gnu/4.7
|
|
|
|
/usr/lib/gcc/x86_64-linux-gnu/4.8
|
|
|
|
/usr/lib/gcc/i686-linux-gnu/4.8
|
2013-12-10 20:17:57 +00:00
|
|
|
/usr/lib/gcc/x86_64-redhat-linux/4.7.2 # Fedora 18
|
|
|
|
/usr/lib/gcc/i686-redhat-linux/4.7.2
|
|
|
|
/usr/lib/gcc/x86_64-redhat-linux/4.8.1 # Fedora 19
|
|
|
|
/usr/lib/gcc/i686-redhat-linux/4.8.1
|
2013-12-11 23:27:46 +00:00
|
|
|
/usr/lib/gcc/x86_64-redhat-linux/4.4.4 # CentOS 6
|
|
|
|
/usr/lib/gcc/i686-redhat-linux/4.4.4
|
|
|
|
/usr/lib/gcc/x86_64-redhat-linux/4.8.2
|
|
|
|
/usr/lib/gcc/i686-redhat-linux/4.8.2
|
2013-12-30 02:11:32 +00:00
|
|
|
/usr/lib/gcc/i586-suse-linux/4.8 # OpenSUSE 13.1
|
|
|
|
/usr/lib/gcc/x86_64-suse-linux/4.8
|
2014-01-08 16:04:41 +00:00
|
|
|
/usr/lib/gcc/i486-linux-gnu # Debian 7
|
|
|
|
/usr/lib/gcc/i486-linux-gnu/4.4
|
|
|
|
/usr/lib/gcc/i486-linux-gnu/4.6
|
|
|
|
/usr/lib/gcc/i486-linux-gnu/4.7
|
|
|
|
/usr/lib/gcc/i486-linux-gnu/4.8
|
2013-12-05 18:36:45 +00:00
|
|
|
)
|
|
|
|
if(NOT GFORTRAN)
|
|
|
|
message(" The gfortran library has not been found.")
|
2013-12-10 20:17:57 +00:00
|
|
|
message(" You can try to install it by typing:")
|
|
|
|
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
2013-12-11 23:27:46 +00:00
|
|
|
message(" sudo yum install gcc-fortran")
|
2013-12-30 02:11:32 +00:00
|
|
|
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
|
|
|
message(" sudo zypper install gcc-fortran")
|
2013-12-10 20:17:57 +00:00
|
|
|
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(" sudo apt-get install gfortran")
|
|
|
|
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
2013-12-05 18:36:45 +00:00
|
|
|
message(FATAL_ERROR "gfortran is required to build gnss-sdr")
|
|
|
|
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)
|
2013-12-14 14:36:33 +00:00
|
|
|
message (STATUS " Armadillo has not been found.")
|
|
|
|
message (STATUS " Armadillo will be downloaded and built automatically ")
|
|
|
|
message (STATUS " when doing 'make'. ")
|
2014-02-02 11:14:29 +00:00
|
|
|
# Check if the patch command is available (does not come by default on Fedora or openSUSE)
|
|
|
|
find_program(PATCH_EXECUTABLE NAME patch PATHS ENV PATH)
|
|
|
|
if(NOT PATCH_EXECUTABLE)
|
|
|
|
message(" The patch command has not been found.")
|
|
|
|
message(" You can try to install it by typing:")
|
|
|
|
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(" sudo yum install patch")
|
|
|
|
elseif(${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
|
|
|
message(" sudo zypper install patch")
|
|
|
|
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(" sudo apt-get install patch")
|
|
|
|
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(FATAL_ERROR "The patch command is required to download and build armadillo")
|
|
|
|
endif(NOT PATCH_EXECUTABLE)
|
2014-09-08 08:54:31 +00:00
|
|
|
set(armadillo_RELEASE 4.400.2)
|
|
|
|
set(armadillo_MD5 "1f7e14d14e5636286f6e001a98a1735a")
|
2014-05-31 09:18:24 +00:00
|
|
|
if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
|
|
|
set(ARMADILLO_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/armadillo_no.patch)
|
|
|
|
file(WRITE ${ARMADILLO_PATCH_FILE} "")
|
|
|
|
else(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
2014-08-01 08:52:20 +00:00
|
|
|
set(ARMADILLO_PATCH_FILE ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}/armadillo_enable_lapack.patch)
|
2014-05-31 09:18:24 +00:00
|
|
|
file(WRITE ${ARMADILLO_PATCH_FILE}
|
2014-01-07 12:55:09 +00:00
|
|
|
"12c12
|
|
|
|
< // #define ARMA_USE_LAPACK
|
2013-01-03 01:48:34 +00:00
|
|
|
---
|
2014-08-01 10:27:11 +00:00
|
|
|
> #define ARMA_USE_LAPACK
|
|
|
|
19c19
|
|
|
|
< // #define ARMA_USE_BLAS
|
|
|
|
---
|
|
|
|
> #define ARMA_USE_BLAS
|
2014-02-02 11:14:29 +00:00
|
|
|
")
|
2014-05-31 09:18:24 +00:00
|
|
|
endif(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}/armadillo-${armadillo_RELEASE}.tar.gz)
|
|
|
|
ExternalProject_Add(
|
|
|
|
armadillo-${armadillo_RELEASE}
|
|
|
|
PREFIX ${CMAKE_CURRENT_BINARY_DIR}/armadillo-${armadillo_RELEASE}
|
|
|
|
URL http://sourceforge.net/projects/arma/files/armadillo-${armadillo_RELEASE}.tar.gz
|
|
|
|
DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/download/armadillo-${armadillo_RELEASE}
|
2014-08-01 08:52:20 +00:00
|
|
|
URL_MD5 ${armadillo_MD5}
|
|
|
|
PATCH_COMMAND patch -N <BINARY_DIR>/include/armadillo_bits/config.hpp ${ARMADILLO_PATCH_FILE}
|
|
|
|
CMAKE_ARGS -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DBUILD_SHARED_LIBS=OFF
|
2014-05-31 09:18:24 +00:00
|
|
|
BUILD_IN_SOURCE 1
|
|
|
|
BUILD_COMMAND make
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
2013-01-03 01:48:34 +00:00
|
|
|
# Set up variables
|
|
|
|
ExternalProject_Get_Property(armadillo-${armadillo_RELEASE} binary_dir)
|
|
|
|
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)
|
|
|
|
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}
|
|
|
|
DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/armadillo
|
|
|
|
)
|
2014-06-20 01:34:19 +00:00
|
|
|
else(NOT ARMADILLO_FOUND)
|
|
|
|
set(armadillo_RELEASE ${ARMADILLO_VERSION_STRING})
|
|
|
|
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
|
|
|
################################################################################
|
|
|
|
# OpenSSL - http://www.openssl.org
|
|
|
|
################################################################################
|
|
|
|
find_package(OpenSSL)
|
|
|
|
if(NOT OPENSSL_FOUND)
|
|
|
|
message(" The OpenSSL library has not been found.")
|
|
|
|
message(" You can try to install it by typing:")
|
2013-12-10 20:17:57 +00:00
|
|
|
if(OS_IS_LINUX)
|
|
|
|
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(" sudo yum install openssl-devel")
|
|
|
|
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(" sudo apt-get install libssl-dev")
|
|
|
|
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
2013-11-27 21:11:21 +00:00
|
|
|
endif(OS_IS_LINUX)
|
|
|
|
if(OS_IS_MACOSX)
|
|
|
|
message(" sudo port install openssl")
|
|
|
|
endif(OS_IS_MACOSX)
|
|
|
|
message(FATAL_ERROR "OpenSSL libraries are required to build gnss-sdr")
|
|
|
|
endif(NOT OPENSSL_FOUND)
|
|
|
|
|
2013-10-18 18:26:06 +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
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# Doxygen - http://www.stack.nl/~dimitri/doxygen/index.html (OPTIONAL)
|
|
|
|
################################################################################
|
|
|
|
find_package(Doxygen)
|
|
|
|
if(DOXYGEN_FOUND)
|
|
|
|
message(STATUS "Doxygen found.")
|
|
|
|
message(STATUS "You can build the documentation with 'make doc'." )
|
|
|
|
message(STATUS "When done, point your browser to ${CMAKE_SOURCE_DIR}/html/index.html")
|
|
|
|
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
|
|
|
|
${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile
|
|
|
|
@ONLY
|
|
|
|
)
|
|
|
|
add_custom_target(doc
|
|
|
|
${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/docs/doxygen/Doxyfile
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
|
|
|
COMMENT "Generating API documentation with Doxygen." VERBATIM
|
|
|
|
)
|
|
|
|
if(LATEX_COMPILER)
|
|
|
|
message(STATUS "'make pdfmanual' will generate a manual at ${CMAKE_SOURCE_DIR}/docs/GNSS-SDR_manual.pdf")
|
|
|
|
add_custom_target(pdfmanual
|
|
|
|
COMMAND ${CMAKE_MAKE_PROGRAM}
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy refman.pdf ${CMAKE_SOURCE_DIR}/docs/GNSS-SDR_manual.pdf
|
|
|
|
COMMAND ${CMAKE_MAKE_PROGRAM} clean
|
|
|
|
DEPENDS doc
|
|
|
|
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/docs/latex
|
|
|
|
COMMENT "Generating PDF manual with Doxygen." VERBATIM
|
|
|
|
)
|
|
|
|
endif(LATEX_COMPILER)
|
|
|
|
message(STATUS "'make doc-clean' will clean the documentation.")
|
|
|
|
add_custom_target(doc-clean
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/docs/html
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_SOURCE_DIR}/docs/latex
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_SOURCE_DIR}/docs/GNSS-SDR_manual.pdf
|
|
|
|
COMMENT "Cleaning documentation." VERBATIM
|
|
|
|
)
|
|
|
|
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")
|
|
|
|
message(" or simply by doing 'sudo yum install doxygen-latex'.")
|
|
|
|
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
|
|
|
message(" or simply by doing 'sudo apt-get install doxygen-latex'.")
|
|
|
|
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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# GPerftools - http://code.google.com/p/gperftools/ (OPTIONAL)
|
|
|
|
################################################################################
|
|
|
|
|
|
|
|
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.")
|
|
|
|
message(STATUS "You can install GPerftools from http://code.google.com/p/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.")
|
|
|
|
message(STATUS "You can disable it with 'cmake -DENABLE_GN3S=OFF ../'" )
|
|
|
|
else(ENABLE_GN3S)
|
|
|
|
message(STATUS "The (optional and experimental) GN3S driver is not enabled." )
|
|
|
|
message(STATUS "Enable it with 'cmake -DENABLE_GN3S=ON ../' to add support for the GN3S dongle." )
|
|
|
|
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})
|
|
|
|
if(RAW_ARRAY_DRIVER)
|
|
|
|
set(ENABLE_ARRAY ON)
|
|
|
|
endif(RAW_ARRAY_DRIVER)
|
|
|
|
if(ENABLE_ARRAY)
|
|
|
|
message(STATUS "CTTC's Antenna Array front-end driver will be compiled." )
|
|
|
|
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." )
|
|
|
|
set(ENABLE_RTLSDR ON)
|
|
|
|
endif($ENV{RTLSDR_DRIVER})
|
|
|
|
if(RAW_ARRAY_DRIVER)
|
|
|
|
set(ENABLE_RTLSDR ON)
|
|
|
|
endif(RAW_ARRAY_DRIVER)
|
|
|
|
if(ENABLE_RTLSDR)
|
|
|
|
message(STATUS "The driver for RTL-based dongles will be compiled." )
|
|
|
|
message(STATUS "You can disable it with 'cmake -DENABLE_RTLSDR=OFF ../'" )
|
2013-07-04 13:47:40 +00:00
|
|
|
# find libosmosdr (done in src/algorithms/signal_sources/adapters)
|
|
|
|
# find gr-osmosdr (done in src/algorithms/signal_sources/adapters)
|
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_RTLSDR)
|
|
|
|
message(STATUS "The (optional) driver for RTL-based dongles is not enabled." )
|
|
|
|
message(STATUS "Enable it with 'cmake -DENABLE_RTLSDR=ON ../' to add support for Realtek's RTL2832U-based USB dongles." )
|
|
|
|
endif(ENABLE_RTLSDR)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
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)
|
2013-12-21 11:11:05 +00:00
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++0x -Wall") #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")
|
2013-10-24 22:54:15 +00:00
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -std=c++11 -stdlib=libc++ -Wno-c++11-narrowing")
|
2013-12-21 11:11:05 +00:00
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "Release")
|
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wno-unused-private-field")
|
|
|
|
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
|
|
|
|
# Change to '-mtune=generic' when building for distribution
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
2013-10-21 22:27:39 +00:00
|
|
|
if(OS_IS_MACOSX)
|
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -march=corei7 -mfpmath=sse")
|
|
|
|
else(OS_IS_MACOSX)
|
2014-09-07 17:35:41 +00:00
|
|
|
if(ENABLE_GENERIC_ARCH)
|
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -mtune=generic")
|
|
|
|
else(ENABLE_GENERIC_ARCH)
|
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -march=native -mfpmath=sse")
|
|
|
|
endif(ENABLE_GENERIC_ARCH)
|
2013-10-21 22:27:39 +00:00
|
|
|
endif(OS_IS_MACOSX)
|
2013-01-24 20:04:39 +00:00
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
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)
|
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free")
|
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -fno-builtin")
|
|
|
|
endif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
|
|
endif(GPERFTOOLS_FOUND)
|
|
|
|
endif(ENABLE_GPERFTOOLS)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2012-12-24 11:20:23 +00:00
|
|
|
list(APPEND CMAKE_CXX_FLAGS ${MY_CXX_FLAGS})
|
|
|
|
|
2013-12-10 20:17:57 +00:00
|
|
|
if(OS_IS_LINUX)
|
2013-12-30 02:11:32 +00:00
|
|
|
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
2013-12-10 20:17:57 +00:00
|
|
|
link_libraries(pthread)
|
2013-12-30 02:11:32 +00:00
|
|
|
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "openSUSE")
|
2013-12-10 20:17:57 +00:00
|
|
|
endif(OS_IS_LINUX)
|
|
|
|
|
2013-07-04 13:47:40 +00:00
|
|
|
|
2013-07-10 21:07:43 +00:00
|
|
|
########################################################################
|
|
|
|
# Create uninstall target
|
|
|
|
########################################################################
|
|
|
|
configure_file(
|
|
|
|
${CMAKE_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
|
|
|
@ONLY)
|
|
|
|
|
|
|
|
add_custom_target(uninstall
|
|
|
|
${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake
|
|
|
|
)
|
2013-07-04 13:47:40 +00:00
|
|
|
|
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)
|
|
|
|
|
2013-10-01 20:32:04 +00:00
|
|
|
|