mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-12 02:10:34 +00:00
Improving the way cmake detects GNU Radio. Switching from FindGnuradioXXX() to ConfigGnuradio.cmake. Fixed a typo in README. Tested in Mac OS X 10.9 and Ubuntu 13.10 64 bits, should work on other versions as well.
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@442 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
parent
21418835b3
commit
669910f6af
@ -66,12 +66,13 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
set(OperatingSystem "Mac OS X")
|
||||
set(OS_IS_MACOSX TRUE)
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
|
||||
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
|
||||
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)
|
||||
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")
|
||||
endif(${DARWIN_VERSION} MATCHES "13")
|
||||
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
|
||||
@ -125,36 +126,56 @@ endif(NOT Boost_FOUND)
|
||||
# GNU Radio - http://gnuradio.org/redmine/projects/gnuradio/wiki
|
||||
################################################################################
|
||||
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME PMT BLOCKS UHD ANALOG FILTER FFT VOLK FEC TRELLIS)
|
||||
|
||||
find_package(GnuradioRuntime)
|
||||
find_package(GnuradioBlocks)
|
||||
find_package(UHD)
|
||||
find_package(GnuradioUHD)
|
||||
#find_library(GnuradioAnalog) # Required at tests, added later
|
||||
find_package(GnuradioFilter)
|
||||
find_package(GnuradioFft)
|
||||
find_package(Gnuradio "3.7.0")
|
||||
find_package(Volk)
|
||||
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||
# message(FATAL_ERROR "gnuradio-runtime 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
find_package(UHD)
|
||||
|
||||
if(NOT GNURADIO_BLOCKS_FOUND)
|
||||
#message(FATAL_ERROR "gnuradio-blocks 3.7 or later is required to build gnss-sdr")
|
||||
message("*** gnuradio-blocks 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT UHD_FOUND)
|
||||
#message(FATAL_ERROR "UHD is required to build gnss-sdr")
|
||||
message("*** UHD is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT GNURADIO_UHD_FOUND)
|
||||
#message(FATAL_ERROR "gnuradio-uhd 3.7 or later is required to build gnss-sdr")
|
||||
message("*** gnuradio-uhd 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT GNURADIO_FILTER_FOUND)
|
||||
#message(FATAL_ERROR "gnuradio-filter 3.7 or later is required to build gnss-sdr")
|
||||
message("*** gnuradio-filter 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT GNURADIO_FFT_FOUND)
|
||||
#message(FATAL_ERROR "gnuradio-fft 3.7 or later is required to build gnss-sdr")
|
||||
message("*** gnuradio-fft 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT VOLK_FOUND)
|
||||
#message(FATAL_ERROR "VOLK is required to build gnss-sdr")
|
||||
message("*** VOLK is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT GNURADIO_ANALOG_FOUND)
|
||||
message("*** gnuradio-analog 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT GNURADIO_FEC_FOUND)
|
||||
message("*** gnuradio-fec 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
if(NOT GNURADIO_TRELLIS_FOUND)
|
||||
message("*** gnuradio-trellis 3.7 or later is required to build gnss-sdr")
|
||||
endif()
|
||||
|
||||
|
||||
if(NOT GNURADIO_RUNTIME_FOUND)
|
||||
message(STATUS "cmake cannot find GNU Radio >= 3.7")
|
||||
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)
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
@ -428,27 +449,6 @@ endif($ENV{RTLSDR_DRIVER} )
|
||||
|
||||
|
||||
|
||||
|
||||
########################################################################
|
||||
# Setup the include paths
|
||||
########################################################################
|
||||
|
||||
#include_directories(
|
||||
# ${Boost_INCLUDE_DIRS}
|
||||
# ${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
# ${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
# ${UHD_INCLUDE_DIRS}
|
||||
# ${GNURADIO_UHD_INCLUDE_DIRS}
|
||||
# ${GNURADIO_FILTER_INCLUDE_DIRS}
|
||||
# ${GNURADIO_FFT_INCLUDE_DIRS}
|
||||
# ${ARMADILLO_INCLUDE_DIRS}
|
||||
# ${GLOG_INCLUDE_DIRS}
|
||||
# ${GFlags_INCLUDE_DIRS}
|
||||
# ${GPERFTOOLS_INCLUDE_DIRS}
|
||||
#)
|
||||
|
||||
|
||||
|
||||
########################################################################
|
||||
# Set compiler flags
|
||||
########################################################################
|
||||
|
2
README
2
README
@ -253,7 +253,7 @@ and follow the instructions in the screen.
|
||||
|
||||
Install Macports: https://distfiles.macports.org/MacPorts/MacPorts-2.2.1-10.9-Mavericks.pkg
|
||||
|
||||
(if you are upgrading from a previous installation, please folloe the migration rules at http://trac.macports.org/wiki/Migration)
|
||||
(if you are upgrading from a previous installation, please follow the migration rules at http://trac.macports.org/wiki/Migration)
|
||||
|
||||
In a terminal, type:
|
||||
|
||||
|
@ -74,7 +74,7 @@ IF(GFlags_ROOT_DIR)
|
||||
# set up include and link directory
|
||||
include_directories(${GFlags_INCLUDE_DIRS})
|
||||
link_directories(${GFlags_LIBRARY_DIRS})
|
||||
message("gflags library found at ${GFlags_lib}")
|
||||
message(STATUS "gflags library found at ${GFlags_lib}")
|
||||
SET(GFlags_LIBS ${GFlags_lib})
|
||||
SET(GFlags_FOUND true)
|
||||
MARK_AS_ADVANCED(GFlags_INCLUDE_DIRS)
|
||||
|
@ -69,7 +69,7 @@ else(MSVC)
|
||||
endif(APPLE)
|
||||
endif(MSVC)
|
||||
|
||||
message("glog library found at ${GLOG_LIBRARIES}")
|
||||
message(STATUS "glog library found at ${GLOG_LIBRARIES}")
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
|
@ -1,6 +0,0 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(GNURADIO_ANALOG gnuradio-analog>=3.7)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_ANALOG DEFAULT_MSG GNURADIO_ANALOG_LIBRARIES GNURADIO_ANALOG_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GNURADIO_ANALOG_LIBRARIES GNURADIO_ANALOG_INCLUDE_DIRS)
|
@ -1,6 +0,0 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(GNURADIO_BLOCKS gnuradio-blocks>=3.7)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_BLOCKS DEFAULT_MSG GNURADIO_BLOCKS_LIBRARIES GNURADIO_BLOCKS_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GNURADIO_BLOCKS_LIBRARIES GNURADIO_BLOCKS_INCLUDE_DIRS)
|
@ -1,6 +0,0 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(GNURADIO_FFT gnuradio-fft>=3.7)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_FFT DEFAULT_MSG GNURADIO_FFT_LIBRARIES GNURADIO_FFT_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GNURADIO_FFT_LIBRARIES GNURADIO_FFT_INCLUDE_DIRS)
|
@ -1,6 +0,0 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(GNURADIO_FILTER gnuradio-filter>=3.7)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_FILTER DEFAULT_MSG GNURADIO_FILTER_LIBRARIES GNURADIO_FILTER_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GNURADIO_FILTER_LIBRARIES GNURADIO_FILTER_INCLUDE_DIRS)
|
@ -1,7 +0,0 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(GNURADIO_RUNTIME gnuradio-runtime>=3.7)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_RUNTIME DEFAULT_MSG GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GNURADIO_RUNTIME_LIBRARIES GNURADIO_RUNTIME_INCLUDE_DIRS)
|
||||
|
@ -1,14 +0,0 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(GNURADIO_UHD gnuradio-uhd>=3.7)
|
||||
|
||||
if(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES)
|
||||
set(GNURADIO_UHD_FOUND TRUE CACHE INTERNAL "gnuradio-uhd found")
|
||||
message(STATUS "Found gnuradio-uhd: ${GNURADIO_UHD_INCLUDE_DIRS}, ${GNURADIO_UHD_LIBRARIES}")
|
||||
else(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES)
|
||||
set(GNURADIO_UHD_FOUND FALSE CACHE INTERNAL "gnuradio-uhd found")
|
||||
message(STATUS "gnuradio-uhd not found.")
|
||||
endif(GNURADIO_UHD_INCLUDE_DIRS AND GNURADIO_UHD_LIBRARIES)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_UHD DEFAULT_MSG GNURADIO_UHD_LIBRARIES GNURADIO_UHD_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(GNURADIO_UHD_LIBRARIES GNURADIO_UHD_INCLUDE_DIRS)
|
139
cmake/Modules/GnuradioConfig.cmake
Normal file
139
cmake/Modules/GnuradioConfig.cmake
Normal file
@ -0,0 +1,139 @@
|
||||
# Copyright 2013 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is part of GNU Radio
|
||||
#
|
||||
# GNU Radio 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, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# GNU Radio 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 GNU Radio; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
# Boston, MA 02110-1301, USA.
|
||||
|
||||
INCLUDE(FindPkgConfig)
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list (all of them)
|
||||
if(NOT GR_REQUIRED_COMPONENTS)
|
||||
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT)
|
||||
endif()
|
||||
|
||||
# Allows us to use all .cmake files in this directory
|
||||
list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_CURRENT_LIST_DIR})
|
||||
|
||||
# Easily access all libraries and includes of GNU Radio
|
||||
set(GNURADIO_ALL_LIBRARIES "")
|
||||
set(GNURADIO_ALL_INCLUDE_DIRS "")
|
||||
|
||||
MACRO(LIST_CONTAINS var value)
|
||||
SET(${var})
|
||||
FOREACH(value2 ${ARGN})
|
||||
IF (${value} STREQUAL ${value2})
|
||||
SET(${var} TRUE)
|
||||
ENDIF(${value} STREQUAL ${value2})
|
||||
ENDFOREACH(value2)
|
||||
ENDMACRO(LIST_CONTAINS)
|
||||
|
||||
function(GR_MODULE EXTVAR PCNAME INCFILE LIBFILE)
|
||||
|
||||
LIST_CONTAINS(REQUIRED_MODULE ${EXTVAR} ${GR_REQUIRED_COMPONENTS})
|
||||
if(NOT REQUIRED_MODULE)
|
||||
#message("Ignoring GNU Radio Module ${EXTVAR}")
|
||||
return()
|
||||
endif()
|
||||
|
||||
message("Checking for GNU Radio Module: ${EXTVAR}")
|
||||
|
||||
# check for .pc hints
|
||||
PKG_CHECK_MODULES(PC_GNURADIO_${EXTVAR} ${PCNAME})
|
||||
|
||||
if(NOT PC_GNURADIO_${EXTVAR}_FOUND)
|
||||
set(PC_GNURADIO_${EXTVAR}_LIBRARIES ${LIBFILE})
|
||||
endif()
|
||||
|
||||
set(INCVAR_NAME "GNURADIO_${EXTVAR}_INCLUDE_DIRS")
|
||||
set(LIBVAR_NAME "GNURADIO_${EXTVAR}_LIBRARIES")
|
||||
set(PC_INCDIR ${PC_GNURADIO_${EXTVAR}_INCLUDEDIR})
|
||||
set(PC_LIBDIR ${PC_GNURADIO_${EXTVAR}_LIBDIR})
|
||||
|
||||
# look for include files
|
||||
FIND_PATH(
|
||||
${INCVAR_NAME}
|
||||
NAMES ${INCFILE}
|
||||
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
|
||||
${PC_INCDIR}
|
||||
${CMAKE_INSTALL_PREFIX}/include
|
||||
PATHS /usr/local/include
|
||||
/usr/include
|
||||
)
|
||||
|
||||
# look for libs
|
||||
foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES})
|
||||
FIND_LIBRARY(
|
||||
${LIBVAR_NAME}_${libname}
|
||||
NAMES ${libname}
|
||||
HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib
|
||||
${PC_LIBDIR}
|
||||
${CMAKE_INSTALL_PREFIX}/lib/
|
||||
${CMAKE_INSTALL_PREFIX}/lib64/
|
||||
PATHS /usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
)
|
||||
list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}})
|
||||
endforeach(libname)
|
||||
|
||||
set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE)
|
||||
|
||||
# show results
|
||||
message(" * INCLUDES=${GNURADIO_${EXTVAR}_INCLUDE_DIRS}")
|
||||
message(" * LIBS=${GNURADIO_${EXTVAR}_LIBRARIES}")
|
||||
|
||||
# append to all includes and libs list
|
||||
set(GNURADIO_ALL_INCLUDE_DIRS ${GNURADIO_ALL_INCLUDE_DIRS} ${GNURADIO_${EXTVAR}_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
set(GNURADIO_ALL_LIBRARIES ${GNURADIO_ALL_LIBRARIES} ${GNURADIO_${EXTVAR}_LIBRARIES} PARENT_SCOPE)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GNURADIO_${EXTVAR} DEFAULT_MSG GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS)
|
||||
message("GNURADIO_${EXTVAR}_FOUND = ${GNURADIO_${EXTVAR}_FOUND}")
|
||||
set(GNURADIO_${EXTVAR}_FOUND ${GNURADIO_${EXTVAR}_FOUND} PARENT_SCOPE)
|
||||
|
||||
# generate an error if the module is missing
|
||||
if(NOT GNURADIO_${EXTVAR}_FOUND)
|
||||
message(FATAL_ERROR "Required GNU Radio Component: ${EXTVAR} missing!")
|
||||
endif()
|
||||
|
||||
MARK_AS_ADVANCED(GNURADIO_${EXTVAR}_LIBRARIES GNURADIO_${EXTVAR}_INCLUDE_DIRS)
|
||||
|
||||
endfunction()
|
||||
|
||||
GR_MODULE(RUNTIME gnuradio-runtime gnuradio/top_block.h gnuradio-runtime)
|
||||
GR_MODULE(ANALOG gnuradio-analog gnuradio/analog/api.h gnuradio-analog)
|
||||
GR_MODULE(ATSC gnuradio-atsc gnuradio/atsc/api.h gnuradio-atsc)
|
||||
GR_MODULE(AUDIO gnuradio-audio gnuradio/audio/api.h gnuradio-audio)
|
||||
GR_MODULE(BLOCKS gnuradio-blocks gnuradio/blocks/api.h gnuradio-blocks)
|
||||
GR_MODULE(CHANNELS gnuradio-channels gnuradio/channels/api.h gnuradio-channels)
|
||||
GR_MODULE(DIGITAL gnuradio-digital gnuradio/digital/api.h gnuradio-digital)
|
||||
GR_MODULE(FCD gnuradio-fcd gnuradio/fcd_api.h gnuradio-fcd)
|
||||
GR_MODULE(FEC gnuradio-fec gnuradio/fec/api.h gnuradio-fec)
|
||||
GR_MODULE(FFT gnuradio-fft gnuradio/fft/api.h gnuradio-fft)
|
||||
GR_MODULE(FILTER gnuradio-filter gnuradio/filter/api.h gnuradio-filter)
|
||||
GR_MODULE(NOAA gnuradio-noaa gnuradio/noaa/api.h gnuradio-noaa)
|
||||
GR_MODULE(PAGER gnuradio-pager gnuradio/pager/api.h gnuradio-pager)
|
||||
GR_MODULE(QTGUI gnuradio-qtgui gnuradio/qtgui/api.h gnuradio-qtgui)
|
||||
GR_MODULE(TRELLIS gnuradio-trellis gnuradio/trellis/api.h gnuradio-trellis)
|
||||
GR_MODULE(UHD gnuradio-uhd gnuradio/uhd/api.h gnuradio-uhd)
|
||||
GR_MODULE(VOCODER gnuradio-vocoder gnuradio/vocoder/api.h gnuradio-vocoder)
|
||||
GR_MODULE(WAVELET gnuradio-wavelet gnuradio/wavelet/api.h gnuradio-wavelet)
|
||||
GR_MODULE(WXGUI gnuradio-wxgui gnuradio/wxgui/api.h gnuradio-wxgui)
|
||||
GR_MODULE(PMT gnuradio-runtime pmt/pmt.h gnuradio-pmt)
|
||||
|
||||
list(REMOVE_DUPLICATES GNURADIO_ALL_INCLUDE_DIRS)
|
||||
list(REMOVE_DUPLICATES GNURADIO_ALL_LIBRARIES)
|
@ -35,7 +35,6 @@ add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
|
||||
|
||||
if(OS_IS_MACOSX)
|
||||
if (MACOSX_MAVERICKS)
|
||||
link_directories( /opt/local/lib /usr/local/lib) # Not very elegant, to be fixed
|
||||
set(MAC_LIBRARIES "-stdlib=libc++ -std=c++11 -framework Accelerate")
|
||||
else(MACOSX_MAVERICKS)
|
||||
link_directories( /opt/local/lib ) # Not very elegant, to be fixed
|
||||
@ -44,7 +43,19 @@ if(OS_IS_MACOSX)
|
||||
endif(OS_IS_MACOSX)
|
||||
|
||||
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
target_link_libraries(gnss-sdr ${MAC_LIBRARIES} ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FFT_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${ARMADILLO_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
|
||||
target_link_libraries(gnss-sdr ${MAC_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FFT_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
gnss_sp_libs
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
|
||||
install(TARGETS gnss-sdr
|
||||
|
@ -76,8 +76,6 @@ else(NOT GTEST_DIR_LOCAL)
|
||||
endif(NOT GTEST_DIR_LOCAL)
|
||||
|
||||
|
||||
#find_library(GnuradioAnalog)
|
||||
|
||||
include_directories(
|
||||
${GTEST_INCLUDE_DIRECTORIES}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
@ -107,26 +105,30 @@ include_directories(
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
find_library(
|
||||
GNURADIO_ANALOG_LIBRARIES
|
||||
NAMES gnuradio-analog
|
||||
PATHS /usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
)
|
||||
|
||||
if(OS_IS_MACOSX)
|
||||
if(MACOSX_MAVERICKS)
|
||||
# Tell the linker where the libraries installed by MacPorts are
|
||||
link_directories(/opt/local/lib /usr/local/lib ) # not very elegant, to be fixed
|
||||
set(MAC_LIBRARIES "-stdlib=libc++ -std=c++11 -lgnuradio-runtime -lgnuradio-pmt -lgnuradio-blocks -lgnuradio-fft -lgnuradio-filter -lgnuradio-uhd")
|
||||
set(MAC_LIBRARIES "-stdlib=libc++ -std=c++11")
|
||||
else(MACOSX_MAVERICKS)
|
||||
link_directories( /opt/local/lib ) # not very elegant, to be fixed
|
||||
endif(MACOSX_MAVERICKS)
|
||||
endif(OS_IS_MACOSX)
|
||||
|
||||
add_executable(run_tests ${CMAKE_CURRENT_SOURCE_DIR}/test_main.cc)
|
||||
target_link_libraries(run_tests ${MAC_LIBRARIES} ${Boost_LIBRARIES} ${GFLAGS_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GNURADIO_FILTER_LIBRARIES} ${GNURADIO_ANALOG_LIBRARIES} gnss_sp_libs gnss_rx signal_generator_blocks)
|
||||
target_link_libraries(run_tests ${MAC_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GFLAGS_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${GTEST_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GNURADIO_FILTER_LIBRARIES}
|
||||
${GNURADIO_ANALOG_LIBRARIES}
|
||||
gnss_sp_libs
|
||||
gnss_rx
|
||||
signal_generator_blocks
|
||||
)
|
||||
|
||||
install(TARGETS run_tests DESTINATION ${CMAKE_SOURCE_DIR}/install)
|
||||
|
||||
@ -142,7 +144,14 @@ add_executable(control_thread_test EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/single_test_main.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/control_thread/control_message_factory_test.cc
|
||||
)
|
||||
target_link_libraries(control_thread_test ${Boost_LIBRARIES} ${GFLAGS_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx)
|
||||
target_link_libraries(control_thread_test ${Boost_LIBRARIES}
|
||||
${GFLAGS_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${GTEST_LIBRARIES}
|
||||
gnss_sp_libs
|
||||
gnss_rx
|
||||
)
|
||||
|
||||
add_test(control_thread_test control_thread_test)
|
||||
|
||||
add_executable(gnss_block_test EXCLUDE_FROM_ALL
|
||||
@ -164,7 +173,15 @@ add_executable(gnss_block_test EXCLUDE_FROM_ALL
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/file_output_filter_test.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/gnss_block/gnss_block_factory_test.cc
|
||||
)
|
||||
target_link_libraries(gnss_block_test ${Boost_LIBRARIES} ${GFLAGS_LIBS} ${GLOG_LIBRARIES} ${GTEST_LIBRARIES} gnss_sp_libs gnss_rx signal_generator_blocks)
|
||||
target_link_libraries(gnss_block_test ${Boost_LIBRARIES}
|
||||
${GFLAGS_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${GTEST_LIBRARIES}
|
||||
gnss_sp_libs
|
||||
gnss_rx
|
||||
signal_generator_blocks
|
||||
)
|
||||
|
||||
add_test(gnss_block_test gnss_block_test)
|
||||
|
||||
|
||||
|
@ -20,10 +20,9 @@
|
||||
if($ENV{RTLSDR_DRIVER})
|
||||
set(RTLSDR_DRIVER ON)
|
||||
endif($ENV{RTLSDR_DRIVER})
|
||||
|
||||
if(RTLSDR_DRIVER)
|
||||
set(FRONT_END_CAL_SOURCES
|
||||
front_end_cal.cc
|
||||
)
|
||||
set(FRONT_END_CAL_SOURCES front_end_cal.cc)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
@ -44,20 +43,35 @@ if(RTLSDR_DRIVER)
|
||||
${Boost_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(OS_IS_MACOSX)
|
||||
# Tell the linker where the libraries installed by MacPorts are
|
||||
link_directories( /opt/local/lib ) # ugly!
|
||||
endif(OS_IS_MACOSX)
|
||||
|
||||
add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES})
|
||||
target_link_libraries(front_end_cal_lib ${Boost_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${ARMADILLO_LIBRARIES} gnss_rx gnss_sp_libs)
|
||||
|
||||
target_link_libraries(front_end_cal_lib ${Boost_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
)
|
||||
|
||||
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
|
||||
|
||||
add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
target_link_libraries(front-end-cal ${GNURADIO_RUNTIME_LIBRARIES} ${GNURADIO_BLOCKS_LIBRARIES} ${Boost_LIBRARIES} ${GFlags_LIBS} ${GLOG_LIBRARIES} ${ARMADILLO_LIBRARIES} gnss_rx gnss_sp_libs front_end_cal_lib)
|
||||
|
||||
target_link_libraries(front-end-cal ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
front_end_cal_lib
|
||||
)
|
||||
|
||||
install(TARGETS front-end-cal
|
||||
DESTINATION ${CMAKE_SOURCE_DIR}/install
|
||||
)
|
||||
|
||||
endif(RTLSDR_DRIVER)
|
||||
|
Loading…
Reference in New Issue
Block a user