File: FindGPSD.cmake

package info (click to toggle)
qmapshack 1.12.3-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 50,532 kB
  • sloc: cpp: 379,209; python: 1,046; sh: 621; xml: 210; awk: 21; makefile: 10; ansic: 1
file content (72 lines) | stat: -rw-r--r-- 1,771 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# - Try to find GPSD
# Once done this will define
#
#  GPSD_FOUND - system has GPSD
#  GPSD_INCLUDE_DIRS - the GPSD include directory
#  GPSD_LIBRARIES - Link these to use GPSD
#  GPSD_DEFINITIONS - Compiler switches required for using GPSD
#
#  Copyright (c) 2006 Andreas Schneider <mail@cynapses.org>
#
#  Redistribution and use is allowed according to the terms of the New
#  BSD license.
#  For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#


if (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS)
  # in cache already
  set(GPSD_FOUND TRUE)
else (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS)
  find_path(GPSD_INCLUDE_DIRS
    NAMES
      gps.h
    PATHS
        /usr/include
        /usr/local/include
        /opt/local/include
        /sw/include
        /usr/include/gps
        /usr/local/include/gps
        /opt/local/include/gps
        /sw/include/gps
  )

  # debian uses version suffixes
  # add suffix evey new release
  find_library(GPSD_LIBRARIES
    NAMES
        gps
    PATHS
      /usr/lib64
      /usr/lib
      /usr/local/lib
      /opt/local/lib
      /sw/lib
  )

  if (GPSD_INCLUDE_DIRS AND GPSD_LIBRARIES)
     set(GPSD_FOUND TRUE)
  endif (GPSD_INCLUDE_DIRS AND GPSD_LIBRARIES)

  if (GPSD_FOUND)
    if (NOT GPSD_FIND_QUIETLY)
      message(STATUS "Found GPSD: ${GPSD_LIBRARIES}")
    endif (NOT GPSD_FIND_QUIETLY)
  else (GPSD_FOUND)
    if (GPSD_FIND_REQUIRED)
      message(FATAL_ERROR "Could not find GPSD")
    endif (GPSD_FIND_REQUIRED)
  endif (GPSD_FOUND)

  # show the GPSD_INCLUDE_DIRS and GPSD_LIBRARIES variables only in the advanced view
  mark_as_advanced(GPSD_INCLUDE_DIRS GPSD_LIBRARIES)

endif (GPSD_LIBRARIES AND GPSD_INCLUDE_DIRS)

if (WIN32)
set(GPSD_FOUND FALSE)
set(GPSD_LIBRARIES "")
set(GPSD_INCLUDE_DIRS "")
endif (WIN32)