main: nit, make scan/rfcomm/notify strict alternatives, share shutdown code
[libble/gsi.git] / CMakeLists.txt
blobd64dabe4f84ad8d2970819b33cad52adc02b8cfd
1 cmake_minimum_required(VERSION 2.6)
2 project(libble)
4 include(CheckSymbolExists)
5 CHECK_SYMBOL_EXISTS(bt_put_le16 "bluetooth/bluetooth.h" HAVE_BT_PUT_LE16)
6 configure_file(
7         ${CMAKE_CURRENT_SOURCE_DIR}/config.h.in
8         ${CMAKE_CURRENT_BINARY_DIR}/ble-config.h
10 include_directories(${CMAKE_CURRENT_BINARY_DIR})
12 include_directories("include")
13 install(
14         FILES "include/ble.h"
15         DESTINATION "include/libble"
18 add_library(ble SHARED src/ble.c)
19 target_link_libraries(ble bluetooth)
20 install(
21         TARGETS ble
22         LIBRARY DESTINATION lib
25 add_executable(ble-test main-bletest.c)
26 target_link_libraries(ble-test ble)
27 add_executable(rfcomm-test main-rfcomm.c)
28 target_link_libraries(rfcomm-test bluetooth)
29 install(
30         TARGETS ble-test rfcomm-test
31         RUNTIME DESTINATION bin