| 1 |
# - Find BlueZ library |
| 2 |
# This module defines |
| 3 |
# BlueZ_INCLUDE_DIR |
| 4 |
# BlueZ_LIBRARIES |
| 5 |
# BlueZ_FOUND |
| 6 |
# |
| 7 |
# vim: expandtab sw=4 ts=4 sts=4: |
| 8 |
|
| 9 |
find_package(PkgConfig QUIET) |
| 10 |
pkg_check_modules (BlueZ_PKG QUIET bluez) |
| 11 |
|
| 12 |
find_path(BlueZ_INCLUDE_DIR NAMES bluetooth/bluetooth.h |
| 13 |
PATHS |
| 14 |
${BlueZ_PKG_INCLUDE_DIRS} |
| 15 |
/usr/include/bluetooth |
| 16 |
/usr/include |
| 17 |
/usr/local/include/bluetooth |
| 18 |
/usr/local/include |
| 19 |
) |
| 20 |
|
| 21 |
find_library(BlueZ_LIBRARIES NAMES bluetooth |
| 22 |
PATHS |
| 23 |
${BlueZ_PKG_LIBRARY_DIRS} |
| 24 |
/usr/lib |
| 25 |
/usr/local/lib |
| 26 |
) |
| 27 |
|
| 28 |
include(FindPackageHandleStandardArgs) |
| 29 |
find_package_handle_standard_args(BlueZ |
| 30 |
REQUIRED_VARS BlueZ_LIBRARIES BlueZ_INCLUDE_DIR) |
| 31 |
|
| 32 |
if(BlueZ_FOUND) |
| 33 |
if(NOT TARGET BlueZ::BlueZ) |
| 34 |
add_library(BlueZ::BlueZ UNKNOWN IMPORTED) |
| 35 |
set_target_properties(BlueZ::BlueZ PROPERTIES |
| 36 |
IMPORTED_LOCATION ${BlueZ_LIBRARIES} |
| 37 |
INTERFACE_INCLUDE_DIRECTORIES ${BlueZ_INCLUDE_DIR} |
| 38 |
) |
| 39 |
endif() |
| 40 |
endif() |
| 41 |
|
| 42 |
mark_as_advanced(BlueZ_INCLUDE_DIR BlueZ_LIBRARIES) |