File: FindIrda.cmake

package info (click to toggle)
libopenobex 1.7.2-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 972 kB
  • sloc: ansic: 9,988; xml: 407; makefile: 28
file content (43 lines) | stat: -rw-r--r-- 1,192 bytes parent folder | download | duplicates (7)
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
# - Find system default IrDA implementation
#
# On Linux it will use PkgConfig if present and supported,
# else and on all other architectures, it looks for it on its own.
# The following standard variables get defined:
#  Irda_FOUND:        true if Irda was found
#  Irda_INCLUDE_DIRS: the directory that contains the include file
#  Irda_LIBRARIES:    full path to the libraries

include ( CheckCSourceCompiles )

if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
  set ( Irda_FOUND true )

elseif ( WIN32 )
  CHECK_C_SOURCE_COMPILES (
    "#include <winsock2.h>
     #include <af_irda.h>
     int main () {
       return 0;
     }"
    Irda_FOUND
  )

else ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )
  set ( ${Irda_FOUND} no )

endif ( CMAKE_SYSTEM_NAME STREQUAL "Linux" )

if ( Irda_FOUND )
  set ( Irda_FOUND true )
else ( Irda_FOUND )
  set ( Irda_FOUND false )
endif ( Irda_FOUND )

if ( NOT Irda_FOUND )
  if ( NOT Irda_FIND_QUIETLY )
    message ( STATUS "Irda not found." )
  endif ( NOT Irda_FIND_QUIETLY )
  if ( Irda_FIND_REQUIRED )
    message ( FATAL_ERROR "Irda not found but required." )
  endif ( Irda_FIND_REQUIRED )
endif ( NOT Irda_FOUND )