2020-12-30 12:35:06 +00:00
|
|
|
# GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2018-12-12 00:37:37 +00:00
|
|
|
# This file is part of GNSS-SDR.
|
|
|
|
#
|
2020-12-30 12:35:06 +00:00
|
|
|
# SPDX-FileCopyrightText: 2011-2020 C. Fernandez-Prades cfernandez(at)cttc.es
|
|
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
2018-12-12 00:37:37 +00:00
|
|
|
|
|
|
|
# - Find gpstk library
|
|
|
|
# Find the native gpstk includes and library
|
|
|
|
# This module defines
|
|
|
|
# GPSTK_INCLUDE_DIR, where to find Rinex3ObsBase.hpp, etc.
|
|
|
|
# GPSTK_FOUND, If false, do not try to use GPSTK.
|
|
|
|
# GPSTK_LIBRARY, where to find the GPSTK library.
|
2019-11-02 23:55:48 +00:00
|
|
|
#
|
|
|
|
# Provides the following imported target:
|
|
|
|
# Gpstk::gpstk
|
|
|
|
#
|
2018-12-12 00:37:37 +00:00
|
|
|
|
2019-06-21 00:49:41 +00:00
|
|
|
if(NOT COMMAND feature_summary)
|
|
|
|
include(FeatureSummary)
|
|
|
|
endif()
|
|
|
|
|
2020-02-29 13:33:09 +00:00
|
|
|
if(NOT GPSTK_ROOT)
|
|
|
|
set(GPSTK_ROOT_USER_DEFINED /usr/local)
|
|
|
|
else()
|
|
|
|
set(GPSTK_ROOT_USER_DEFINED ${GPSTK_ROOT})
|
|
|
|
endif()
|
|
|
|
if(DEFINED ENV{GPSTK_ROOT})
|
|
|
|
set(GPSTK_ROOT_USER_DEFINED
|
|
|
|
${GPSTK_ROOT_USER_DEFINED}
|
|
|
|
$ENV{GPSTK_ROOT}
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2018-12-12 00:37:37 +00:00
|
|
|
find_path(GPSTK_INCLUDE_DIR gpstk/Rinex3ObsBase.hpp
|
2020-02-29 13:33:09 +00:00
|
|
|
PATHS ${GPSTK_ROOT_USER_DEFINED}/include
|
|
|
|
/usr/include
|
2018-12-12 00:37:37 +00:00
|
|
|
/usr/local/include
|
|
|
|
/opt/local/include
|
|
|
|
)
|
|
|
|
|
2020-02-29 13:33:09 +00:00
|
|
|
set(GPSTK_NAMES gpstk libgpstk)
|
2018-12-12 00:37:37 +00:00
|
|
|
|
2019-02-03 18:24:44 +00:00
|
|
|
include(GNUInstallDirs)
|
|
|
|
|
2018-12-12 00:37:37 +00:00
|
|
|
find_library(GPSTK_LIBRARY NAMES ${GPSTK_NAMES}
|
2020-02-29 13:33:09 +00:00
|
|
|
PATHS ${GPSTK_ROOT_USER_DEFINED}/lib
|
|
|
|
${GPSTK_ROOT_USER_DEFINED}/${CMAKE_INSTALL_LIBDIR}
|
2018-12-12 00:37:37 +00:00
|
|
|
/usr/local/lib
|
2019-02-03 18:24:44 +00:00
|
|
|
/usr/${CMAKE_INSTALL_LIBDIR}
|
|
|
|
/usr/local/${CMAKE_INSTALL_LIBDIR}
|
2018-12-12 00:37:37 +00:00
|
|
|
/opt/local/lib
|
|
|
|
)
|
|
|
|
|
2019-06-19 18:54:45 +00:00
|
|
|
# handle the QUIET and REQUIRED arguments and set GPSTK_FOUND to TRUE if
|
2018-12-12 00:37:37 +00:00
|
|
|
# all listed variables are TRUE
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(GPSTK DEFAULT_MSG GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|
2019-06-19 18:54:45 +00:00
|
|
|
|
|
|
|
if(GPSTK_FOUND)
|
2019-06-27 06:47:09 +00:00
|
|
|
set(OLD_PACKAGE_VERSION ${PACKAGE_VERSION})
|
|
|
|
unset(PACKAGE_VERSION)
|
2019-06-19 18:54:45 +00:00
|
|
|
if(EXISTS ${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
|
|
|
include(${CMAKE_INSTALL_FULL_DATADIR}/cmake/GPSTK/GPSTKConfigVersion.cmake)
|
|
|
|
endif()
|
|
|
|
if(PACKAGE_VERSION)
|
|
|
|
set(GPSTK_VERSION ${PACKAGE_VERSION})
|
|
|
|
endif()
|
2019-06-27 06:47:09 +00:00
|
|
|
set(PACKAGE_VERSION ${OLD_PACKAGE_VERSION})
|
2019-06-19 18:54:45 +00:00
|
|
|
endif()
|
|
|
|
|
2019-06-21 00:49:41 +00:00
|
|
|
if(GPSTK_FOUND AND GPSTK_VERSION)
|
|
|
|
set_package_properties(GPSTK PROPERTIES
|
|
|
|
DESCRIPTION "Library and suite of applications for satellite navigation (found: v${GPSTK_VERSION})"
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
set_package_properties(GPSTK PROPERTIES
|
|
|
|
DESCRIPTION "Library and suite of applications for satellite navigation"
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2020-12-02 13:27:59 +00:00
|
|
|
if(GPSTK_FOUND AND NOT EXISTS ${GPSTK_INCLUDE_DIR}/gpstk/SatelliteSystem.hpp)
|
|
|
|
set(GPSTK_OLDER_THAN_8 TRUE)
|
|
|
|
endif()
|
|
|
|
|
2019-06-21 00:49:41 +00:00
|
|
|
set_package_properties(GPSTK PROPERTIES
|
2020-02-05 20:24:46 +00:00
|
|
|
URL "https://github.com/SGL-UT/GPSTk"
|
2019-06-21 00:49:41 +00:00
|
|
|
)
|
|
|
|
|
2019-08-20 21:02:48 +00:00
|
|
|
if(GPSTK_FOUND AND NOT ENABLE_OWN_GPSTK AND NOT TARGET Gpstk::gpstk)
|
2019-02-03 18:24:44 +00:00
|
|
|
add_library(Gpstk::gpstk SHARED IMPORTED)
|
|
|
|
set_target_properties(Gpstk::gpstk PROPERTIES
|
|
|
|
IMPORTED_LINK_INTERFACE_LANGUAGES "CXX"
|
|
|
|
IMPORTED_LOCATION "${GPSTK_LIBRARY}"
|
|
|
|
INTERFACE_INCLUDE_DIRECTORIES "${GPSTK_INCLUDE_DIR};${GPSTK_INCLUDE_DIR}/gpstk"
|
|
|
|
INTERFACE_LINK_LIBRARIES "${GPSTK_LIBRARY}"
|
|
|
|
)
|
|
|
|
endif()
|
2019-08-20 21:02:48 +00:00
|
|
|
|
|
|
|
mark_as_advanced(GPSTK_LIBRARY GPSTK_INCLUDE_DIR)
|