Annotation of qmapshack/navipowm/files/FindGps.cmake, Revision 1.1
1.1 ! kirby 1: # - Try to find GPS
! 2: # Once done this will define
! 3: #
! 4: # GPS_FOUND - system has GPS
! 5: # GPS_INCLUDE_DIRS - the GPS include directory
! 6: # GPS_LIBRARIES - Link these to use GPS
! 7: # GPS_DEFINITIONS - Compiler switches required for using GPS
! 8: #
! 9: # Copyright (c) 2007 Andreas Schneider <mail@cynapses.org>
! 10: # Copyright (c) 2008 Guenther Meyer <d.s.e (at) sordidmusic.com>
! 11: #
! 12: # Redistribution and use is allowed according to the terms of the New
! 13: # BSD license.
! 14: # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
! 15: #
! 16:
! 17: if (GPS_LIBRARIES AND GPS_INCLUDE_DIRS)
! 18: # in cache already
! 19: set(GPS_FOUND TRUE)
! 20: else (GPS_LIBRARIES AND GPS_INCLUDE_DIRS)
! 21: # use pkg-config to get the directories and then use these values
! 22: # in the FIND_PATH() and FIND_LIBRARY() calls
! 23: include(UsePkgConfig)
! 24:
! 25: pkgconfig(libgps _GPSIncDir _GPSLinkDir _GPSLinkFlags _GPSCflags)
! 26:
! 27: set(GPS_DEFINITIONS ${_GPSCflags})
! 28:
! 29: find_path(GPS_INCLUDE_DIR
! 30: NAMES
! 31: gps.h
! 32: PATHS
! 33: ${_GPSIncDir}
! 34: /usr/include
! 35: /usr/local/include
! 36: /opt/local/include
! 37: /sw/include
! 38: )
! 39:
! 40: find_library(GPS_LIBRARY
! 41: NAMES
! 42: gps
! 43: PATHS
! 44: ${_GPSLinkDir}
! 45: /usr/lib
! 46: /usr/local/lib
! 47: /opt/local/lib
! 48: /sw/lib
! 49: )
! 50:
! 51: set(GPS_INCLUDE_DIRS
! 52: ${GPS_INCLUDE_DIR}
! 53: )
! 54: set(GPS_LIBRARIES
! 55: ${GPS_LIBRARY}
! 56: )
! 57:
! 58: if (GPS_INCLUDE_DIRS AND GPS_LIBRARIES)
! 59: set(GPS_FOUND TRUE)
! 60: endif (GPS_INCLUDE_DIRS AND GPS_LIBRARIES)
! 61:
! 62: if (GPS_FOUND)
! 63: if (NOT GPS_FIND_QUIETLY)
! 64: message(STATUS "Found GPS: ${GPS_LIBRARIES}")
! 65: endif (NOT GPS_FIND_QUIETLY)
! 66: else (GPS_FOUND)
! 67: if (GPS_FIND_REQUIRED)
! 68: message(FATAL_ERROR "Could not find GPS")
! 69: endif (GPS_FIND_REQUIRED)
! 70: endif (GPS_FOUND)
! 71:
! 72: # show the GPS_INCLUDE_DIRS and GPS_LIBRARIES variables only in the advanced view
! 73: mark_as_advanced(GPS_INCLUDE_DIRS GPS_LIBRARIES)
! 74:
! 75: endif (GPS_LIBRARIES AND GPS_INCLUDE_DIRS)
! 76:
CVSweb