2021-03-07 02:40:21 +02:00
|
|
|
# Try to find GPS library, once done this will define:
|
2020-04-02 09:30:20 +00:00
|
|
|
#
|
|
|
|
# LIBGPS_FOUND - system has GPS library
|
|
|
|
# LIBGPS_INCLUDE_DIR - the GPS library include directory
|
|
|
|
# LIBGPS_LIBRARIES - the libraries needed to use GPS library
|
|
|
|
#
|
2021-03-07 02:40:21 +02:00
|
|
|
# Copyright (c) 2020 Ivailo Monev <xakepa10@gmail.com>
|
2020-04-02 09:30:20 +00:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
2015-11-16 12:03:14 +02:00
|
|
|
|
2020-04-02 09:30:20 +00:00
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_LIBGPS QUIET libgps)
|
2015-11-16 12:03:14 +02:00
|
|
|
|
2020-04-02 09:30:20 +00:00
|
|
|
set(LIBGPS_INCLUDE_DIR ${PC_LIBGPS_INCLUDE_DIRS})
|
|
|
|
set(LIBGPS_LIBRARIES ${PC_LIBGPS_LIBRARIES})
|
|
|
|
endif()
|
2015-11-16 12:03:14 +02:00
|
|
|
|
2020-04-02 09:30:20 +00:00
|
|
|
set(LIBGPS_VERSION ${PC_LIBGPS_VERSION})
|
2015-11-16 12:03:14 +02:00
|
|
|
|
2020-04-02 09:30:20 +00:00
|
|
|
if(NOT LIBGPS_INCLUDE_DIR OR NOT LIBGPS_LIBRARIES)
|
|
|
|
find_path(LIBGPS_INCLUDE_DIR
|
|
|
|
NAMES gps.h
|
|
|
|
HINTS $ENV{LIBGPSDIR}/include
|
|
|
|
)
|
|
|
|
|
|
|
|
find_library(LIBGPS_LIBRARIES
|
|
|
|
NAMES gps
|
|
|
|
HINTS $ENV{LIBGPSDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(LibGPS
|
|
|
|
VERSION_VAR LIBGPS_VERSION
|
|
|
|
REQUIRED_VARS LIBGPS_LIBRARIES LIBGPS_INCLUDE_DIR
|
|
|
|
)
|
|
|
|
|
|
|
|
mark_as_advanced(LIBGPS_INCLUDE_DIR LIBGPS_LIBRARIES)
|