aboutsummaryrefslogtreecommitdiff
path: root/ble/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'ble/CMakeLists.txt')
-rw-r--r--ble/CMakeLists.txt21
1 files changed, 19 insertions, 2 deletions
diff --git a/ble/CMakeLists.txt b/ble/CMakeLists.txt
index 543e85d..5f20a21 100644
--- a/ble/CMakeLists.txt
+++ b/ble/CMakeLists.txt
@@ -1,4 +1,21 @@
-file(GLOB SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h)
+list(APPEND SOURCE_FILES Bluetooth.cpp)
+list(APPEND SOURCE_FILES BluetoothImpl.h)
+list(APPEND SOURCE_FILES ByteBuffer.cpp)
+list(APPEND SOURCE_FILES log.h)
+list(APPEND SOURCE_FILES "${PROJECT_SOURCE_DIR}/include/ble/Bluetooth.h")
+list(APPEND SOURCE_FILES "${PROJECT_SOURCE_DIR}/include/ble/ByteBuffer.h")
+
+if(IS_LINUX)
+ list(APPEND SOURCE_FILES LinuxBluetooth.cpp LinuxBluetooth.h)
+ list(APPEND COMPILE_OPTIONS -DIS_LINUX)
+elseif(IS_APPLE)
+ list(APPEND SOURCE_FILES OsxBluetooth.mm OsxBluetooth.h)
+ list(APPEND COMPILE_OPTIONS -DIS_APPLE)
+endif()
+
+find_package(Boost COMPONENTS regex system program_options REQUIRED)
add_library(ble ${SOURCE_FILES})
-include_directories("${PROJECT_SOURCE_DIR}/include")
+target_include_directories(ble PUBLIC "${PROJECT_SOURCE_DIR}/include")
+target_include_directories(ble PUBLIC "${Boost_INCLUDE_DIRS}")
+target_compile_options(ble PRIVATE -Wno-deprecated-register ${COMPILE_OPTIONS})