From 9cddd4a8b11f852e6d71932e0774c68a20a87a32 Mon Sep 17 00:00:00 2001 From: Mihai Tudor Panu Date: Tue, 9 Apr 2019 20:20:24 -0700 Subject: [PATCH] cmake: add check for tinyb and set as dependency for 2jciebu01-ble Signed-off-by: Mihai Tudor Panu --- CMakeLists.txt | 3 +++ src/2jciebu01-ble/CMakeLists.txt | 15 ++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a6615a16..c1a90dac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -150,6 +150,9 @@ pkg_check_modules (MODBUS libmodbus>=3.1.2) # Check for OPENZWAVE pkg_check_modules (OPENZWAVE libopenzwave) +# Check for TinyB +pkg_check_modules (TINYB tinyb>=0.5.1) + # Find JPEG find_package (JPEG) diff --git a/src/2jciebu01-ble/CMakeLists.txt b/src/2jciebu01-ble/CMakeLists.txt index a07f57d3..5a746256 100644 --- a/src/2jciebu01-ble/CMakeLists.txt +++ b/src/2jciebu01-ble/CMakeLists.txt @@ -1,5 +1,10 @@ -set (libname "2jciebu01-ble") -set (libdescription "Omron BLE Environment Sensor") -set (module_src "2jciebu01_ble.cxx") -set (module_hpp "2jciebu01_ble.hpp") -upm_module_init(2jciebu01-usb) +if (TINYB_FOUND) + set (libname "2jciebu01-ble") + set (libdescription "Omron BLE Environment Sensor") + set (module_src "2jciebu01_ble.cxx") + set (module_hpp "2jciebu01_ble.hpp") + + set (reqlibname "libtinyb") + upm_module_init(2jciebu01-usb ${TINYB_LIBRARIES}) + target_include_directories(${libname} PUBLIC ${TINYB_INCLUDE_DIRS}) +endif() \ No newline at end of file