Debian Codegraph @

CMakeModules/FindGsm.cmake

raw
1 # - Try to find GSM
2 # Once done this will define
3 #
4 # GSM_FOUND - system has GSM
5 # GSM_INCLUDE_DIRS - the GSM include directory
6 # GSM_LIBRARIES - Link these to use GSM
7 # GSM_DEFINITIONS - Compiler switches required for using GSM
8 #
9 # Copyright (c) 2006 Andreas Schneider <[email protected]>
10 # Edited by Saikrishna Arcot <[email protected]> to find the GSM library
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
18 if (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
19 # in cache already
20 set(GSM_FOUND TRUE)
21 else (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)
22
23 set(GSM_DEFINITIONS "")
24
25 # gsm.h might be at $prefix/include/gsm/gsm.h, but our internal
26 # version is at inc/gsm.h, so we need to include that as a PATH_SUFFIX
27 # otherwise we get into a mess.
28 # see: https://sourceforge.net/p/flightgear/codetickets/2368/
29 find_path(GSM_INCLUDE_DIR
30 NAMES
31 gsm.h
32 PATHS
33 ${_GsmIncDir}
34 /usr/include
35 /usr/local/include
36 /opt/local/include
37 /sw/include
38 PATH_SUFFIXES
39 gsm
40 )
41
42 find_library(GSM_LIBRARY
43 NAMES
44 gsm
45 Gsm
46 PATHS
47 ${_GsmLinkDir}
48 /usr/lib
49 /usr/local/lib
50 /opt/local/lib
51 /sw/lib
52 )
53
54 if (GSM_LIBRARY)
55 set(GSM_FOUND TRUE)
56 endif (GSM_LIBRARY)
57
58 set(GSM_INCLUDE_DIRS
59 ${GSM_INCLUDE_DIR}
60 )
61
62 if (GSM_FOUND)
63 set(GSM_LIBRARIES
64 ${GSM_LIBRARIES}
65 ${GSM_LIBRARY}
66 )
67 endif (GSM_FOUND)
68
69 if (GSM_INCLUDE_DIRS AND GSM_LIBRARIES)
70 set(GSM_FOUND TRUE)
71 endif (GSM_INCLUDE_DIRS AND GSM_LIBRARIES)
72
73 if (GSM_FOUND)
74 if (NOT Gsm_FIND_QUIETLY)
75 message(STATUS "Found GSM: ${GSM_LIBRARIES}")
76 endif (NOT Gsm_FIND_QUIETLY)
77 else (GSM_FOUND)
78 if (Gsm_FIND_REQUIRED)
79 message(FATAL_ERROR "Could not find GSM")
80 endif (Gsm_FIND_REQUIRED)
81 endif (GSM_FOUND)
82
83 # show the GSM_INCLUDE_DIRS and GSM_LIBRARIES variables only in the advanced view
84 mark_as_advanced(GSM_INCLUDE_DIRS GSM_LIBRARIES)
85
86 endif (GSM_LIBRARIES AND GSM_INCLUDE_DIRS)