mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-26 00:46:59 +00:00
Update CMake modules
This commit is contained in:
parent
d4680a85cb
commit
31c6b6bc1d
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)
|
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)
|
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)
|
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)
|
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()
|
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)
|
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)
|
Loading…
Reference in New Issue
Block a user