1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 12:10:34 +00:00
gnss-sdr/cmake/Modules/FindTELEORBIT.cmake

102 lines
3.3 KiB
CMake
Raw Normal View History

2018-12-14 17:59:36 +00:00
# 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/>.
2019-11-02 23:55:48 +00:00
#
# Provides the following imported target:
# Gnuradio::teleorbit
#
if(NOT COMMAND feature_summary)
include(FeatureSummary)
endif()
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH TRUE)
2018-12-14 17:59:36 +00:00
include(FindPkgConfig)
pkg_check_modules(PC_TELEORBIT teleorbit QUIET)
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}
PATHS /usr/include
2018-12-14 17:59:36 +00:00
/usr/local/include
2019-06-24 00:33:53 +00:00
/opt/local/include
2019-09-30 12:58:34 +00:00
${CMAKE_INSTALL_PREFIX}/include
2018-12-14 17:59:36 +00:00
${TELEORBIT_ROOT}/include
$ENV{TELEORBIT_ROOT}/include
2019-09-30 12:58:34 +00:00
$ENV{TELEORBIT_DIR}/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}
PATHS /usr/lib
/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
2019-09-30 12:58:34 +00:00
${CMAKE_INSTALL_PREFIX}/lib
${CMAKE_INSTALL_PREFIX}/lib64
2018-12-14 17:59:36 +00:00
${TELEORBIT_ROOT}/lib
$ENV{TELEORBIT_ROOT}/lib
${TELEORBIT_ROOT}/lib64
$ENV{TELEORBIT_ROOT}/lib64
2019-09-30 12:58:34 +00:00
$ENV{TELEORBIT_DIR}/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
if(PC_TELEORBIT_VERSION)
set(TELEORBIT_VERSION ${PC_TELEORBIT_VERSION})
endif()
2019-06-24 00:33:53 +00:00
if(NOT TELEORBIT_VERSION)
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()
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
2019-06-24 00:33:53 +00:00
endif()
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)