aboutsummaryrefslogtreecommitdiff
path: root/ble/CMakeLists.txt
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2015-06-30 14:37:06 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2015-06-30 14:37:06 +0200
commit441cd0b11186d66493798551e1102eb246f1af9f (patch)
tree3cdb5b1dea6b782cbf59e172807f9dc15e7bd418 /ble/CMakeLists.txt
parentaf63bd5688731b57551ac161c0dad26a0b4557d7 (diff)
downloadble-toys-441cd0b11186d66493798551e1102eb246f1af9f.tar.gz
ble-toys-441cd0b11186d66493798551e1102eb246f1af9f.tar.bz2
ble-toys-441cd0b11186d66493798551e1102eb246f1af9f.tar.xz
ble-toys-441cd0b11186d66493798551e1102eb246f1af9f.zip
Getting started on a port to OSX.
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})