File and Pipe: set fileptr to nil on close() (HJH requested fix)
[supercollider.git] / cmake_modules / FindBluetooth.cmake
blob4824dc4cbe39eaad3f164d0bb77d03d4faeee1a2
1 # Try to find Bluetooth
2 #  BLUETOOTH_FOUND - If false, do not try to use Bluetooth.
3 #  BLUETOOTH_INCLUDE_DIRS - where to find bluetooth/bluetooth.h
4 #  BLUETOOTH_LIBRARIES - the libraries to link against
7 if (BLUETOOTH_LIBRARIES AND BLUETOOTH_INCLUDE_DIRS)
8         # path set by user or was found in the past
9         set(BLUETOOTH_FOUND TRUE)
10 else (BLUETOOTH_LIBRARIES AND BLUETOOTH_INCLUDE_DIRS)
11         find_path(BLUETOOTH_INCLUDE_DIRS
12                 NAMES bluetooth/bluetooth.h
13         )
15         find_library(BLUETOOTH_LIBRARIES
16                 NAMES bluetooth
17         )
19         if (BLUETOOTH_INCLUDE_DIRS AND BLUETOOTH_LIBRARIES)
20                 set(BLUETOOTH_FOUND TRUE)
21         endif (BLUETOOTH_INCLUDE_DIRS AND BLUETOOTH_LIBRARIES)
23         if (BLUETOOTH_FOUND)
24                 if (NOT BLUETOOTH_FIND_QUIETLY)
25                         message(STATUS "Found Bluetooth: ${BLUETOOTH_LIBRARIES}")
26                 endif (NOT BLUETOOTH_FIND_QUIETLY)
27         else (BLUETOOTH_FOUND)
28                 if (BLUETOOTH_FIND_REQUIRED)
29                         message(FATAL_ERROR "Could not find Bluetooth")
30                 endif (BLUETOOTH_FIND_REQUIRED)
31         endif (BLUETOOTH_FOUND)
33         # set visibility in cache
34         mark_as_advanced(BLUETOOTH_INCLUDE_DIRS BLUETOOTH_LIBRARIES)
36 endif (BLUETOOTH_LIBRARIES AND BLUETOOTH_INCLUDE_DIRS)