2 # CWIID_FOUND - If false, do not try to use CWiid.
3 # CWIID_INCLUDE_DIRS - where to find cwiid.h
4 # CWIID_LIBRARIES - the libraries to link against
6 find_package(Bluetooth)
8 if (CWIID_LIBRARIES AND CWIID_INCLUDE_DIRS AND BLUETOOTH_FOUND)
9 # path set by user or was found in the past
11 else (CWIID_LIBRARIES AND CWIID_INCLUDE_DIRS AND BLUETOOTH_FOUND)
12 find_path(CWIID_INCLUDE_DIRS
16 find_library(CWIID_LIBRARY
20 set(CWIID_LIBRARIES ${BLUETOOTH_LIBRARIES} ${CWIID_LIBRARY})
22 if (CWIID_INCLUDE_DIRS AND CWIID_LIBRARIES AND BLUETOOTH_FOUND)
24 endif (CWIID_INCLUDE_DIRS AND CWIID_LIBRARIES AND BLUETOOTH_FOUND)
27 if (NOT CWIID_FIND_QUIETLY)
28 message(STATUS "Found CWiid: ${CWIID_LIBRARIES}")
29 endif (NOT CWIID_FIND_QUIETLY)
31 if (CWIID_FIND_REQUIRED)
32 if (NOT BLUETOOTH_FOUND)
33 message(FATAL_ERROR "Could not find dependency Bluetooth for CWiid")
34 else (NOT BLUETOOTH_FOUND)
35 message(FATAL_ERROR "Could not find CWiid")
36 endif (NOT BLUETOOTH_FOUND)
37 endif (CWIID_FIND_REQUIRED)
40 # set visibility in cache
41 mark_as_advanced(CWIID_INCLUDE_DIRS CWIID_LIBRARY CWIID_LIBRARIES)
43 endif (CWIID_LIBRARIES AND CWIID_INCLUDE_DIRS AND BLUETOOTH_FOUND)