2020-02-11 23:04:29 +00:00
|
|
|
# Copyright (C) 2011-2020 (see AUTHORS file for a list of contributors)
|
|
|
|
#
|
|
|
|
# GNSS-SDR is a software-defined Global Navigation Satellite Systems receiver
|
2018-12-14 17:59:36 +00:00
|
|
|
#
|
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
2020-02-08 00:20:02 +00:00
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
2018-12-14 17:59:36 +00:00
|
|
|
|
2019-11-02 23:55:48 +00:00
|
|
|
#
|
|
|
|
# Provides the following imported target:
|
|
|
|
# Gnuradio::teleorbit
|
|
|
|
#
|
|
|
|
|
2019-06-23 22:24:08 +00:00
|
|
|
if(NOT COMMAND feature_summary)
|
|
|
|
include(FeatureSummary)
|
|
|
|
endif()
|
|
|
|
|
2020-11-01 13:35:15 +00:00
|
|
|
if(NOT PKG_CONFIG_FOUND)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
endif()
|
|
|
|
|
2019-06-23 22:24:08 +00:00
|
|
|
pkg_check_modules(PC_TELEORBIT teleorbit QUIET)
|
2018-12-14 17:59:36 +00:00
|
|
|
|
2020-02-29 13:33:09 +00:00
|
|
|
if(NOT TELEORBIT_ROOT)
|
|
|
|
set(TELEORBIT_ROOT_USER_DEFINED /usr/local)
|
|
|
|
else()
|
|
|
|
set(TELEORBIT_ROOT_USER_DEFINED ${TELEORBIT_ROOT})
|
|
|
|
endif()
|
|
|
|
if(DEFINED ENV{TELEORBIT_ROOT})
|
|
|
|
set(TELEORBIT_ROOT_USER_DEFINED
|
|
|
|
${TELEORBIT_ROOT_USER_DEFINED}
|
|
|
|
$ENV{TELEORBIT_ROOT}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
set(TELEORBIT_ROOT_USER_DEFINED
|
|
|
|
${TELEORBIT_ROOT_USER_DEFINED}
|
|
|
|
${CMAKE_INSTALL_PREFIX}
|
|
|
|
)
|
|
|
|
|
2018-12-14 17:59:36 +00:00
|
|
|
find_path(TELEORBIT_INCLUDE_DIRS
|
|
|
|
NAMES teleorbit/api.h
|
2019-09-30 12:58:34 +00:00
|
|
|
HINTS ${PC_TELEORBIT_INCLUDEDIR}
|
2020-02-29 13:33:09 +00:00
|
|
|
PATHS ${TELEORBIT_ROOT_USER_DEFINED}/include
|
|
|
|
/usr/include
|
2018-12-14 17:59:36 +00:00
|
|
|
/usr/local/include
|
2019-06-24 00:33:53 +00:00
|
|
|
/opt/local/include
|
2018-12-14 17:59:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
find_library(TELEORBIT_LIBRARIES
|
|
|
|
NAMES gnuradio-teleorbit
|
2019-09-30 12:58:34 +00:00
|
|
|
HINTS ${PC_TELEORBIT_LIBDIR}
|
2020-02-29 13:33:09 +00:00
|
|
|
PATHS ${TELEORBIT_ROOT_USER_DEFINED}/lib
|
|
|
|
${TELEORBIT_ROOT_USER_DEFINED}/lib64
|
|
|
|
/usr/lib
|
2019-09-30 12:58:34 +00:00
|
|
|
/usr/lib64
|
2018-12-14 17:59:36 +00:00
|
|
|
/usr/local/lib
|
|
|
|
/usr/local/lib64
|
2019-06-24 00:33:53 +00:00
|
|
|
/opt/local/lib
|
2018-12-14 17:59:36 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(TELEORBIT DEFAULT_MSG TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)
|
2019-02-04 17:17:35 +00:00
|
|
|
|
2019-06-23 22:24:08 +00:00
|
|
|
if(PC_TELEORBIT_VERSION)
|
|
|
|
set(TELEORBIT_VERSION ${PC_TELEORBIT_VERSION})
|
|
|
|
endif()
|
|
|
|
|
2019-06-24 00:33:53 +00:00
|
|
|
if(NOT TELEORBIT_VERSION)
|
2019-06-27 06:47:09 +00:00
|
|
|
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
|
|
|
unset(PACKAGE_VERSION)
|
2019-06-24 00:33:53 +00:00
|
|
|
list(GET TELEORBIT_LIBRARIES 0 FIRST_DIR)
|
|
|
|
get_filename_component(TELEORBIT_LIBRARIES_DIR ${FIRST_DIR} DIRECTORY)
|
|
|
|
if(EXISTS ${TELEORBIT_LIBRARIES_DIR}/cmake/teleorbit/TeleorbitConfigVersion.cmake)
|
|
|
|
include(${TELEORBIT_LIBRARIES_DIR}/cmake/teleorbit/TeleorbitConfigVersion.cmake)
|
|
|
|
endif()
|
|
|
|
if(PACKAGE_VERSION)
|
|
|
|
set(TELEORBIT_VERSION ${PACKAGE_VERSION})
|
|
|
|
endif()
|
2019-06-27 06:47:09 +00:00
|
|
|
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
2019-06-24 00:33:53 +00:00
|
|
|
endif()
|
|
|
|
|
2019-06-23 22:24:08 +00:00
|
|
|
if(TELEORBIT_FOUND AND TELEORBIT_VERSION)
|
|
|
|
set_package_properties(TELEORBIT PROPERTIES
|
|
|
|
DESCRIPTION "The Teleorbit's Flexiband GNU Radio block (found: v${TELEORBIT_VERSION})"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set_package_properties(TELEORBIT PROPERTIES
|
|
|
|
DESCRIPTION "The Teleorbit's Flexiband GNU Radio block."
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2019-02-05 12:28:58 +00:00
|
|
|
if(TELEORBIT_FOUND AND NOT TARGET Gnuradio::teleorbit)
|
|
|
|
add_library(Gnuradio::teleorbit SHARED IMPORTED)
|
|
|
|
set_target_properties(Gnuradio::teleorbit PROPERTIES
|
2019-02-04 17:17:35 +00:00
|
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
|
|
|
IMPORTED_LOCATION "${TELEORBIT_LIBRARIES}"
|
2019-02-05 12:28:58 +00:00
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${TELEORBIT_INCLUDE_DIRS};${TELEORBIT_INCLUDE_DIRS}/teleorbit"
|
2019-02-04 17:17:35 +00:00
|
|
|
INTERFACE_LINK_LIBRARIES "${TELEORBIT_LIBRARIES}"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-12-14 17:59:36 +00:00
|
|
|
mark_as_advanced(TELEORBIT_LIBRARIES TELEORBIT_INCLUDE_DIRS)
|