mirror of https://github.com/labapart/gattlib
Added Bluez pkg-config and expose its version to the build system
parent
db5ffbf47d
commit
36a267bfa7
|
@ -51,6 +51,17 @@ pkg_search_module(GLIB REQUIRED glib-2.0)
|
||||||
include_directories(${GLIB_INCLUDE_DIRS})
|
include_directories(${GLIB_INCLUDE_DIRS})
|
||||||
list(APPEND gattlib_LIBS ${GLIB_LIBRARIES})
|
list(APPEND gattlib_LIBS ${GLIB_LIBRARIES})
|
||||||
|
|
||||||
|
# Added Bluetooth support
|
||||||
|
pkg_search_module(BLUEZ REQUIRED bluez)
|
||||||
|
include_directories(${BLUEZ_INCLUDE_DIRS})
|
||||||
|
link_directories(${BLUEZ_LIBRARY_DIRS})
|
||||||
|
list(APPEND gattlib_LIBS ${BLUEZ_LIBRARIES})
|
||||||
|
# Extract Bluez version
|
||||||
|
string(REPLACE "." ";" BLUEZ_VERSIONS "${BLUEZ_VERSION}")
|
||||||
|
list(GET BLUEZ_VERSIONS 0 BLUEZ_VERSION_MAJOR)
|
||||||
|
list(GET BLUEZ_VERSIONS 1 BLUEZ_VERSION_MINOR)
|
||||||
|
add_definitions(-DBLUEZ_VERSION_MAJOR=${BLUEZ_VERSION_MAJOR} -DBLUEZ_VERSION_MINOR=${BLUEZ_VERSION_MINOR})
|
||||||
|
|
||||||
# gattlib
|
# gattlib
|
||||||
add_library(gattlib SHARED ${gattlib_SRCS})
|
add_library(gattlib SHARED ${gattlib_SRCS})
|
||||||
target_link_libraries(gattlib ${gattlib_LIBS})
|
target_link_libraries(gattlib ${gattlib_LIBS})
|
||||||
|
|
|
@ -24,6 +24,9 @@
|
||||||
#ifndef __GATTLIB_INTERNAL_H__
|
#ifndef __GATTLIB_INTERNAL_H__
|
||||||
#define __GATTLIB_INTERNAL_H__
|
#define __GATTLIB_INTERNAL_H__
|
||||||
|
|
||||||
|
#define BLUEZ_VERSIONS(major, minor) (((major) << 8) | (minor))
|
||||||
|
#define BLUEZ_VERSION BLUEZ_VERSIONS(BLUEZ_VERSION_MAJOR, BLUEZ_VERSION_MINOR)
|
||||||
|
|
||||||
#include "gattlib.h"
|
#include "gattlib.h"
|
||||||
|
|
||||||
struct gattlib_thread_t {
|
struct gattlib_thread_t {
|
||||||
|
|
Loading…
Reference in New Issue