2015-01-08 18:49:59 +00:00
|
|
|
# Copyright (C) 2012-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-28 01:55:57 +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/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Optional drivers
|
|
|
|
|
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_GN3S)
|
2012-12-27 21:11:50 +00:00
|
|
|
##############################################
|
|
|
|
# GN3S (USB dongle)
|
|
|
|
##############################################
|
|
|
|
|
|
|
|
# find_package(GrGN3S)
|
|
|
|
# if not found, build it with ExternalPackage_Add
|
|
|
|
include(ExternalProject)
|
|
|
|
ExternalProject_Add(
|
|
|
|
gr-gn3s
|
|
|
|
SOURCE_DIR ${CMAKE_SOURCE_DIR}/drivers/gr-gn3s
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../../gr-gn3s
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
PATCH_COMMAND ""
|
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set up variables
|
|
|
|
set(GRGN3S_INCLUDE_DIRS ${GRGN3S_DIR}/include ${GRGN3S_DIR} ${GRGN3S_DIR}/src)
|
|
|
|
set(GRGN3S_LIBRARIES
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/../../../../gr-gn3s/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gr-gn3s${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
|
|
|
)
|
|
|
|
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GRGN3S_LIBRARIES})
|
|
|
|
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GRGN3S_INCLUDE_DIRS})
|
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} gn3s_signal_source.cc)
|
2012-12-28 15:57:03 +00:00
|
|
|
|
|
|
|
# Copy GN3S firmware binary file to install folder
|
|
|
|
message(STATUS "Copying the GN3S firmware binary file to install folder")
|
|
|
|
file(COPY ${CMAKE_SOURCE_DIR}/firmware/GN3S_v2/bin/gn3s_firmware.ihx
|
2013-03-18 18:27:44 +00:00
|
|
|
DESTINATION ${CMAKE_SOURCE_DIR}/install/
|
2012-12-28 15:57:03 +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
|
|
|
endif(ENABLE_GN3S)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2015-03-03 17:07:26 +00:00
|
|
|
if(ENABLE_FLEXIBAND)
|
|
|
|
##############################################
|
|
|
|
# TELEORBIT FLEXIBAND FRONTEND ADAPTER
|
|
|
|
##############################################
|
|
|
|
if(OS_IS_MACOSX)
|
|
|
|
set(MACOSX_ARGS "-DCMAKE_CXX_COMPILER=/usr/bin/clang++")
|
|
|
|
endif(OS_IS_MACOSX)
|
|
|
|
find_package(teleorbit REQUIRED)
|
|
|
|
if(NOT TELEORBIT_FOUND)
|
|
|
|
message(FATAL_ERROR "Teleorbit Flexiband GNURadio driver required to build gnss-sdr with the optional FLEXIBAND adapter")
|
|
|
|
endif(NOT TELEORBIT_FOUND)
|
|
|
|
|
|
|
|
# Set up variables
|
|
|
|
set(FLEXIBAND_DRIVER_INCLUDE_DIRS
|
|
|
|
${OPT_DRIVER_INCLUDE_DIRS}
|
|
|
|
${TELEORBIT_INCLUDE_DIR}/teleorbit
|
|
|
|
)
|
|
|
|
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${TELEORBIT_LIBRARIES})
|
|
|
|
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${FLEXIBAND_DRIVER_INCLUDE_DIRS})
|
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} flexiband_signal_source.cc)
|
|
|
|
endif(ENABLE_FLEXIBAND)
|
|
|
|
|
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)
|
2014-02-17 18:53:45 +00:00
|
|
|
##############################################
|
|
|
|
# GRDBFCTTC GNSS EXPERIMENTAL ARRAY PROTOTYPE
|
|
|
|
##############################################
|
2014-03-16 20:21:21 +00:00
|
|
|
if(OS_IS_MACOSX)
|
|
|
|
set(MACOSX_ARGS "-DCMAKE_CXX_COMPILER=/usr/bin/clang++")
|
|
|
|
endif(OS_IS_MACOSX)
|
2014-02-17 18:53:45 +00:00
|
|
|
# find_package(GrDbfcttc)
|
|
|
|
# if not found, build it with ExternalPackage_Add
|
|
|
|
include(ExternalProject)
|
|
|
|
ExternalProject_Add(
|
|
|
|
gr-dbfcttc
|
|
|
|
SOURCE_DIR ${CMAKE_SOURCE_DIR}/drivers/gr-dbfcttc
|
|
|
|
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/../../../../gr-dbfcttc
|
|
|
|
UPDATE_COMMAND ""
|
|
|
|
PATCH_COMMAND ""
|
2014-03-16 20:21:21 +00:00
|
|
|
CMAKE_ARGS ${MACOSX_ARGS}
|
2014-02-17 18:53:45 +00:00
|
|
|
INSTALL_COMMAND ""
|
|
|
|
)
|
|
|
|
|
|
|
|
# Set up variables
|
2014-02-18 19:40:44 +00:00
|
|
|
set(GRDBFCTTC_INCLUDE_DIRS ${GRDBFCTTC_DIR}/include ${GRDBFCTTC_DIR} ${GRDBFCTTC_DIR}/src)
|
|
|
|
set(GRDBFCTTC_LIBRARIES
|
|
|
|
"${CMAKE_CURRENT_BINARY_DIR}/../../../../gr-dbfcttc/lib/${CMAKE_FIND_LIBRARY_PREFIXES}gnuradio-dbfcttc${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
|
|
|
)
|
|
|
|
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GRDBFCTTC_LIBRARIES})
|
|
|
|
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${GRDBFCTTC_INCLUDE_DIRS})
|
2014-02-17 18:53:45 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} raw_array_signal_source.cc)
|
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_ARRAY)
|
2012-12-27 21:11:50 +00:00
|
|
|
|
|
|
|
|
2014-12-15 16:39:22 +00:00
|
|
|
if(ENABLE_OSMOSDR)
|
2012-12-27 17:09:16 +00:00
|
|
|
################################################################################
|
|
|
|
# OsmoSDR - http://sdr.osmocom.org/trac/
|
2013-01-10 11:38:58 +00:00
|
|
|
################################################################################
|
2012-12-27 17:09:16 +00:00
|
|
|
find_package(GrOsmoSDR REQUIRED)
|
2014-12-15 16:39:22 +00:00
|
|
|
if(NOT GROSMOSDR_FOUND)
|
|
|
|
message(FATAL_ERROR "gr-osmosdr required to build gnss-sdr with the optional OSMOSDR driver")
|
|
|
|
endif(NOT GROSMOSDR_FOUND)
|
|
|
|
|
|
|
|
# set OSMO include dirs
|
|
|
|
set(OSMO_DRIVER_INCLUDE_DIRS
|
2012-12-27 17:09:16 +00:00
|
|
|
${OPT_DRIVER_INCLUDE_DIRS}
|
|
|
|
${GROSMOSDR_INCLUDE_DIR}/osmosdr
|
|
|
|
)
|
2014-12-15 16:39:22 +00:00
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} osmosdr_signal_source.cc)
|
2013-01-10 11:38:58 +00:00
|
|
|
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${GROSMOSDR_LIBRARIES})
|
2014-12-15 16:39:22 +00:00
|
|
|
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${OSMO_DRIVER_INCLUDE_DIRS})
|
|
|
|
endif(ENABLE_OSMOSDR)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2014-11-14 20:42:22 +00:00
|
|
|
if(ENABLE_UHD)
|
|
|
|
set(OPT_DRIVER_SOURCES ${OPT_DRIVER_SOURCES} uhd_signal_source.cc)
|
|
|
|
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${UHD_LIBRARIES} ${GNURADIO_UHD_LIBRARIES})
|
|
|
|
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${UHD_INCLUDE_DIRS})
|
|
|
|
endif(ENABLE_UHD)
|
|
|
|
|
|
|
|
|
2013-12-14 10:23:33 +00:00
|
|
|
set(SIGNAL_SOURCE_ADAPTER_SOURCES file_signal_source.cc
|
2014-11-14 20:42:22 +00:00
|
|
|
gen_signal_source.cc
|
2013-12-14 10:23:33 +00:00
|
|
|
nsr_file_signal_source.cc
|
2015-01-14 16:26:41 +00:00
|
|
|
spir_file_signal_source.cc
|
2013-12-14 10:23:33 +00:00
|
|
|
${OPT_DRIVER_SOURCES}
|
|
|
|
)
|
2012-12-24 02:33:50 +00:00
|
|
|
|
2013-07-04 13:47:40 +00:00
|
|
|
|
2012-12-24 02:33:50 +00:00
|
|
|
include_directories(
|
2012-12-27 17:09:16 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
|
|
${OPT_DRIVER_INCLUDE_DIRS}
|
2012-12-24 02:33:50 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
|
|
|
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
|
|
|
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
2013-10-14 16:51:47 +00:00
|
|
|
${CMAKE_SOURCE_DIR}/src/algorithms/signal_source/gnuradio_blocks
|
2013-07-04 13:47:40 +00:00
|
|
|
${GLOG_INCLUDE_DIRS}
|
2013-07-06 11:22:44 +00:00
|
|
|
${GFlags_INCLUDE_DIRS}
|
|
|
|
${Boost_INCLUDE_DIRS}
|
2013-12-15 22:27:37 +00:00
|
|
|
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
2015-02-04 01:29:38 +00:00
|
|
|
${VOLK_INCLUDE_DIRS}
|
2012-12-24 02:33:50 +00:00
|
|
|
)
|
|
|
|
|
2013-11-09 10:51:11 +00:00
|
|
|
if(ARCH_64BITS)
|
|
|
|
add_definitions(-DARCH_64BITS=1)
|
|
|
|
endif(ARCH_64BITS)
|
|
|
|
|
2014-11-05 22:26:31 +00:00
|
|
|
add_definitions(-DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}")
|
|
|
|
|
2014-06-28 01:55:57 +00:00
|
|
|
file(GLOB SIGNAL_SOURCE_ADAPTER_HEADERS "*.h")
|
|
|
|
add_library(signal_source_adapters ${SIGNAL_SOURCE_ADAPTER_SOURCES} ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
|
|
|
source_group(Headers FILES ${SIGNAL_SOURCE_ADAPTER_HEADERS})
|
2013-12-14 10:23:33 +00:00
|
|
|
target_link_libraries(signal_source_adapters signal_source_gr_blocks
|
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${GNURADIO_PMT_LIBRARIES}
|
2014-11-14 20:42:22 +00:00
|
|
|
${GNURADIO_BLOCKS_LIBRARIES}
|
2013-12-14 10:23:33 +00:00
|
|
|
${OPT_LIBRARIES}
|
|
|
|
gnss_sp_libs
|
|
|
|
)
|