Skip to content

Commit

Permalink
Make flag optional if libbluetooth is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicgs committed Apr 7, 2014
1 parent 36c1801 commit 1dfd32e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions host/ubertooth-tools/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

find_package(BTBB REQUIRED)
find_package(PCAP)
find_package(BLUETOOTH)

if(MSVC)
include_directories(../getopt)
Expand Down Expand Up @@ -54,13 +55,16 @@ endif()

LIST(APPEND TOOLS ubertooth-rx ubertooth-dump ubertooth-util ubertooth-btle)

if(USE_BLUEZ)
find_package(BLUETOOTH REQUIRED)
if ( ${LIBBLUETOOTH_FOUND} )
LIST(APPEND TOOLS ubertooth-follow ubertooth-scan)
include_directories(${LIBBLUETOOTH_INCLUDE_DIR})
LIST(APPEND TOOLS_LINK_LIBS ${LIBBLUETOOTH_LIBRARIES})
endif()
if( USE_BLUEZ AND NOT ${LIBBLUETOOTH_FOUND} )
message( FATAL_ERROR
"Cannot find libbluetooth, which is required for USE_BLUEZ")

endif()

if ( ${LIBBLUETOOTH_FOUND} )
LIST(APPEND TOOLS ubertooth-follow ubertooth-scan)
include_directories(${LIBBLUETOOTH_INCLUDE_DIR})
LIST(APPEND TOOLS_LINK_LIBS ${LIBBLUETOOTH_LIBRARIES})
endif()

foreach(tool ${TOOLS})
Expand Down

0 comments on commit 1dfd32e

Please sign in to comment.