From d945dee5b039e9e2d51b36852ef58a812acab302 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 10 Jul 2015 09:23:49 +0200 Subject: o Some iOS experiments. Very WiP. --- ble/CMakeLists.txt | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) (limited to 'ble/CMakeLists.txt') diff --git a/ble/CMakeLists.txt b/ble/CMakeLists.txt index 5f20a21..fef06c5 100644 --- a/ble/CMakeLists.txt +++ b/ble/CMakeLists.txt @@ -10,12 +10,43 @@ 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 SOURCE_FILES OsxBluetooth.mm OsxBluetooth.h OsxBluetoothImpl.h) list(APPEND COMPILE_OPTIONS -DIS_APPLE) + + find_library(CORE_BLUETOOTH_LIBRARY CoreBluetooth) + if (NOT CORE_BLUETOOTH_LIBRARY) + message(FATAL_ERROR "CoreBluetooth not found") + endif() + message(STATUS "CORE_BLUETOOTH_LIBRARY=${CORE_BLUETOOTH_LIBRARY}") +# list(APPEND INCLUDE_DIRECTORIES ${CORE_BLUETOOTH_LIBRARY}/Headers) +# list(APPEND LIBRARIES_LIST ${CORE_BLUETOOTH_LIBRARY}/CoreBluetooth) + list(APPEND LIBRARIES_LIST ${CORE_BLUETOOTH_LIBRARY}) + + find_library(IOBLUETOOTH_LIBRARY IOBluetooth) + if (NOT IOBLUETOOTH_LIBRARY) + message(FATAL_ERROR "IOBluetooth not found") + endif() + message(STATUS "IOBLUETOOTH_LIBRARY=${IOBLUETOOTH_LIBRARY}") +# list(APPEND INCLUDE_DIRECTORIES ${IOBLUETOOTH_LIBRARY}/Headers) +# list(APPEND LIBRARIES_LIST ${IOBLUETOOTH_LIBRARY}/IOBluetooth) + list(APPEND LIBRARIES_LIST ${IOBLUETOOTH_LIBRARY}) + + find_library(FOUNDATION_LIBRARY Foundation) + if (NOT FOUNDATION_LIBRARY) + message(FATAL_ERROR "Foundation not found") + endif() + message(STATUS "FOUNDATION_LIBRARY=${FOUNDATION_LIBRARY}") +# list(APPEND INCLUDE_DIRECTORIES ${FOUNDATION_LIBRARY}/Headers) +# list(APPEND LIBRARIES_LIST ${FOUNDATION_LIBRARY}/Foundation) + list(APPEND LIBRARIES_LIST ${FOUNDATION_LIBRARY}) endif() +list(APPEND INCLUDE_DIRECTORIES "${PROJECT_SOURCE_DIR}/include") + find_package(Boost COMPONENTS regex system program_options REQUIRED) +list(APPEND INCLUDE_DIRECTORIES "${Boost_INCLUDE_DIRS}") + add_library(ble ${SOURCE_FILES}) -target_include_directories(ble PUBLIC "${PROJECT_SOURCE_DIR}/include") -target_include_directories(ble PUBLIC "${Boost_INCLUDE_DIRS}") +target_include_directories(ble PUBLIC "${Boost_INCLUDE_DIRS}" ${INCLUDE_DIRECTORIES}) target_compile_options(ble PRIVATE -Wno-deprecated-register ${COMPILE_OPTIONS}) +target_link_libraries(ble PUBLIC ${LIBRARIES_LIST}) -- cgit v1.2.3