2019-02-04 17:17:35 +00:00
|
|
|
# Copyright (C) 2011-2019 (see AUTHORS file for a list of contributors)
|
2018-12-14 17:59:36 +00:00
|
|
|
#
|
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
|
|
|
# GNSS-SDR is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (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
|
|
|
|
########################################################################
|
|
|
|
|
2019-11-02 23:55:48 +00:00
|
|
|
#
|
|
|
|
# Provides the following imported target:
|
|
|
|
# Gnuradio::gn3s
|
|
|
|
#
|
|
|
|
|
2019-06-19 19:01:36 +00:00
|
|
|
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
|
2018-12-14 17:59:36 +00:00
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_GR_GN3S gr-gn3s)
|
|
|
|
|
|
|
|
find_path(
|
|
|
|
GR_GN3S_INCLUDE_DIRS
|
|
|
|
NAMES gn3s/gn3s_api.h
|
2019-09-30 12:58:34 +00:00
|
|
|
HINTS ${PC_GR_GN3S_INCLUDEDIR}
|
|
|
|
PATHS /usr/include
|
2018-12-14 17:59:36 +00:00
|
|
|
/usr/local/include
|
2019-09-30 12:58:34 +00:00
|
|
|
/opt/local/include
|
|
|
|
${CMAKE_INSTALL_PREFIX}/include
|
2018-12-14 17:59:36 +00:00
|
|
|
${GRGN3S_ROOT}/include
|
|
|
|
$ENV{GRGN3S_ROOT}/include
|
2019-09-30 12:58:34 +00:00
|
|
|
$ENV{GR_GN3S_DIR}/include
|
2018-12-14 17:59:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
find_library(
|
|
|
|
GR_GN3S_LIBRARIES
|
|
|
|
NAMES gr-gn3s
|
2019-09-30 12:58:34 +00:00
|
|
|
HINTS ${PC_GR_GN3S_LIBDIR}
|
|
|
|
PATHS /usr/lib
|
|
|
|
/usr/lib64
|
2018-12-14 17:59:36 +00:00
|
|
|
/usr/local/lib
|
|
|
|
/usr/local/lib64
|
2019-09-30 12:58:34 +00:00
|
|
|
/opt/local/lib
|
|
|
|
${CMAKE_INSTALL_PREFIX}/lib
|
|
|
|
${CMAKE_INSTALL_PREFIX}/lib64
|
2018-12-14 17:59:36 +00:00
|
|
|
${GRGN3S_ROOT}/lib
|
|
|
|
$ENV{GRGN3S_ROOT}/lib
|
|
|
|
${GRGN3S_ROOT}/lib64
|
|
|
|
$ENV{GRGN3S_ROOT}/lib64
|
2019-09-30 12:58:34 +00:00
|
|
|
$ENV{GR_GN3S_DIR}/lib
|
2018-12-14 17:59:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(GRGN3S DEFAULT_MSG GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)
|
2019-02-04 17:17:35 +00:00
|
|
|
|
|
|
|
if(GRGN3S_FOUND AND NOT TARGET Gnuradio::gn3s)
|
|
|
|
add_library(Gnuradio::gn3s SHARED IMPORTED)
|
|
|
|
set_target_properties(Gnuradio::gn3s PROPERTIES
|
|
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
|
|
|
IMPORTED_LOCATION "${GR_GN3S_LIBRARIES}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${GR_GN3S_INCLUDE_DIRS}"
|
|
|
|
INTERFACE_LINK_LIBRARIES "${GR_GN3S_LIBRARIES}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-12-14 17:59:36 +00:00
|
|
|
mark_as_advanced(GR_GN3S_LIBRARIES GR_GN3S_INCLUDE_DIRS)
|