1
# - Try to find PilotLink
2
# Find PilotLink headers, libraries and the answer to all questions.
4
# PILOTLINK_FOUND True if PilotLink got found
5
# PILOTLINK_INCLUDE_DIRS Location of PilotLink headers
6
# PILOTLINK_LIBRARIES List of libaries to use PilotLink
7
# PILOTLINK_DEFINITIONS Definitions to compile PilotLink
9
# Copyright (c) 2007 Daniel Gollub <gollub@b1-systems.de>
10
# Copyright (c) 2008 Bjoern Ricks <bjoern.ricks@googlemail.com>
12
# Redistribution and use is allowed according to the terms of the New
14
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
17
INCLUDE( FindPkgConfig )
19
IF ( PilotLink_FIND_REQUIRED )
20
SET( _pkgconfig_REQUIRED "REQUIRED" )
21
ELSE( PilotLink_FIND_REQUIRED )
22
SET( _pkgconfig_REQUIRED "" )
23
ENDIF ( PilotLink_FIND_REQUIRED )
25
IF ( PILOTLINK_MIN_VERSION )
26
PKG_SEARCH_MODULE( PILOTLINK ${_pkgconfig_REQUIRED} pilot-link>=${PILOTLINK_MIN_VERSION} )
27
ELSE ( PILOTLINK_MIN_VERSION )
28
PKG_SEARCH_MODULE( PILOTLINK ${_pkgconfig_REQUIRED} pilot-link )
29
ENDIF ( PILOTLINK_MIN_VERSION )
32
IF( NOT PILOTLINK_FOUND AND NOT PKG_CONFIG_FOUND )
33
FIND_PATH( PILOTLINK_INCLUDE_DIRS pilot-link )
34
FIND_LIBRARY( PILOTLINK_LIBRARIES pisock)
37
IF ( PILOTLINK_LIBRARIES AND PILOTLINK_INCLUDE_DIRS )
38
SET( PILOTLINK_FOUND 1 )
39
IF ( NOT PilotLink_FIND_QUIETLY )
40
MESSAGE( STATUS "Found PilotLink: ${PILOTLINK_LIBRARIES}" )
41
ENDIF ( NOT PilotLink_FIND_QUIETLY )
42
ELSE ( PILOTLINK_LIBRARIES AND PILOTLINK_INCLUDE_DIRS )
43
IF ( PilotLink_FIND_REQUIRED )
44
MESSAGE( SEND_ERROR "Could NOT find PilotLink" )
45
ELSE ( PilotLink_FIND_REQUIRED )
46
IF ( NOT PilotLink_FIND_QUIETLY )
47
MESSAGE( STATUS "Could NOT find PilotLink" )
48
ENDIF ( NOT PilotLink_FIND_QUIETLY )
49
ENDIF ( PilotLink_FIND_REQUIRED )
50
ENDIF ( PILOTLINK_LIBRARIES AND PILOTLINK_INCLUDE_DIRS )
51
ENDIF( NOT PILOTLINK_FOUND AND NOT PKG_CONFIG_FOUND )
53
# Hide advanced variables from CMake GUIs
54
MARK_AS_ADVANCED( PILOTLINK_LIBRARIES PILOTLINK_INCLUDE_DIRS )