summaryrefslogtreecommitdiffstats
path: root/examples/CMakeLists.txt
blob: 915f492505ddfbd212384793c07798d70ddeb189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
include_directories(
    ${PROJECT_SOURCE_DIR}/jaulib/include
    ${PROJECT_SOURCE_DIR}/api
)

# These examples use the standard separate compilation
set( SOURCES_IDIOMATIC_EXAMPLES
    dbt_readsmpkey.cpp
    dbt_scanner00.cpp
    dbt_scanner01.cpp
    dbt_scanner10.cpp
    dbt_peripheral00.cpp
    dbt_test_gattcharlifecycle01.cpp
)

string( REPLACE ".cpp" "" BASENAMES_IDIOMATIC_EXAMPLES "${SOURCES_IDIOMATIC_EXAMPLES}" )
set( TARGETS_IDIOMATIC_EXAMPLES ${BASENAMES_IDIOMATIC_EXAMPLES} )

foreach( name ${TARGETS_IDIOMATIC_EXAMPLES} )
    add_executable(${name} ${name}.cpp)
    target_link_libraries(${name} direct_bt)
    add_dependencies(${name} direct_bt)
endforeach()

install(TARGETS ${TARGETS_IDIOMATIC_EXAMPLES} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})