mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-02-05 05:30:08 +00:00
Merge
This commit is contained in:
parent
3f21664be8
commit
ddc5f6fcf4
111
cmake/Modules/FindGFLAGS.cmake
Normal file
111
cmake/Modules/FindGFLAGS.cmake
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# - Try to find GFlags
|
||||||
|
#
|
||||||
|
# The following CMake and environment variables are optionally searched
|
||||||
|
# for defaults:
|
||||||
|
# GFLAGS_ROOT: Base directory where all GFlags components are found
|
||||||
|
#
|
||||||
|
# The following are set after configuration is done:
|
||||||
|
# GFlags_FOUND
|
||||||
|
# GFlags_INCLUDE_DIRS
|
||||||
|
# GFlags_LIBS
|
||||||
|
# GFlags_LIBRARY_DIRS
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
find_path(GFlags_ROOT_DIR
|
||||||
|
libgflags.dylib
|
||||||
|
PATHS
|
||||||
|
/opt/local/lib
|
||||||
|
/usr/local/lib
|
||||||
|
${GFLAGS_ROOT}/lib
|
||||||
|
$ENV{GFLAGS_ROOT}/lib
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
find_path(GFlags_ROOT_DIR
|
||||||
|
libgflags.so
|
||||||
|
HINTS
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/i386-gnu
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i386-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib
|
||||||
|
${GFLAGS_ROOT}/lib
|
||||||
|
$ENV{GFLAGS_ROOT}/lib
|
||||||
|
${GFLAGS_ROOT}/lib64
|
||||||
|
$ENV{GFLAGS_ROOT}/lib64
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(GFlags_ROOT_DIR)
|
||||||
|
# We are testing only a couple of files in the include directories
|
||||||
|
find_path(GFlags_INCLUDE_DIRS
|
||||||
|
gflags/gflags.h
|
||||||
|
HINTS
|
||||||
|
/opt/local/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GFlags_ROOT_DIR}/src
|
||||||
|
${GFLAGS_ROOT}/include
|
||||||
|
$ENV{GFLAGS_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# Find the libraries
|
||||||
|
set(GFlags_LIBRARY_DIRS ${GFlags_ROOT_DIR})
|
||||||
|
|
||||||
|
find_library(GFlags_lib gflags ${GFlags_LIBRARY_DIRS})
|
||||||
|
if(EXISTS ${GFlags_INCLUDE_DIRS}/gflags/gflags_gflags.h)
|
||||||
|
set(GFLAGS_GREATER_20 TRUE)
|
||||||
|
else()
|
||||||
|
set(GFLAGS_GREATER_20 FALSE)
|
||||||
|
endif()
|
||||||
|
# set up include and link directory
|
||||||
|
include_directories(${GFlags_INCLUDE_DIRS})
|
||||||
|
link_directories(${GFlags_LIBRARY_DIRS})
|
||||||
|
message(STATUS "gflags library found at ${GFlags_lib}")
|
||||||
|
set(GFlags_LIBS ${GFlags_lib})
|
||||||
|
set(GFlags_FOUND true)
|
||||||
|
mark_as_advanced(GFlags_INCLUDE_DIRS)
|
||||||
|
else()
|
||||||
|
message(STATUS "Cannot find gflags")
|
||||||
|
set(GFlags_FOUND false)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GFLAGS DEFAULT_MSG GFlags_LIBS GFlags_INCLUDE_DIRS)
|
@ -135,6 +135,16 @@
|
|||||||
/usr/lib/sparc64-linux-gnu
|
/usr/lib/sparc64-linux-gnu
|
||||||
/usr/lib/x86_64-linux-gnux32
|
/usr/lib/x86_64-linux-gnux32
|
||||||
/usr/lib/alpha-linux-gnu
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib/gcc/x86_64-linux-gnu/8 # libgfortran8
|
||||||
|
/usr/lib/gcc/aarch64-linux-gnu/8
|
||||||
|
/usr/lib/gcc/arm-linux-gnueabihf/8
|
||||||
|
/usr/lib/gcc/i686-linux-gnu/8
|
||||||
|
/usr/lib/gcc/powerpc64le-linux-gnu/8
|
||||||
|
/usr/lib/gcc/s390x-linux-gnu/8
|
||||||
|
/usr/lib/gcc/alpha-linux-gnu/8
|
||||||
|
${GFORTRAN_ROOT}/lib
|
||||||
|
$ENV{GFORTRAN_ROOT}/lib
|
||||||
)
|
)
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GFORTRAN DEFAULT_MSG GFORTRAN)
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GFORTRAN DEFAULT_MSG GFORTRAN)
|
||||||
|
@ -30,13 +30,13 @@
|
|||||||
|
|
||||||
if(NOT DEFINED GLOG_ROOT)
|
if(NOT DEFINED GLOG_ROOT)
|
||||||
set(GLOG_ROOT /usr /usr/local)
|
set(GLOG_ROOT /usr /usr/local)
|
||||||
endif (NOT DEFINED GLOG_ROOT)
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release)
|
set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/Release)
|
||||||
else(MSVC)
|
else()
|
||||||
set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib)
|
set(LIB_PATHS ${GLOG_ROOT} ${GLOG_ROOT}/lib)
|
||||||
endif(MSVC)
|
endif()
|
||||||
|
|
||||||
macro(_FIND_GLOG_LIBRARIES _var)
|
macro(_FIND_GLOG_LIBRARIES _var)
|
||||||
find_library(${_var}
|
find_library(${_var}
|
||||||
@ -68,6 +68,10 @@ macro(_FIND_GLOG_LIBRARIES _var)
|
|||||||
/usr/lib/alpha-linux-gnu
|
/usr/lib/alpha-linux-gnu
|
||||||
/usr/lib64
|
/usr/lib64
|
||||||
/usr/lib
|
/usr/lib
|
||||||
|
${GLOG_ROOT}/lib
|
||||||
|
$ENV{GLOG_ROOT}/lib
|
||||||
|
${GLOG_ROOT}/lib64
|
||||||
|
$ENV{GLOG_ROOT}/lib64
|
||||||
PATH_SUFFIXES lib
|
PATH_SUFFIXES lib
|
||||||
)
|
)
|
||||||
mark_as_advanced(${_var})
|
mark_as_advanced(${_var})
|
||||||
@ -88,7 +92,7 @@ if(MSVC)
|
|||||||
${GLOG_ROOT}/src/windows
|
${GLOG_ROOT}/src/windows
|
||||||
${GLOG_ROOT}/src/windows/glog
|
${GLOG_ROOT}/src/windows/glog
|
||||||
)
|
)
|
||||||
else(MSVC)
|
else()
|
||||||
# Linux/OS X builds
|
# Linux/OS X builds
|
||||||
find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h
|
find_path(GLOG_INCLUDE_DIR NAMES raw_logging.h
|
||||||
PATHS
|
PATHS
|
||||||
@ -96,20 +100,20 @@ else(MSVC)
|
|||||||
/usr/include/glog
|
/usr/include/glog
|
||||||
/opt/local/include/glog # default location in Macports
|
/opt/local/include/glog # default location in Macports
|
||||||
)
|
)
|
||||||
endif(MSVC)
|
endif()
|
||||||
|
|
||||||
# Find the libraries
|
# Find the libraries
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.lib)
|
_find_glog_libraries(GLOG_LIBRARIES libglog.lib)
|
||||||
else(MSVC)
|
else()
|
||||||
# Linux/OS X builds
|
# Linux/OS X builds
|
||||||
if(UNIX)
|
if(UNIX)
|
||||||
_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.so)
|
_find_glog_libraries(GLOG_LIBRARIES libglog.so)
|
||||||
endif(UNIX)
|
endif()
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
_FIND_GLOG_LIBRARIES(GLOG_LIBRARIES libglog.dylib)
|
_find_glog_libraries(GLOG_LIBRARIES libglog.dylib)
|
||||||
endif(APPLE)
|
endif()
|
||||||
endif(MSVC)
|
endif()
|
||||||
|
|
||||||
if(GLOG_FOUND)
|
if(GLOG_FOUND)
|
||||||
message(STATUS "glog library found at ${GLOG_LIBRARIES}")
|
message(STATUS "glog library found at ${GLOG_LIBRARIES}")
|
||||||
@ -117,20 +121,19 @@ endif()
|
|||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set GLOG_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
include("${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake")
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Glog DEFAULT_MSG
|
find_package_handle_standard_args(GLOG DEFAULT_MSG GLOG_LIBRARIES)
|
||||||
GLOG_LIBRARIES)
|
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR})
|
string(REGEX REPLACE "/glog$" "" VAR_WITHOUT ${GLOG_INCLUDE_DIR})
|
||||||
string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT})
|
string(REGEX REPLACE "/windows$" "" VAR_WITHOUT ${VAR_WITHOUT})
|
||||||
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}")
|
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIRS} "${VAR_WITHOUT}")
|
||||||
string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
|
string(REGEX REPLACE "/libglog.lib" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
|
||||||
else(MSVC)
|
else()
|
||||||
# Linux/OS X builds
|
# Linux/OS X builds
|
||||||
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
|
set(GLOG_INCLUDE_DIRS ${GLOG_INCLUDE_DIR})
|
||||||
string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
|
string(REGEX REPLACE "/libglog.so" "" GLOG_LIBRARIES_DIR ${GLOG_LIBRARIES})
|
||||||
endif(MSVC)
|
endif()
|
||||||
|
|
||||||
if(GLOG_FOUND)
|
if(GLOG_FOUND)
|
||||||
# _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES)
|
# _GLOG_APPEND_LIBRARIES(GLOG GLOG_LIBRARIES)
|
||||||
|
30
cmake/Modules/FindGNSSSIMULATOR.cmake
Normal file
30
cmake/Modules/FindGNSSSIMULATOR.cmake
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
find_program(SW_GENERATOR_BIN gnss_sim
|
||||||
|
PATHS /usr/bin
|
||||||
|
/usr/local/bin
|
||||||
|
/opt/local/bin
|
||||||
|
${CMAKE_INSTALL_PREFIX}/bin
|
||||||
|
${GNSSSIMULATOR_ROOT}/bin
|
||||||
|
$ENV{GNSSSIMULATOR_ROOT}/bin
|
||||||
|
PATH_SUFFIXES bin
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GNSSSIMULATOR DEFAULT_MSG SW_GENERATOR_BIN)
|
||||||
|
mark_as_advanced(SW_GENERATOR_BIN)
|
202
cmake/Modules/FindGNURADIO.cmake
Normal file
202
cmake/Modules/FindGNURADIO.cmake
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Find GNU Radio
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
# if GR_REQUIRED_COMPONENTS is not defined, it will be set to the following list
|
||||||
|
if(NOT GR_REQUIRED_COMPONENTS)
|
||||||
|
set(GR_REQUIRED_COMPONENTS RUNTIME ANALOG BLOCKS DIGITAL FFT FILTER PMT FEC TRELLIS UHD)
|
||||||
|
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()
|
||||||
|
endforeach()
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
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(STATUS "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
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
PATHS /usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
${GNURADIO_ROOT}/include
|
||||||
|
$ENV{GNURADIO_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
# look for libs
|
||||||
|
foreach(libname ${PC_GNURADIO_${EXTVAR}_LIBRARIES})
|
||||||
|
find_library(${LIBVAR_NAME}_${libname}
|
||||||
|
NAMES ${libname} ${libname}-${PC_GNURADIO_RUNTIME_VERSION}
|
||||||
|
HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib
|
||||||
|
${PC_LIBDIR}
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib64
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/lib
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/lib64
|
||||||
|
PATHS /usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/i386-gnu
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i386-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/lib
|
||||||
|
${GNURADIO_ROOT}/lib
|
||||||
|
$ENV{GNURADIO_ROOT}/lib
|
||||||
|
${GNURADIO_ROOT}/lib64
|
||||||
|
$ENV{GNURADIO_ROOT}/lib64
|
||||||
|
)
|
||||||
|
list(APPEND ${LIBVAR_NAME} ${${LIBVAR_NAME}_${libname}})
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(${LIBVAR_NAME} ${${LIBVAR_NAME}} PARENT_SCOPE)
|
||||||
|
|
||||||
|
# show results
|
||||||
|
message(STATUS " * INCLUDES=${GNURADIO_${EXTVAR}_INCLUDE_DIRS}")
|
||||||
|
message(STATUS " * 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(STATUS "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(STATUS "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(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)
|
||||||
|
|
||||||
|
# Trick to find out that GNU Radio is >= 3.7.4 if pkgconfig is not present
|
||||||
|
if(NOT PC_GNURADIO_RUNTIME_VERSION)
|
||||||
|
find_file(GNURADIO_VERSION_GREATER_THAN_373
|
||||||
|
NAMES gnuradio/blocks/tsb_vector_sink_f.h
|
||||||
|
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
PATHS /usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
${GNURADIO_ROOT}/include
|
||||||
|
$ENV{GNURADIO_ROOT}/include
|
||||||
|
)
|
||||||
|
if(GNURADIO_VERSION_GREATER_THAN_373)
|
||||||
|
set(PC_GNURADIO_RUNTIME_VERSION "3.7.4+")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_file(GNURADIO_VERSION_GREATER_THAN_38
|
||||||
|
NAMES gnuradio/filter/mmse_resampler_cc.h
|
||||||
|
HINTS $ENV{GNURADIO_RUNTIME_DIR}/include
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
PATHS /usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
${GNURADIO_ROOT}/include
|
||||||
|
$ENV{GNURADIO_ROOT}/include
|
||||||
|
)
|
||||||
|
if(GNURADIO_VERSION_GREATER_THAN_38)
|
||||||
|
set(PC_GNURADIO_RUNTIME_VERSION "3.8.0+")
|
||||||
|
endif()
|
||||||
|
endif()
|
87
cmake/Modules/FindGPERFTOOLS.cmake
Normal file
87
cmake/Modules/FindGPERFTOOLS.cmake
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Tries to find Gperftools.
|
||||||
|
#
|
||||||
|
# Usage of this module as follows:
|
||||||
|
#
|
||||||
|
# find_package(GPERFTOOLS)
|
||||||
|
#
|
||||||
|
# Variables used by this module, they can change the default behaviour and need
|
||||||
|
# to be set before calling find_package:
|
||||||
|
#
|
||||||
|
# GPERFTOOLS_ROOT Set this variable to the root installation of
|
||||||
|
# Gperftools if the module has problems finding
|
||||||
|
# the proper installation path.
|
||||||
|
#
|
||||||
|
# Variables defined by this module:
|
||||||
|
#
|
||||||
|
# GPERFTOOLS_FOUND System has Gperftools libs/headers
|
||||||
|
# GPERFTOOLS_LIBRARIES The Gperftools libraries (tcmalloc & profiler)
|
||||||
|
# GPERFTOOLS_INCLUDE_DIR The location of Gperftools headers
|
||||||
|
|
||||||
|
find_library(GPERFTOOLS_TCMALLOC
|
||||||
|
NAMES tcmalloc
|
||||||
|
HINTS ${Gperftools_ROOT_DIR}/lib
|
||||||
|
${GPERFTOOLS_ROOT}/lib
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/lib
|
||||||
|
${GPERFTOOLS_ROOT}/lib64
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(GPERFTOOLS_PROFILER
|
||||||
|
NAMES profiler
|
||||||
|
HINTS ${Gperftools_ROOT_DIR}/lib
|
||||||
|
${GPERFTOOLS_ROOT}/lib
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/lib
|
||||||
|
${GPERFTOOLS_ROOT}/lib64
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(GPERFTOOLS_TCMALLOC_AND_PROFILER
|
||||||
|
NAMES tcmalloc_and_profiler
|
||||||
|
HINTS ${Gperftools_ROOT_DIR}/lib
|
||||||
|
${GPERFTOOLS_ROOT}/lib
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/lib
|
||||||
|
${GPERFTOOLS_ROOT}/lib64
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
find_path(GPERFTOOLS_INCLUDE_DIR
|
||||||
|
NAMES gperftools/heap-profiler.h
|
||||||
|
HINTS ${Gperftools_ROOT_DIR}/include
|
||||||
|
${GPERFTOOLS_ROOT}/include
|
||||||
|
$ENV{GPERFTOOLS_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
set(GPERFTOOLS_LIBRARIES ${GPERFTOOLS_TCMALLOC_AND_PROFILER})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(
|
||||||
|
GPERFTOOLS
|
||||||
|
DEFAULT_MSG
|
||||||
|
GPERFTOOLS_LIBRARIES
|
||||||
|
GPERFTOOLS_INCLUDE_DIR
|
||||||
|
)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
Gperftools_ROOT_DIR
|
||||||
|
GPERFTOOLS_TCMALLOC
|
||||||
|
GPERFTOOLS_PROFILER
|
||||||
|
GPERFTOOLS_TCMALLOC_AND_PROFILER
|
||||||
|
GPERFTOOLS_LIBRARIES
|
||||||
|
GPERFTOOLS_INCLUDE_DIR)
|
@ -19,29 +19,31 @@
|
|||||||
# Find the native gpstk includes and library
|
# Find the native gpstk includes and library
|
||||||
# This module defines
|
# This module defines
|
||||||
# GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
|
# GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
|
||||||
# GPSTK_LIBRARIES, libraries to link against to use GPSTK.
|
|
||||||
# GPSTK_FOUND, If false, do not try to use GPSTK.
|
# GPSTK_FOUND, If false, do not try to use GPSTK.
|
||||||
# also defined, but not for general use are
|
|
||||||
# GPSTK_LIBRARY, where to find the GPSTK library.
|
# GPSTK_LIBRARY, where to find the GPSTK library.
|
||||||
|
|
||||||
FIND_PATH(GPSTK_INCLUDE_DIR Rinex3ObsBase.hpp
|
find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
|
||||||
HINTS /usr/include/gpstk
|
HINTS /usr/include
|
||||||
/usr/local/include/gpstk
|
/usr/local/include
|
||||||
/opt/local/include/gpstk )
|
/opt/local/include
|
||||||
|
${GPSTK_ROOT}/include
|
||||||
|
$ENV{GPSTK_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
SET(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
|
set(GPSTK_NAMES ${GPSTK_NAMES} gpstk libgpstk)
|
||||||
FIND_LIBRARY(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
|
|
||||||
|
find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
|
||||||
HINTS /usr/lib
|
HINTS /usr/lib
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/opt/local/lib )
|
/opt/local/lib
|
||||||
|
${GPSTK_ROOT}/lib
|
||||||
|
$ENV{GPSTK_ROOT}/lib
|
||||||
|
${GPSTK_ROOT}/lib64
|
||||||
|
$ENV{GPSTK_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set GPSTK_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(GPSTK_INCLUDE_DIR GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
||||||
IF(GPSTK_FOUND)
|
|
||||||
SET( GPSTK_LIBRARIES ${GPSTK_LIBRARY} )
|
|
||||||
ENDIF(GPSTK_FOUND)
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(GPSTK_INCLUDE_DIR GPSTK_LIBRARY)
|
|
||||||
|
56
cmake/Modules/FindGRDBFCTTC.cmake
Normal file
56
cmake/Modules/FindGRDBFCTTC.cmake
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Find GR-DBFCTTC Module
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_GR_DBFCTTC gr-dbfcttc)
|
||||||
|
|
||||||
|
find_path(
|
||||||
|
GR_DBFCTTC_INCLUDE_DIRS
|
||||||
|
NAMES dbfcttc/api.h
|
||||||
|
HINTS $ENV{GR_DBFCTTC_DIR}/include
|
||||||
|
${PC_GR_DBFCTTC_INCLUDEDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
${GRDBFCTTC_ROOT}/include
|
||||||
|
$ENV{GRDBFCTTC_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(
|
||||||
|
GR_DBFCTTC_LIBRARIES
|
||||||
|
NAMES gnuradio-dbfcttc
|
||||||
|
HINTS $ENV{GR_DBFCTTC_DIR}/lib
|
||||||
|
${PC_GR_DBFCTTC_LIBDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
${GRDBFCTTC_ROOT}/lib
|
||||||
|
$ENV{GRDBFCTTC_ROOT}/lib
|
||||||
|
${GRDBFCTTC_ROOT}/lib64
|
||||||
|
$ENV{GRDBFCTTC_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GRDBFCTTC DEFAULT_MSG GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(GR_DBFCTTC_LIBRARIES GR_DBFCTTC_INCLUDE_DIRS)
|
56
cmake/Modules/FindGRGN3S.cmake
Normal file
56
cmake/Modules/FindGRGN3S.cmake
Normal file
@ -0,0 +1,56 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Find GR-GN3S Module
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_GR_GN3S gr-gn3s)
|
||||||
|
|
||||||
|
find_path(
|
||||||
|
GR_GN3S_INCLUDE_DIRS
|
||||||
|
NAMES gn3s/gn3s_api.h
|
||||||
|
HINTS $ENV{GR_GN3S_DIR}/include
|
||||||
|
${PC_GR_GN3S_INCLUDEDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GRGN3S_ROOT}/include
|
||||||
|
$ENV{GRGN3S_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(
|
||||||
|
GR_GN3S_LIBRARIES
|
||||||
|
NAMES gr-gn3s
|
||||||
|
HINTS $ENV{GR_GN3S_DIR}/lib
|
||||||
|
${PC_GR_GN3S_LIBDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
${GRGN3S_ROOT}/lib
|
||||||
|
$ENV{GRGN3S_ROOT}/lib
|
||||||
|
${GRGN3S_ROOT}/lib64
|
||||||
|
$ENV{GRGN3S_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)
|
72
cmake/Modules/FindGRIIO.cmake
Normal file
72
cmake/Modules/FindGRIIO.cmake
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_IIO gnuradio-iio)
|
||||||
|
|
||||||
|
find_path(IIO_INCLUDE_DIRS
|
||||||
|
NAMES gnuradio/iio/api.h
|
||||||
|
HINTS $ENV{IIO_DIR}/include
|
||||||
|
${PC_IIO_INCLUDEDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GRIIO_ROOT}/include
|
||||||
|
$ENV{GRIIO_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(IIO_LIBRARIES
|
||||||
|
NAMES gnuradio-iio
|
||||||
|
HINTS $ENV{IIO_DIR}/lib
|
||||||
|
${PC_IIO_LIBDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/i686-gnu
|
||||||
|
/usr/lib/i686-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i686-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
${GRIIO_ROOT}/lib
|
||||||
|
$ENV{GRIIO_ROOT}/lib
|
||||||
|
${GRIIO_ROOT}/lib64
|
||||||
|
$ENV{GRIIO_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GRIIO DEFAULT_MSG IIO_LIBRARIES IIO_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(IIO_LIBRARIES IIO_INCLUDE_DIRS)
|
92
cmake/Modules/FindGROSMOSDR.cmake
Normal file
92
cmake/Modules/FindGROSMOSDR.cmake
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Tries to find gr-osmosdr.
|
||||||
|
#
|
||||||
|
# Usage of this module as follows:
|
||||||
|
#
|
||||||
|
# find_package(GROSMOSDR)
|
||||||
|
#
|
||||||
|
# Variables used by this module, they can change the default behaviour and need
|
||||||
|
# to be set before calling find_package:
|
||||||
|
#
|
||||||
|
# GrOsmoSDR_ROOT_DIR Set this variable to the root installation of
|
||||||
|
# gr-osmosdr if the module has problems finding
|
||||||
|
# the proper installation path.
|
||||||
|
#
|
||||||
|
# Variables defined by this module:
|
||||||
|
#
|
||||||
|
# GROSMOSDR_FOUND System has gr-osmosdr libs/headers
|
||||||
|
# GROSMOSDR_LIBRARIES The gr-osmosdr libraries (gnuradio-osmosdr)
|
||||||
|
# GROSMOSDR_INCLUDE_DIR The location of gr-osmosdr headers
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(GROSMOSDR_PKG gnuradio-osmosdr)
|
||||||
|
|
||||||
|
find_path(GROSMOSDR_INCLUDE_DIR
|
||||||
|
NAMES
|
||||||
|
osmosdr/source.h
|
||||||
|
osmosdr/api.h
|
||||||
|
PATHS
|
||||||
|
${GROSMOSDR_PKG_INCLUDE_DIRS}
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
/opt/local/include
|
||||||
|
${GROSMOSDR_ROOT}/include
|
||||||
|
$ENV{GROSMOSDR_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(GROSMOSDR_LIBRARIES
|
||||||
|
NAMES gnuradio-osmosdr
|
||||||
|
PATHS
|
||||||
|
${GROSMOSDR_PKG_LIBRARY_DIRS}
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/i386-gnu
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i386-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib64
|
||||||
|
${GROSMOSDR_ROOT}/lib
|
||||||
|
$ENV{GROSMOSDR_ROOT}/lib
|
||||||
|
${GROSMOSDR_ROOT}/lib64
|
||||||
|
$ENV{GROSMOSDR_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(GROSMOSDR DEFAULT_MSG GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
|
||||||
|
mark_as_advanced(GROSMOSDR_LIBRARIES GROSMOSDR_INCLUDE_DIR)
|
76
cmake/Modules/FindLIBIIO.cmake
Normal file
76
cmake/Modules/FindLIBIIO.cmake
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_LIBIIO libiio)
|
||||||
|
|
||||||
|
find_path(
|
||||||
|
LIBIIO_INCLUDE_DIRS
|
||||||
|
NAMES iio.h
|
||||||
|
HINTS $ENV{LIBIIO_DIR}/include
|
||||||
|
${PC_LIBIIO_INCLUDEDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
/opt/local/include
|
||||||
|
${LIBIIO_ROOT}/include
|
||||||
|
$ENV{LIBIIO_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(
|
||||||
|
LIBIIO_LIBRARIES
|
||||||
|
NAMES iio libiio.so.0
|
||||||
|
HINTS $ENV{LIBIIO_DIR}/lib
|
||||||
|
${PC_LIBIIO_LIBDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/i686-gnu
|
||||||
|
/usr/lib/i686-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i686-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/Library/Frameworks/iio.framework/
|
||||||
|
${LIBIIO_ROOT}/lib
|
||||||
|
$ENV{LIBIIO_ROOT}/lib
|
||||||
|
${LIBIIO_ROOT}/lib64
|
||||||
|
$ENV{LIBIIO_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
|
80
cmake/Modules/FindLIBOSMOSDR.cmake
Normal file
80
cmake/Modules/FindLIBOSMOSDR.cmake
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Tries to find libosmosdr.
|
||||||
|
#
|
||||||
|
# Usage of this module as follows:
|
||||||
|
#
|
||||||
|
# find_package(LIBOSMOSDR)
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# Variables defined by this module:
|
||||||
|
#
|
||||||
|
# LIBOSMOSDR_FOUND System has libosmosdr libs/headers
|
||||||
|
# LIBOSMOSDR_LIBRARIES The libosmosdr libraries
|
||||||
|
# LIBOSMOSDR_INCLUDE_DIR The location of libosmosdr headers
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(LIBOSMOSDR_PKG libosmosdr)
|
||||||
|
|
||||||
|
find_path(LIBOSMOSDR_INCLUDE_DIR NAMES osmosdr.h
|
||||||
|
PATHS
|
||||||
|
${LIBOSMOSDR_PKG_INCLUDE_DIRS}
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
${LIBOSMOSDR_ROOT}/include
|
||||||
|
$ENV{LIBOSMOSDR_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(LIBOSMOSDR_LIBRARIES NAMES osmosdr
|
||||||
|
PATHS
|
||||||
|
${LIBOSMOSDR_PKG_LIBRARY_DIRS}
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/i386-gnu
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i386-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib64
|
||||||
|
${LIBOSMOSDR_ROOT}/lib
|
||||||
|
$ENV{LIBOSMOSDR_ROOT}/lib
|
||||||
|
${LIBOSMOSDR_ROOT}/lib64
|
||||||
|
$ENV{LIBOSMOSDR_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(LIBOSMOSDR DEFAULT_MSG LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
|
||||||
|
mark_as_advanced(LIBOSMOSDR_INCLUDE_DIR LIBOSMOSDR_LIBRARIES)
|
92
cmake/Modules/FindLOG4CPP.cmake
Normal file
92
cmake/Modules/FindLOG4CPP.cmake
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# - Find Log4cpp
|
||||||
|
# Find the native LOG4CPP includes and library
|
||||||
|
#
|
||||||
|
# LOG4CPP_INCLUDE_DIR - where to find LOG4CPP.h, etc.
|
||||||
|
# LOG4CPP_LIBRARIES - List of libraries when using LOG4CPP.
|
||||||
|
# LOG4CPP_FOUND - True if LOG4CPP found.
|
||||||
|
|
||||||
|
|
||||||
|
if(LOG4CPP_INCLUDE_DIR)
|
||||||
|
# Already in cache, be silent
|
||||||
|
set(LOG4CPP_FIND_QUIETLY TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_path(LOG4CPP_INCLUDE_DIR log4cpp/Category.hh
|
||||||
|
/opt/local/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${LOG4CPP_ROOT}/include
|
||||||
|
$ENV{LOG4CPP_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
set(LOG4CPP_NAMES log4cpp)
|
||||||
|
find_library(LOG4CPP_LIBRARY
|
||||||
|
NAMES ${LOG4CPP_NAMES}
|
||||||
|
HINTS $ENV{GNURADIO_RUNTIME_DIR}/lib
|
||||||
|
${PC_LIBDIR}
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib/
|
||||||
|
PATHS /usr/local/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/i386-gnu
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i386-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/local/lib
|
||||||
|
${LOG4CPP_ROOT}/lib
|
||||||
|
$ENV{LOG4CPP_ROOT}/lib
|
||||||
|
${LOG4CPP_ROOT}/lib64
|
||||||
|
$ENV{LOG4CPP_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
if(LOG4CPP_INCLUDE_DIR AND LOG4CPP_LIBRARY)
|
||||||
|
set(LOG4CPP_FOUND TRUE)
|
||||||
|
set(LOG4CPP_LIBRARIES ${LOG4CPP_LIBRARY} CACHE INTERNAL "" FORCE)
|
||||||
|
set(LOG4CPP_INCLUDE_DIRS ${LOG4CPP_INCLUDE_DIR} CACHE INTERNAL "" FORCE)
|
||||||
|
else()
|
||||||
|
set(LOG4CPP_FOUND FALSE CACHE INTERNAL "" FORCE)
|
||||||
|
set(LOG4CPP_LIBRARY "" CACHE INTERNAL "" FORCE)
|
||||||
|
set(LOG4CPP_LIBRARIES "" CACHE INTERNAL "" FORCE)
|
||||||
|
set(LOG4CPP_INCLUDE_DIR "" CACHE INTERNAL "" FORCE)
|
||||||
|
set(LOG4CPP_INCLUDE_DIRS "" CACHE INTERNAL "" FORCE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(LOG4CPP DEFAULT_MSG LOG4CPP_INCLUDE_DIRS LOG4CPP_LIBRARIES)
|
@ -60,10 +60,24 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
# Look for the header file.
|
# Look for the header file.
|
||||||
find_path(MATIO_INCLUDE_DIR NAMES matio.h DOC "The MATIO include directory")
|
find_path(MATIO_INCLUDE_DIR
|
||||||
|
NAMES matio.h
|
||||||
|
HINTS
|
||||||
|
${MATIO_ROOT}/include
|
||||||
|
$ENV{MATIO_ROOT}/include
|
||||||
|
DOC "The MATIO include directory"
|
||||||
|
)
|
||||||
|
|
||||||
# Look for the library.
|
# Look for the library.
|
||||||
find_library(MATIO_LIBRARY NAMES matio DOC "The MATIO library")
|
find_library(MATIO_LIBRARY
|
||||||
|
NAMES matio
|
||||||
|
HINTS
|
||||||
|
${MATIO_ROOT}/lib
|
||||||
|
$ENV{MATIO_ROOT}/lib
|
||||||
|
${MATIO_ROOT}/lib64
|
||||||
|
$ENV{MATIO_ROOT}/lib64
|
||||||
|
DOC "The MATIO library"
|
||||||
|
)
|
||||||
|
|
||||||
if(MATIO_INCLUDE_DIR)
|
if(MATIO_INCLUDE_DIR)
|
||||||
# ---------------------------------------------------
|
# ---------------------------------------------------
|
||||||
@ -99,19 +113,17 @@ if(MATIO_INCLUDE_DIR)
|
|||||||
set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}")
|
set(MATIO_VERSION_STRING "${MATIO_MAJOR_VERSION}.${MATIO_MINOR_VERSION}.${MATIO_RELEASE_LEVEL}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
#==================
|
|
||||||
|
|
||||||
mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY)
|
mark_as_advanced(MATIO_INCLUDE_DIR MATIO_LIBRARY)
|
||||||
|
|
||||||
# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set MATIO_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING)
|
find_package_handle_standard_args(MATIO REQUIRED_VARS MATIO_LIBRARY MATIO_INCLUDE_DIR VERSION_VAR MATIO_VERSION_STRING)
|
||||||
|
|
||||||
if(MATIO_FOUND)
|
if(MATIO_FOUND)
|
||||||
set(MATIO_LIBRARIES ${MATIO_LIBRARY})
|
set(MATIO_LIBRARIES ${MATIO_LIBRARY})
|
||||||
set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR})
|
set(MATIO_INCLUDE_DIRS ${MATIO_INCLUDE_DIR})
|
||||||
else(MATIO_FOUND)
|
else()
|
||||||
set(MATIO_LIBRARIES)
|
set(MATIO_LIBRARIES)
|
||||||
set(MATIO_INCLUDE_DIRS)
|
set(MATIO_INCLUDE_DIRS)
|
||||||
endif(MATIO_FOUND)
|
endif()
|
||||||
|
49
cmake/Modules/FindOPENBLAS.cmake
Normal file
49
cmake/Modules/FindOPENBLAS.cmake
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# - Try to find OpenBLAS library (not headers!)
|
||||||
|
#
|
||||||
|
# The following environment variable is optionally searched
|
||||||
|
# OPENBLAS_HOME: Base directory where all OpenBlas components are found
|
||||||
|
|
||||||
|
set(OPEN_BLAS_SEARCH_PATHS
|
||||||
|
/lib
|
||||||
|
/lib64/
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/opt/OpenBLAS/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/usr/lib/openblas-base
|
||||||
|
$ENV{OPENBLAS_HOME}/lib
|
||||||
|
${OPENBLAS_ROOT}/lib
|
||||||
|
$ENV{OPENBLAS_ROOT}/lib
|
||||||
|
${OPENBLAS_ROOT}/lib64
|
||||||
|
$ENV{OPENBLAS_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(OPENBLAS NAMES openblas PATHS ${OPEN_BLAS_SEARCH_PATHS})
|
||||||
|
|
||||||
|
if(OPENBLAS)
|
||||||
|
set(OPENBLAS_FOUND ON)
|
||||||
|
message(STATUS "Found OpenBLAS")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(OPENBLAS DEFAULT_MSG OPENBLAS)
|
||||||
|
mark_as_advanced(OPENBLAS)
|
110
cmake/Modules/FindOPENCL.cmake
Normal file
110
cmake/Modules/FindOPENCL.cmake
Normal file
@ -0,0 +1,110 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
#
|
||||||
|
# This file taken from FindOpenCL project @ http://gitorious.com/findopencl
|
||||||
|
#
|
||||||
|
# - Try to find OpenCL
|
||||||
|
# This module tries to find an OpenCL implementation on your system. It supports
|
||||||
|
# AMD / ATI, Apple and NVIDIA implementations, but shoudl work, too.
|
||||||
|
#
|
||||||
|
# Once done this will define
|
||||||
|
# OPENCL_FOUND - system has OpenCL
|
||||||
|
# OPENCL_INCLUDE_DIRS - the OpenCL include directory
|
||||||
|
# OPENCL_LIBRARIES - link these to use OpenCL
|
||||||
|
#
|
||||||
|
# WIN32 should work, but is untested
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
|
||||||
|
set(OPENCL_VERSION_STRING "0.1.0")
|
||||||
|
set(OPENCL_VERSION_MAJOR 0)
|
||||||
|
set(OPENCL_VERSION_MINOR 1)
|
||||||
|
set(OPENCL_VERSION_PATCH 0)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
find_library(OPENCL_LIBRARIES OpenCL DOC "OpenCL lib for OSX")
|
||||||
|
find_path(OPENCL_INCLUDE_DIRS OpenCL/cl.h DOC "Include for OpenCL on OSX")
|
||||||
|
find_path(_OPENCL_CPP_INCLUDE_DIRS OpenCL/cl.hpp DOC "Include for OpenCL CPP bindings on OSX")
|
||||||
|
|
||||||
|
else()
|
||||||
|
if(WIN32)
|
||||||
|
find_path(OPENCL_INCLUDE_DIRS CL/cl.h)
|
||||||
|
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp)
|
||||||
|
|
||||||
|
# The AMD SDK currently installs both x86 and x86_64 libraries
|
||||||
|
# This is only a hack to find out architecture
|
||||||
|
if(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64")
|
||||||
|
set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86_64")
|
||||||
|
set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86_64")
|
||||||
|
else()
|
||||||
|
set(OPENCL_LIB_DIR "$ENV{ATISTREAMSDKROOT}/lib/x86")
|
||||||
|
set(OPENCL_LIB_DIR "$ENV{ATIINTERNALSTREAMSDKROOT}/lib/x86")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# find out if the user asked for a 64-bit build, and use the corresponding
|
||||||
|
# 64 or 32 bit NVIDIA library paths to the search:
|
||||||
|
string(REGEX MATCH "Win64" ISWIN64 ${CMAKE_GENERATOR})
|
||||||
|
if("${ISWIN64}" STREQUAL "Win64")
|
||||||
|
find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/x64)
|
||||||
|
else()
|
||||||
|
find_library(OPENCL_LIBRARIES OpenCL.lib ${OPENCL_LIB_DIR} $ENV{CUDA_LIB_PATH} $ENV{CUDA_PATH}/lib/Win32)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
|
||||||
|
|
||||||
|
# On Win32 search relative to the library
|
||||||
|
find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
|
||||||
|
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS "${_OPENCL_INC_CAND}" $ENV{CUDA_INC_PATH} $ENV{CUDA_PATH}/include)
|
||||||
|
|
||||||
|
else()
|
||||||
|
# Unix style platforms
|
||||||
|
find_library(OPENCL_LIBRARIES OpenCL
|
||||||
|
ENV LD_LIBRARY_PATH
|
||||||
|
)
|
||||||
|
|
||||||
|
get_filename_component(OPENCL_LIB_DIR ${OPENCL_LIBRARIES} PATH)
|
||||||
|
get_filename_component(_OPENCL_INC_CAND ${OPENCL_LIB_DIR}/../../include ABSOLUTE)
|
||||||
|
|
||||||
|
# The AMD SDK currently does not place its headers
|
||||||
|
# in /usr/include, therefore also search relative
|
||||||
|
# to the library
|
||||||
|
find_path(OPENCL_INCLUDE_DIRS CL/cl.h PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
|
||||||
|
find_path(_OPENCL_CPP_INCLUDE_DIRS CL/cl.hpp PATHS ${_OPENCL_INC_CAND} "/usr/local/cuda/include")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package_handle_standard_args(OPENCL DEFAULT_MSG OPENCL_LIBRARIES OPENCL_INCLUDE_DIRS)
|
||||||
|
|
||||||
|
if(_OPENCL_CPP_INCLUDE_DIRS)
|
||||||
|
set(OPENCL_HAS_CPP_BINDINGS TRUE)
|
||||||
|
list(APPEND OPENCL_INCLUDE_DIRS ${_OPENCL_CPP_INCLUDE_DIRS})
|
||||||
|
# This is often the same, so clean up
|
||||||
|
list(REMOVE_DUPLICATES OPENCL_INCLUDE_DIRS)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
OPENCL_INCLUDE_DIRS
|
||||||
|
)
|
||||||
|
|
||||||
|
if(OPENCL_INCLUDE_DIRS AND OPENCL_LIBRARIES)
|
||||||
|
set( OPENCL_FOUND TRUE )
|
||||||
|
add_definitions( -DOPENCL=1 )
|
||||||
|
else()
|
||||||
|
set( OPENCL_FOUND FALSE )
|
||||||
|
add_definitions( -DOPENCL=0 )
|
||||||
|
endif()
|
@ -15,19 +15,24 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
FIND_PACKAGE(PkgConfig)
|
find_package(PkgConfig)
|
||||||
PKG_CHECK_MODULES(PC_ORC "orc-0.4 > 0.4.22")
|
pkg_check_modules(PC_ORC "orc-0.4 > 0.4.22")
|
||||||
|
|
||||||
FIND_PROGRAM(ORCC_EXECUTABLE orcc
|
find_program(ORCC_EXECUTABLE orcc
|
||||||
HINTS ${PC_ORC_TOOLSDIR}
|
HINTS ${PC_ORC_TOOLSDIR}
|
||||||
PATHS ${ORC_ROOT}/bin ${CMAKE_INSTALL_PREFIX}/bin)
|
PATHS ${ORC_ROOT}/bin
|
||||||
|
${CMAKE_INSTALL_PREFIX}/bin
|
||||||
|
)
|
||||||
|
|
||||||
FIND_PATH(ORC_INCLUDE_DIR NAMES orc/orc.h
|
find_path(ORC_INCLUDE_DIR
|
||||||
|
NAMES orc/orc.h
|
||||||
HINTS ${PC_ORC_INCLUDEDIR}
|
HINTS ${PC_ORC_INCLUDEDIR}
|
||||||
PATHS ${ORC_ROOT}/include/orc-0.4 ${CMAKE_INSTALL_PREFIX}/include/orc-0.4)
|
PATHS ${ORC_ROOT}/include/orc-0.4
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include/orc-0.4
|
||||||
|
)
|
||||||
|
|
||||||
|
find_path(ORC_LIBRARY_DIR
|
||||||
FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX}
|
NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHARED_LIBRARY_SUFFIX}
|
||||||
HINTS ${PC_ORC_LIBDIR}
|
HINTS ${PC_ORC_LIBDIR}
|
||||||
/usr/local/lib
|
/usr/local/lib
|
||||||
/usr/lib/x86_64-linux-gnu
|
/usr/lib/x86_64-linux-gnu
|
||||||
@ -45,22 +50,26 @@ FIND_PATH(ORC_LIBRARY_DIR NAMES ${CMAKE_SHARED_LIBRARY_PREFIX}orc-0.4${CMAKE_SHA
|
|||||||
/usr/lib/s390x-linux-gnu
|
/usr/lib/s390x-linux-gnu
|
||||||
/usr/lib64
|
/usr/lib64
|
||||||
/usr/lib
|
/usr/lib
|
||||||
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
|
${ORC_ROOT}/lib
|
||||||
|
$ENV{ORC_ROOT}/lib
|
||||||
FIND_LIBRARY(ORC_LIB orc-0.4
|
PATHS
|
||||||
HINTS ${PC_ORC_LIBRARY_DIRS}
|
${ORC_ROOT}/lib${LIB_SUFFIX}
|
||||||
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX} ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
|
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
|
||||||
|
|
||||||
LIST(APPEND ORC_LIBRARY
|
|
||||||
${ORC_LIB}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
find_library(ORC_LIB orc-0.4
|
||||||
|
HINTS ${PC_ORC_LIBRARY_DIRS}
|
||||||
|
PATHS ${ORC_ROOT}/lib${LIB_SUFFIX}
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}
|
||||||
|
)
|
||||||
|
|
||||||
SET(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR})
|
list(APPEND ORC_LIBRARY ${ORC_LIB})
|
||||||
SET(ORC_LIBRARIES ${ORC_LIBRARY})
|
|
||||||
SET(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR})
|
|
||||||
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
set(ORC_INCLUDE_DIRS ${ORC_INCLUDE_DIR})
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
|
set(ORC_LIBRARIES ${ORC_LIBRARY})
|
||||||
|
set(ORC_LIBRARY_DIRS ${ORC_LIBRARY_DIR})
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(ORC "orc files" ORC_LIBRARY ORC_INCLUDE_DIR ORCC_EXECUTABLE)
|
||||||
|
|
||||||
mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE)
|
mark_as_advanced(ORC_INCLUDE_DIR ORC_LIBRARY ORCC_EXECUTABLE)
|
@ -45,77 +45,78 @@
|
|||||||
# PCAP_FOUND - True if pcap found.
|
# PCAP_FOUND - True if pcap found.
|
||||||
|
|
||||||
|
|
||||||
IF(EXISTS $ENV{PCAPDIR})
|
if(EXISTS $ENV{PCAPDIR})
|
||||||
FIND_PATH(PCAP_INCLUDE_DIR
|
find_path(PCAP_INCLUDE_DIR
|
||||||
NAMES
|
NAMES
|
||||||
pcap/pcap.h
|
pcap/pcap.h
|
||||||
pcap.h
|
pcap.h
|
||||||
PATHS
|
PATHS
|
||||||
$ENV{PCAPDIR}
|
$ENV{PCAPDIR}
|
||||||
|
${PCAP_ROOT}/include
|
||||||
|
$ENV{PCAP_ROOT}/include
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
|
find_library(PCAP_LIBRARY
|
||||||
FIND_LIBRARY(PCAP_LIBRARY
|
|
||||||
NAMES
|
NAMES
|
||||||
pcap
|
pcap
|
||||||
PATHS
|
PATHS
|
||||||
$ENV{PCAPDIR}
|
$ENV{PCAPDIR}
|
||||||
|
${PCAP_ROOT}/lib
|
||||||
|
$ENV{PCAP_ROOT}/lib
|
||||||
NO_DEFAULT_PATH
|
NO_DEFAULT_PATH
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
find_path(PCAP_INCLUDE_DIR
|
||||||
ELSE(EXISTS $ENV{PCAPDIR})
|
|
||||||
FIND_PATH(PCAP_INCLUDE_DIR
|
|
||||||
NAMES
|
NAMES
|
||||||
pcap/pcap.h
|
pcap/pcap.h
|
||||||
pcap.h
|
pcap.h
|
||||||
|
HINTS
|
||||||
|
${PCAP_ROOT}/include
|
||||||
|
$ENV{PCAP_ROOT}/include
|
||||||
)
|
)
|
||||||
|
find_library(PCAP_LIBRARY
|
||||||
FIND_LIBRARY(PCAP_LIBRARY
|
|
||||||
NAMES
|
NAMES
|
||||||
pcap
|
pcap
|
||||||
|
HINTS
|
||||||
|
${PCAP_ROOT}/lib
|
||||||
|
$ENV{PCAP_ROOT}/lib
|
||||||
)
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
ENDIF(EXISTS $ENV{PCAPDIR})
|
set(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR})
|
||||||
|
set(PCAP_LIBRARIES ${PCAP_LIBRARY})
|
||||||
|
|
||||||
SET(PCAP_INCLUDE_DIRS ${PCAP_INCLUDE_DIR})
|
if(PCAP_INCLUDE_DIRS)
|
||||||
SET(PCAP_LIBRARIES ${PCAP_LIBRARY})
|
message(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}")
|
||||||
|
else()
|
||||||
|
message(FATAL " Pcap include dirs cannot be found")
|
||||||
|
endif()
|
||||||
|
|
||||||
IF(PCAP_INCLUDE_DIRS)
|
if(PCAP_LIBRARIES)
|
||||||
MESSAGE(STATUS "Pcap include dirs set to ${PCAP_INCLUDE_DIRS}")
|
message(STATUS "Pcap library set to ${PCAP_LIBRARIES}")
|
||||||
ELSE(PCAP_INCLUDE_DIRS)
|
else()
|
||||||
MESSAGE(FATAL " Pcap include dirs cannot be found")
|
message(FATAL "Pcap library cannot be found")
|
||||||
ENDIF(PCAP_INCLUDE_DIRS)
|
endif()
|
||||||
|
|
||||||
IF(PCAP_LIBRARIES)
|
|
||||||
MESSAGE(STATUS "Pcap library set to ${PCAP_LIBRARIES}")
|
|
||||||
ELSE(PCAP_LIBRARIES)
|
|
||||||
MESSAGE(FATAL "Pcap library cannot be found")
|
|
||||||
ENDIF(PCAP_LIBRARIES)
|
|
||||||
|
|
||||||
#Functions
|
#Functions
|
||||||
INCLUDE(CheckFunctionExists)
|
include(CheckFunctionExists)
|
||||||
SET(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS})
|
set(CMAKE_REQUIRED_INCLUDES ${PCAP_INCLUDE_DIRS})
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES})
|
set(CMAKE_REQUIRED_LIBRARIES ${PCAP_LIBRARIES})
|
||||||
CHECK_FUNCTION_EXISTS("pcap_breakloop" HAVE_PCAP_BREAKLOOP)
|
check_function_exists("pcap_breakloop" HAVE_PCAP_BREAKLOOP)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL)
|
check_function_exists("pcap_datalink_name_to_val" HAVE_PCAP_DATALINK_NAME_TO_VAL)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME)
|
check_function_exists("pcap_datalink_val_to_name" HAVE_PCAP_DATALINK_VAL_TO_NAME)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS)
|
check_function_exists("pcap_findalldevs" HAVE_PCAP_FINDALLDEVS)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_freecode" HAVE_PCAP_FREECODE)
|
check_function_exists("pcap_freecode" HAVE_PCAP_FREECODE)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD)
|
check_function_exists("pcap_get_selectable_fd" HAVE_PCAP_GET_SELECTABLE_FD)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_lib_version" HAVE_PCAP_LIB_VERSION)
|
check_function_exists("pcap_lib_version" HAVE_PCAP_LIB_VERSION)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS)
|
check_function_exists("pcap_list_datalinks" HAVE_PCAP_LIST_DATALINKS)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_open_dead" HAVE_PCAP_OPEN_DEAD)
|
check_function_exists("pcap_open_dead" HAVE_PCAP_OPEN_DEAD)
|
||||||
CHECK_FUNCTION_EXISTS("pcap_set_datalink" HAVE_PCAP_SET_DATALINK)
|
check_function_exists("pcap_set_datalink" HAVE_PCAP_SET_DATALINK)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
#Is pcap found ?
|
|
||||||
IF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES)
|
|
||||||
SET( PCAP_FOUND true )
|
|
||||||
ENDIF(PCAP_INCLUDE_DIRS AND PCAP_LIBRARIES)
|
|
||||||
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
|
||||||
PCAP_LIBRARIES
|
PCAP_LIBRARIES
|
||||||
PCAP_INCLUDE_DIRS
|
PCAP_INCLUDE_DIRS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(PCAP DEFAULT_MSG PCAP_INCLUDE_DIRS PCAP_LIBRARIES)
|
||||||
|
75
cmake/Modules/FindPUGIXML.cmake
Normal file
75
cmake/Modules/FindPUGIXML.cmake
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Find the pugixml XML parsing library.
|
||||||
|
#
|
||||||
|
# Sets the usual variables expected for find_package scripts:
|
||||||
|
#
|
||||||
|
# PUGIXML_INCLUDE_DIR - header location
|
||||||
|
# PUGIXML_LIBRARIES - library to link against
|
||||||
|
# PUGIXML_FOUND - true if pugixml was found.
|
||||||
|
|
||||||
|
find_path(PUGIXML_INCLUDE_DIR
|
||||||
|
NAMES pugixml.hpp
|
||||||
|
PATHS ${PUGIXML_HOME}/include
|
||||||
|
/usr/include
|
||||||
|
/usr/local/include
|
||||||
|
/opt/local/include
|
||||||
|
${PUGIXML_ROOT}/include
|
||||||
|
$ENV{PUGIXML_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(PUGIXML_LIBRARY
|
||||||
|
NAMES pugixml
|
||||||
|
PATHS ${PUGIXML_HOME}/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/local/lib
|
||||||
|
/opt/local/lib
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
/usr/local/lib64
|
||||||
|
${PUGIXML_ROOT}/lib
|
||||||
|
$ENV{PUGIXML_ROOT}/lib
|
||||||
|
${PUGIXML_ROOT}/lib64
|
||||||
|
$ENV{PUGIXML_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
# Support the REQUIRED and QUIET arguments, and set PUGIXML_FOUND if found.
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(PUGIXML DEFAULT_MSG PUGIXML_LIBRARY
|
||||||
|
PUGIXML_INCLUDE_DIR)
|
||||||
|
|
||||||
|
if(PUGIXML_FOUND)
|
||||||
|
set(PUGIXML_LIBRARIES ${PUGIXML_LIBRARY})
|
||||||
|
if(NOT PUGIXML_FIND_QUIETLY)
|
||||||
|
message(STATUS "PugiXML include = ${PUGIXML_INCLUDE_DIR}")
|
||||||
|
message(STATUS "PugiXML library = ${PUGIXML_LIBRARY}")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "PugiXML not found.")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
mark_as_advanced(PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
50
cmake/Modules/FindTELEORBIT.cmake
Normal file
50
cmake/Modules/FindTELEORBIT.cmake
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_TELEORBIT teleorbit)
|
||||||
|
|
||||||
|
find_path(TELEORBIT_INCLUDE_DIRS
|
||||||
|
NAMES teleorbit/api.h
|
||||||
|
HINTS $ENV{TELEORBIT_DIR}/include
|
||||||
|
${PC_TELEORBIT_INCLUDEDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
/usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${TELEORBIT_ROOT}/include
|
||||||
|
$ENV{TELEORBIT_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(TELEORBIT_LIBRARIES
|
||||||
|
NAMES gnuradio-teleorbit
|
||||||
|
HINTS $ENV{TELEORBIT_DIR}/lib
|
||||||
|
${PC_TELEORBIT_LIBDIR}
|
||||||
|
PATHS ${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib64
|
||||||
|
/usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
${TELEORBIT_ROOT}/lib
|
||||||
|
$ENV{TELEORBIT_ROOT}/lib
|
||||||
|
${TELEORBIT_ROOT}/lib64
|
||||||
|
$ENV{TELEORBIT_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)
|
@ -19,21 +19,21 @@
|
|||||||
# Find the library for the USRP Hardware Driver
|
# Find the library for the USRP Hardware Driver
|
||||||
########################################################################
|
########################################################################
|
||||||
|
|
||||||
INCLUDE(FindPkgConfig)
|
include(FindPkgConfig)
|
||||||
PKG_CHECK_MODULES(PC_UHD uhd)
|
pkg_check_modules(PC_UHD uhd)
|
||||||
|
|
||||||
FIND_PATH(
|
find_path(UHD_INCLUDE_DIRS
|
||||||
UHD_INCLUDE_DIRS
|
|
||||||
NAMES uhd/config.hpp
|
NAMES uhd/config.hpp
|
||||||
HINTS $ENV{UHD_DIR}/include
|
HINTS $ENV{UHD_DIR}/include
|
||||||
${PC_UHD_INCLUDEDIR}
|
${PC_UHD_INCLUDEDIR}
|
||||||
PATHS /usr/local/include
|
PATHS /usr/local/include
|
||||||
/usr/include
|
/usr/include
|
||||||
${GNURADIO_INSTALL_PREFIX}/include
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
${UHD_ROOT}/include
|
||||||
|
$ENV{UHD_ROOT}/include
|
||||||
)
|
)
|
||||||
|
|
||||||
FIND_LIBRARY(
|
find_library(UHD_LIBRARIES
|
||||||
UHD_LIBRARIES
|
|
||||||
NAMES uhd
|
NAMES uhd
|
||||||
HINTS $ENV{UHD_DIR}/lib
|
HINTS $ENV{UHD_DIR}/lib
|
||||||
${PC_UHD_LIBDIR}
|
${PC_UHD_LIBDIR}
|
||||||
@ -64,8 +64,12 @@ FIND_LIBRARY(
|
|||||||
/usr/lib64
|
/usr/lib64
|
||||||
/usr/lib
|
/usr/lib
|
||||||
${GNURADIO_INSTALL_PREFIX}/lib
|
${GNURADIO_INSTALL_PREFIX}/lib
|
||||||
|
${UHD_ROOT}/lib
|
||||||
|
$ENV{UHD_ROOT}/lib
|
||||||
|
${UHD_ROOT}/lib64
|
||||||
|
$ENV{UHD_ROOT}/lib64
|
||||||
)
|
)
|
||||||
|
|
||||||
INCLUDE(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
|
find_package_handle_standard_args(UHD DEFAULT_MSG UHD_LIBRARIES UHD_INCLUDE_DIRS)
|
||||||
MARK_AS_ADVANCED(UHD_LIBRARIES UHD_INCLUDE_DIRS)
|
mark_as_advanced(UHD_LIBRARIES UHD_INCLUDE_DIRS)
|
||||||
|
76
cmake/Modules/FindVOLK.cmake
Normal file
76
cmake/Modules/FindVOLK.cmake
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Find VOLK (Vector-Optimized Library of Kernels)
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_VOLK volk)
|
||||||
|
|
||||||
|
find_path(VOLK_INCLUDE_DIRS
|
||||||
|
NAMES volk/volk.h
|
||||||
|
HINTS $ENV{VOLK_DIR}/include
|
||||||
|
${PC_VOLK_INCLUDEDIR}
|
||||||
|
PATHS /usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${CMAKE_INSTALL_PREFIX}/include
|
||||||
|
${VOLK_ROOT}/include
|
||||||
|
$ENV{VOLK_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(VOLK_LIBRARIES
|
||||||
|
NAMES volk
|
||||||
|
HINTS $ENV{VOLK_DIR}/lib
|
||||||
|
${PC_VOLK_LIBDIR}
|
||||||
|
PATHS /usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib/x86_64-linux-gnu
|
||||||
|
/usr/lib/i386-linux-gnu
|
||||||
|
/usr/lib/arm-linux-gnueabihf
|
||||||
|
/usr/lib/arm-linux-gnueabi
|
||||||
|
/usr/lib/aarch64-linux-gnu
|
||||||
|
/usr/lib/mipsel-linux-gnu
|
||||||
|
/usr/lib/mips-linux-gnu
|
||||||
|
/usr/lib/mips64el-linux-gnuabi64
|
||||||
|
/usr/lib/powerpc-linux-gnu
|
||||||
|
/usr/lib/powerpc64-linux-gnu
|
||||||
|
/usr/lib/powerpc64le-linux-gnu
|
||||||
|
/usr/lib/powerpc-linux-gnuspe
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/s390x-linux-gnu
|
||||||
|
/usr/lib/i386-gnu
|
||||||
|
/usr/lib/hppa-linux-gnu
|
||||||
|
/usr/lib/x86_64-kfreebsd-gnu
|
||||||
|
/usr/lib/i386-kfreebsd-gnu
|
||||||
|
/usr/lib/m68k-linux-gnu
|
||||||
|
/usr/lib/sh4-linux-gnu
|
||||||
|
/usr/lib/sparc64-linux-gnu
|
||||||
|
/usr/lib/x86_64-linux-gnux32
|
||||||
|
/usr/lib/alpha-linux-gnu
|
||||||
|
/usr/lib64
|
||||||
|
${CMAKE_INSTALL_PREFIX}/lib
|
||||||
|
${VOLK_ROOT}/lib
|
||||||
|
$ENV{VOLK_ROOT}/lib
|
||||||
|
${VOLK_ROOT}/lib64
|
||||||
|
$ENV{VOLK_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(VOLK DEFAULT_MSG VOLK_LIBRARIES VOLK_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(VOLK_LIBRARIES VOLK_INCLUDE_DIRS VOLK_VERSION)
|
53
cmake/Modules/FindVOLKGNSSSDR.cmake
Normal file
53
cmake/Modules/FindVOLKGNSSSDR.cmake
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Find VOLK (Vector-Optimized Library of Kernels) GNSS-SDR library
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
include(FindPkgConfig)
|
||||||
|
pkg_check_modules(PC_VOLK_GNSSSDR volk_gnsssdr)
|
||||||
|
|
||||||
|
find_path(VOLK_GNSSSDR_INCLUDE_DIRS
|
||||||
|
NAMES volk_gnsssdr/volk_gnsssdr.h
|
||||||
|
HINTS $ENV{VOLK_GNSSSDR_DIR}/include
|
||||||
|
${PC_VOLK_GNSSSDR_INCLUDEDIR}
|
||||||
|
PATHS /usr/local/include
|
||||||
|
/usr/include
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/include
|
||||||
|
${VOLKGNSSSDR_ROOT}/include
|
||||||
|
$ENV{VOLKGNSSSDR_ROOT}/include
|
||||||
|
)
|
||||||
|
|
||||||
|
find_library(VOLK_GNSSSDR_LIBRARIES
|
||||||
|
NAMES volk_gnsssdr
|
||||||
|
HINTS $ENV{VOLK_GNSSSDR_DIR}/lib
|
||||||
|
${PC_VOLK_GNSSSDR_LIBDIR}
|
||||||
|
PATHS /usr/local/lib
|
||||||
|
/usr/local/lib64
|
||||||
|
/usr/lib
|
||||||
|
/usr/lib64
|
||||||
|
${GNURADIO_INSTALL_PREFIX}/lib
|
||||||
|
${VOLKGNSSSDR_ROOT}/lib
|
||||||
|
$ENV{VOLKGNSSSDR_ROOT}/lib
|
||||||
|
${VOLKGNSSSDR_ROOT}/lib64
|
||||||
|
$ENV{VOLKGNSSSDR_ROOT}/lib64
|
||||||
|
)
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(VOLKGNSSSDR DEFAULT_MSG VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
|
||||||
|
mark_as_advanced(VOLK_GNSSSDR_LIBRARIES VOLK_GNSSSDR_INCLUDE_DIRS)
|
219
cmake/Modules/GnsssdrBuildTypes.cmake
Normal file
219
cmake/Modules/GnsssdrBuildTypes.cmake
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
# Copyright (C) 2011-2018 (see AUTHORS file for a list of contributors)
|
||||||
|
#
|
||||||
|
# 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
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# 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 <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
if(DEFINED __INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
set(__INCLUDED_GNSSSDR_BUILD_TYPES_CMAKE TRUE)
|
||||||
|
|
||||||
|
# Standard CMake Build Types and their basic CFLAGS:
|
||||||
|
# - None: nothing set
|
||||||
|
# - Debug: -O2 -g
|
||||||
|
# - Release: -O3
|
||||||
|
# - RelWithDebInfo: -O3 -g
|
||||||
|
# - MinSizeRel: -Os
|
||||||
|
|
||||||
|
# Additional Build Types, defined below:
|
||||||
|
# - NoOptWithASM: -O0 -g -save-temps
|
||||||
|
# - O2WithASM: -O2 -g -save-temps
|
||||||
|
# - O3WithASM: -O3 -g -save-temps
|
||||||
|
|
||||||
|
# Defines the list of acceptable cmake build types. When adding a new
|
||||||
|
# build type below, make sure to add it to this list.
|
||||||
|
list(APPEND AVAIL_BUILDTYPES
|
||||||
|
None Debug Release RelWithDebInfo MinSizeRel
|
||||||
|
Coverage NoOptWithASM O2WithASM O3WithASM ASAN
|
||||||
|
)
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# GNSSSDR_CHECK_BUILD_TYPE(build type)
|
||||||
|
#
|
||||||
|
# Use this to check that the build type set in CMAKE_BUILD_TYPE on the
|
||||||
|
# commandline is one of the valid build types used by this project. It
|
||||||
|
# checks the value set in the cmake interface against the list of
|
||||||
|
# known build types in AVAIL_BUILDTYPES. If the build type is found,
|
||||||
|
# the function exits immediately. If nothing is found by the end of
|
||||||
|
# checking all available build types, we exit with an error and list
|
||||||
|
# the avialable build types.
|
||||||
|
########################################################################
|
||||||
|
function(GNSSSDR_CHECK_BUILD_TYPE settype)
|
||||||
|
string(TOUPPER ${settype} _settype)
|
||||||
|
foreach(btype ${AVAIL_BUILDTYPES})
|
||||||
|
string(TOUPPER ${btype} _btype)
|
||||||
|
if(${_settype} STREQUAL ${_btype})
|
||||||
|
return() # found it; exit cleanly
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
# Build type not found; error out
|
||||||
|
message(FATAL_ERROR "Build type '${settype}' not valid, must be one of: ${AVAIL_BUILDTYPES}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# For GCC and Clang, we can set a build type:
|
||||||
|
#
|
||||||
|
# -DCMAKE_BUILD_TYPE=Coverage
|
||||||
|
#
|
||||||
|
# This type uses no optimization (-O0), outputs debug symbols (-g) and
|
||||||
|
# outputs all intermediary files the build system produces, including
|
||||||
|
# all assembly (.s) files. Look in the build directory for these
|
||||||
|
# files.
|
||||||
|
# NOTE: This is not defined on Windows systems.
|
||||||
|
########################################################################
|
||||||
|
if(NOT WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING
|
||||||
|
"Flags used by the C++ compiler during Coverage builds." FORCE)
|
||||||
|
set(CMAKE_C_FLAGS_COVERAGE "-Wall -pedantic -pthread -g -O0 -fprofile-arcs -ftest-coverage" CACHE STRING
|
||||||
|
"Flags used by the C compiler during Coverage builds." FORCE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used for linking binaries during Coverage builds." FORCE)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used by the shared lib linker during Coverage builds." FORCE)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
CMAKE_CXX_FLAGS_COVERAGE
|
||||||
|
CMAKE_C_FLAGS_COVERAGE
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_COVERAGE
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_COVERAGE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# For GCC and Clang, we can set a build type:
|
||||||
|
#
|
||||||
|
# -DCMAKE_BUILD_TYPE=NoOptWithASM
|
||||||
|
#
|
||||||
|
# This type uses no optimization (-O0), outputs debug symbols (-g) and
|
||||||
|
# outputs all intermediary files the build system produces, including
|
||||||
|
# all assembly (.s) files. Look in the build directory for these
|
||||||
|
# files.
|
||||||
|
# NOTE: This is not defined on Windows systems.
|
||||||
|
########################################################################
|
||||||
|
if(NOT WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING
|
||||||
|
"Flags used by the C++ compiler during NoOptWithASM builds." FORCE)
|
||||||
|
set(CMAKE_C_FLAGS_NOOPTWITHASM "-Wall -save-temps -g -O0" CACHE STRING
|
||||||
|
"Flags used by the C compiler during NoOptWithASM builds." FORCE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used for linking binaries during NoOptWithASM builds." FORCE)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used by the shared lib linker during NoOptWithASM builds." FORCE)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
CMAKE_CXX_FLAGS_NOOPTWITHASM
|
||||||
|
CMAKE_C_FLAGS_NOOPTWITHASM
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_NOOPTWITHASM
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_NOOPTWITHASM)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# For GCC and Clang, we can set a build type:
|
||||||
|
#
|
||||||
|
# -DCMAKE_BUILD_TYPE=O2WithASM
|
||||||
|
#
|
||||||
|
# This type uses level 2 optimization (-O2), outputs debug symbols
|
||||||
|
# (-g) and outputs all intermediary files the build system produces,
|
||||||
|
# including all assembly (.s) files. Look in the build directory for
|
||||||
|
# these files.
|
||||||
|
# NOTE: This is not defined on Windows systems.
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING
|
||||||
|
"Flags used by the C++ compiler during O2WithASM builds." FORCE)
|
||||||
|
set(CMAKE_C_FLAGS_O2WITHASM "-Wall -save-temps -g -O2" CACHE STRING
|
||||||
|
"Flags used by the C compiler during O2WithASM builds." FORCE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_O2WITHASM
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used for linking binaries during O2WithASM builds." FORCE)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_O2WITHASM
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used by the shared lib linker during O2WithASM builds." FORCE)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
CMAKE_CXX_FLAGS_O2WITHASM
|
||||||
|
CMAKE_C_FLAGS_O2WITHASM
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_O2WITHASM
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_O2WITHASM)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# For GCC and Clang, we can set a build type:
|
||||||
|
#
|
||||||
|
# -DCMAKE_BUILD_TYPE=O3WithASM
|
||||||
|
#
|
||||||
|
# This type uses level 3 optimization (-O3), outputs debug symbols
|
||||||
|
# (-g) and outputs all intermediary files the build system produces,
|
||||||
|
# including all assembly (.s) files. Look in the build directory for
|
||||||
|
# these files.
|
||||||
|
# NOTE: This is not defined on Windows systems.
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
if(NOT WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING
|
||||||
|
"Flags used by the C++ compiler during O3WithASM builds." FORCE)
|
||||||
|
set(CMAKE_C_FLAGS_O3WITHASM "-Wall -save-temps -g -O3" CACHE STRING
|
||||||
|
"Flags used by the C compiler during O3WithASM builds." FORCE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_O3WITHASM
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used for linking binaries during O3WithASM builds." FORCE)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_O3WITHASM
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used by the shared lib linker during O3WithASM builds." FORCE)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
CMAKE_CXX_FLAGS_O3WITHASM
|
||||||
|
CMAKE_C_FLAGS_O3WITHASM
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_O3WITHASM
|
||||||
|
CMAKE_SHARED_LINKER_FLAGS_O3WITHASM)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# For GCC and Clang, we can set a build type:
|
||||||
|
#
|
||||||
|
# -DCMAKE_BUILD_TYPE=ASAN
|
||||||
|
#
|
||||||
|
# This type creates an address sanitized build (-fsanitize=address)
|
||||||
|
# and defaults to the DebugParanoid linker flags.
|
||||||
|
# NOTE: This is not defined on Windows systems.
|
||||||
|
########################################################################
|
||||||
|
if(NOT WIN32)
|
||||||
|
set(CMAKE_CXX_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
|
||||||
|
"Flags used by the C++ compiler during Address Sanitized builds." FORCE)
|
||||||
|
set(CMAKE_C_FLAGS_ASAN "-Wall -Wextra -g -O2 -fsanitize=address -fno-omit-frame-pointer" CACHE STRING
|
||||||
|
"Flags used by the C compiler during Address Sanitized builds." FORCE)
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS_ASAN
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used for linking binaries during Address Sanitized builds." FORCE)
|
||||||
|
set(CMAKE_SHARED_LINKER_FLAGS_ASAN
|
||||||
|
"-W" CACHE STRING
|
||||||
|
"Flags used by the shared lib linker during Address Sanitized builds." FORCE)
|
||||||
|
|
||||||
|
mark_as_advanced(
|
||||||
|
CMAKE_CXX_FLAGS_ASAN
|
||||||
|
CMAKE_C_FLAGS_ASAN
|
||||||
|
CMAKE_EXE_LINKER_FLAGS_ASAN
|
||||||
|
CMAKE_SHARED_LINKER_ASAN)
|
||||||
|
endif()
|
@ -15,54 +15,6 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
# along with GNSS-SDR. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
########################################################################
|
|
||||||
# Setup the python interpreter:
|
|
||||||
# This allows the user to specify a specific interpreter,
|
|
||||||
# or finds the interpreter via the built-in cmake module.
|
|
||||||
########################################################################
|
|
||||||
#this allows the user to override PYTHON_EXECUTABLE
|
|
||||||
if(PYTHON_EXECUTABLE)
|
|
||||||
|
|
||||||
set(PYTHONINTERP_FOUND TRUE)
|
|
||||||
|
|
||||||
#otherwise if not set, try to automatically find it
|
|
||||||
else(PYTHON_EXECUTABLE)
|
|
||||||
|
|
||||||
#use the built-in find script
|
|
||||||
set(Python_ADDITIONAL_VERSIONS 3.4 3.5 3.6)
|
|
||||||
find_package(PythonInterp 2)
|
|
||||||
|
|
||||||
#and if that fails use the find program routine
|
|
||||||
if(NOT PYTHONINTERP_FOUND)
|
|
||||||
find_program(PYTHON_EXECUTABLE NAMES python python2 python2.7 python3)
|
|
||||||
if(PYTHON_EXECUTABLE)
|
|
||||||
set(PYTHONINTERP_FOUND TRUE)
|
|
||||||
endif(PYTHON_EXECUTABLE)
|
|
||||||
endif(NOT PYTHONINTERP_FOUND)
|
|
||||||
|
|
||||||
endif(PYTHON_EXECUTABLE)
|
|
||||||
|
|
||||||
if (CMAKE_CROSSCOMPILING)
|
|
||||||
set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
|
|
||||||
else (CMAKE_CROSSCOMPILING)
|
|
||||||
set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
|
|
||||||
endif(CMAKE_CROSSCOMPILING)
|
|
||||||
|
|
||||||
#make the path to the executable appear in the cmake gui
|
|
||||||
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
|
|
||||||
set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")
|
|
||||||
|
|
||||||
#make sure we can use -B with python (introduced in 2.6)
|
|
||||||
if(PYTHON_EXECUTABLE)
|
|
||||||
execute_process(
|
|
||||||
COMMAND ${PYTHON_EXECUTABLE} -B -c ""
|
|
||||||
OUTPUT_QUIET ERROR_QUIET
|
|
||||||
RESULT_VARIABLE PYTHON_HAS_DASH_B_RESULT
|
|
||||||
)
|
|
||||||
if(PYTHON_HAS_DASH_B_RESULT EQUAL 0)
|
|
||||||
set(PYTHON_DASH_B "-B")
|
|
||||||
endif()
|
|
||||||
endif(PYTHON_EXECUTABLE)
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
# Check for the existence of a python module:
|
# Check for the existence of a python module:
|
||||||
@ -71,25 +23,97 @@ endif(PYTHON_EXECUTABLE)
|
|||||||
# - cmd an additional command to run
|
# - cmd an additional command to run
|
||||||
# - have the result variable to set
|
# - have the result variable to set
|
||||||
########################################################################
|
########################################################################
|
||||||
macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have)
|
macro(GNSSSDR_PYTHON_CHECK_MODULE_RAW desc python_code have)
|
||||||
message(STATUS "Python checking for ${desc}")
|
|
||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${PYTHON_EXECUTABLE} -c "
|
COMMAND ${PYTHON_EXECUTABLE} -c "${python_code}"
|
||||||
#########################################
|
OUTPUT_QUIET ERROR_QUIET
|
||||||
try: import ${mod}
|
RESULT_VARIABLE return_code
|
||||||
except:
|
|
||||||
try: ${mod}
|
|
||||||
except: exit(-1)
|
|
||||||
try: assert ${cmd}
|
|
||||||
except: exit(-1)
|
|
||||||
#########################################"
|
|
||||||
RESULT_VARIABLE ${have}
|
|
||||||
)
|
)
|
||||||
if(${have} EQUAL 0)
|
if(return_code EQUAL 0)
|
||||||
message(STATUS "Python checking for ${desc} - found")
|
message(STATUS "Python checking for ${desc} - found")
|
||||||
set(${have} TRUE)
|
set(${have} TRUE)
|
||||||
else(${have} EQUAL 0)
|
else()
|
||||||
message(STATUS "Python checking for ${desc} - not found")
|
message(STATUS "Python checking for ${desc} - not found")
|
||||||
set(${have} FALSE)
|
set(${have} FALSE)
|
||||||
endif(${have} EQUAL 0)
|
endif()
|
||||||
endmacro(GNSSSDR_PYTHON_CHECK_MODULE)
|
endmacro()
|
||||||
|
|
||||||
|
macro(GNSSSDR_PYTHON_CHECK_MODULE desc mod cmd have)
|
||||||
|
gnsssdr_python_check_module_raw(
|
||||||
|
"${desc}" "
|
||||||
|
#########################################
|
||||||
|
try:
|
||||||
|
import ${mod}
|
||||||
|
assert ${cmd}
|
||||||
|
except (ImportError, AssertionError): exit(-1)
|
||||||
|
except: pass
|
||||||
|
#########################################"
|
||||||
|
"${have}")
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# Setup the python interpreter:
|
||||||
|
# This allows the user to specify a specific interpreter,
|
||||||
|
# or finds the interpreter via the built-in cmake module.
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.12)
|
||||||
|
if(PYTHON_EXECUTABLE)
|
||||||
|
message(STATUS "User set python executable ${PYTHON_EXECUTABLE}")
|
||||||
|
string(FIND "${PYTHON_EXECUTABLE}" "python3" IS_PYTHON3)
|
||||||
|
if(IS_PYTHON3 EQUAL -1)
|
||||||
|
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION} REQUIRED)
|
||||||
|
else()
|
||||||
|
find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
|
||||||
|
endif()
|
||||||
|
gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
|
||||||
|
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
|
||||||
|
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
|
||||||
|
else()
|
||||||
|
message(STATUS "PYTHON_EXECUTABLE not set - trying by default python2")
|
||||||
|
message(STATUS "Use -DPYTHON_EXECUTABLE=/path/to/python3 to build for python3.")
|
||||||
|
find_package(PythonInterp ${GNSSSDR_PYTHON_MIN_VERSION})
|
||||||
|
if(NOT PYTHONINTERP_FOUND)
|
||||||
|
message(STATUS "python2 not found - trying with python3")
|
||||||
|
find_package(PythonInterp ${GNSSSDR_PYTHON3_MIN_VERSION} REQUIRED)
|
||||||
|
endif()
|
||||||
|
gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
|
||||||
|
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
|
||||||
|
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
|
||||||
|
endif()
|
||||||
|
find_package(PythonLibs ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR} EXACT)
|
||||||
|
else()
|
||||||
|
find_package(Python3 COMPONENTS Interpreter)
|
||||||
|
if(Python3_FOUND)
|
||||||
|
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
|
||||||
|
set(PYTHON_VERSION_MAJOR ${Python3_VERSION_MAJOR})
|
||||||
|
gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
|
||||||
|
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
|
||||||
|
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
|
||||||
|
endif()
|
||||||
|
if(NOT Python3_FOUND OR NOT MAKO_FOUND OR NOT SIX_FOUND)
|
||||||
|
find_package(Python2 COMPONENTS Interpreter)
|
||||||
|
if(Python2_FOUND)
|
||||||
|
set(PYTHON_EXECUTABLE ${Python2_EXECUTABLE})
|
||||||
|
set(PYTHON_VERSION_MAJOR ${Python2_VERSION_MAJOR})
|
||||||
|
gnsssdr_python_check_module("python >= ${GNSSSDR_PYTHON_MIN_VERSION}" sys "sys.version.split()[0] >= '${GNSSSDR_PYTHON_MIN_VERSION}'" PYTHON_MIN_VER_FOUND)
|
||||||
|
gnsssdr_python_check_module("mako >= ${GNSSSDR_MAKO_MIN_VERSION}" mako "mako.__version__ >= '${GNSSSDR_MAKO_MIN_VERSION}'" MAKO_FOUND)
|
||||||
|
gnsssdr_python_check_module("six - python 2 and 3 compatibility library" six "True" SIX_FOUND)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(${PYTHON_VERSION_MAJOR} VERSION_EQUAL 3)
|
||||||
|
set(PYTHON3 TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(CMAKE_CROSSCOMPILING)
|
||||||
|
set(QA_PYTHON_EXECUTABLE "/usr/bin/python")
|
||||||
|
else()
|
||||||
|
set(QA_PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# make the path to the executable appear in the cmake gui
|
||||||
|
set(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter")
|
||||||
|
set(QA_PYTHON_EXECUTABLE ${QA_PYTHON_EXECUTABLE} CACHE FILEPATH "python interpreter for QA tests")
|
||||||
|
@ -33,7 +33,7 @@ function(check_arm_version ppdef input_string version output_var)
|
|||||||
string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}")
|
string(REGEX MATCH "${ppdef}" _VERSION_MATCH "${input_string}")
|
||||||
if(NOT _VERSION_MATCH STREQUAL "")
|
if(NOT _VERSION_MATCH STREQUAL "")
|
||||||
set(${output_var} "${version}" PARENT_SCOPE)
|
set(${output_var} "${version}" PARENT_SCOPE)
|
||||||
endif(NOT _VERSION_MATCH STREQUAL "")
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
message(STATUS "Checking for ARM")
|
message(STATUS "Checking for ARM")
|
||||||
@ -41,7 +41,7 @@ message(STATUS "Checking for ARM")
|
|||||||
set(IS_ARM NO)
|
set(IS_ARM NO)
|
||||||
set(ARM_VERSION "")
|
set(ARM_VERSION "")
|
||||||
|
|
||||||
if (CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
execute_process(COMMAND echo "int main(){}"
|
execute_process(COMMAND echo "int main(){}"
|
||||||
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E -
|
COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1} -dM -E -
|
||||||
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
|
OUTPUT_VARIABLE TEST_FOR_ARM_RESULTS)
|
||||||
@ -49,7 +49,7 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
|
string(REGEX MATCH "__arm" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
|
||||||
if(ARM_FOUND STREQUAL "")
|
if(ARM_FOUND STREQUAL "")
|
||||||
string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
|
string(REGEX MATCH "__aarch64" ARM_FOUND "${TEST_FOR_ARM_RESULTS}")
|
||||||
endif(ARM_FOUND STREQUAL "")
|
endif()
|
||||||
|
|
||||||
if(NOT ARM_FOUND STREQUAL "")
|
if(NOT ARM_FOUND STREQUAL "")
|
||||||
set(IS_ARM YES)
|
set(IS_ARM YES)
|
||||||
@ -86,19 +86,18 @@ if (CMAKE_COMPILER_IS_GNUCXX)
|
|||||||
if(ARM_VERSION STREQUAL "")
|
if(ARM_VERSION STREQUAL "")
|
||||||
message(STATUS "Couldn't detect ARM version. Setting to 'arm'")
|
message(STATUS "Couldn't detect ARM version. Setting to 'arm'")
|
||||||
set(ARM_VERSION "arm")
|
set(ARM_VERSION "arm")
|
||||||
else (ARM_VERSION STREQUAL "")
|
else()
|
||||||
message(STATUS "ARM version ${ARM_VERSION} detected")
|
message(STATUS "ARM version ${ARM_VERSION} detected")
|
||||||
endif (ARM_VERSION STREQUAL "")
|
endif()
|
||||||
|
else()
|
||||||
else (NOT ARM_FOUND STREQUAL "")
|
|
||||||
message(STATUS "System is not ARM")
|
message(STATUS "System is not ARM")
|
||||||
endif(NOT ARM_FOUND STREQUAL "")
|
endif()
|
||||||
|
|
||||||
else (CMAKE_COMPILE_IS_GNUCXX)
|
else()
|
||||||
# TODO: Other compilers
|
# TODO: Other compilers
|
||||||
message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false")
|
message(STATUS "Not detecting ARM on non-GNUCXX compiler. Defaulting to false")
|
||||||
message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually")
|
message(STATUS "If you are compiling for ARM, set IS_ARM=ON manually")
|
||||||
endif(CMAKE_COMPILER_IS_GNUCXX)
|
endif()
|
||||||
|
|
||||||
set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM")
|
set(IS_ARM ${IS_ARM} CACHE BOOL "Compiling for ARM")
|
||||||
set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version")
|
set(ARM_VERSION ${ARM_VERSION} CACHE STRING "ARM version")
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
# - Anthony Arnold
|
# - Anthony Arnold
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
||||||
function(test_for_sse h_file result_var name)
|
function(test_for_sse h_file result_var name)
|
||||||
if(NOT DEFINED ${result_var})
|
if(NOT DEFINED ${result_var})
|
||||||
execute_process(COMMAND echo "#include <${h_file}>"
|
execute_process(COMMAND echo "#include <${h_file}>"
|
||||||
@ -33,10 +32,10 @@ function (test_for_sse h_file result_var name)
|
|||||||
if(COMPILE_RESULT EQUAL 0)
|
if(COMPILE_RESULT EQUAL 0)
|
||||||
message(STATUS "Detected ${name}")
|
message(STATUS "Detected ${name}")
|
||||||
set(detected 1)
|
set(detected 1)
|
||||||
endif(COMPILE_RESULT EQUAL 0)
|
endif()
|
||||||
set(${result_var} ${detected} CACHE INTERNAL "${name} Available")
|
set(${result_var} ${detected} CACHE INTERNAL "${name} Available")
|
||||||
endif (NOT DEFINED ${result_var})
|
endif()
|
||||||
endfunction(test_for_sse)
|
endfunction()
|
||||||
|
|
||||||
message(STATUS "Testing for SIMD extensions")
|
message(STATUS "Testing for SIMD extensions")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user