mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 19:20:54 +00:00
test/gatt-service-client: add CMake project
This commit is contained in:
parent
43bef108c2
commit
406aa36651
43
test/gatt-service-client/CMakeLists.txt
Normal file
43
test/gatt-service-client/CMakeLists.txt
Normal file
@ -0,0 +1,43 @@
|
||||
cmake_minimum_required (VERSION 3.5)
|
||||
project(gatt-client-test)
|
||||
|
||||
# add CppUTest
|
||||
include_directories("/usr/local/include")
|
||||
link_directories("/usr/local/lib")
|
||||
link_libraries( CppUTest )
|
||||
link_libraries( CppUTestExt )
|
||||
|
||||
# set include paths
|
||||
include_directories(..)
|
||||
include_directories(../../src)
|
||||
include_directories(../mock)
|
||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR})
|
||||
|
||||
add_compile_options(--coverage)
|
||||
add_link_options( --coverage)
|
||||
add_definitions( -DCOVERAGE)
|
||||
add_definitions( -DHAVE_ASSERT)
|
||||
|
||||
# common files
|
||||
set(SOURCES
|
||||
../../src/btstack_linked_list.c
|
||||
../../src/btstack_util.c
|
||||
../../src/hci_dump.c
|
||||
../mock/mock_gatt_client.c
|
||||
../../src/ble/gatt-service/battery_service_client.c
|
||||
../../src/ble/gatt-service/ancs_client.c
|
||||
)
|
||||
|
||||
# create static lib
|
||||
add_library(btstack STATIC ${SOURCES})
|
||||
|
||||
# create targets
|
||||
file(GLOB TEST_FILES_C "*_test.c")
|
||||
foreach(TEST_FILE ${TEST_FILES_C})
|
||||
# Use C++ Compiler
|
||||
set_source_files_properties(${TEST_FILE} PROPERTIES LANGUAGE CXX )
|
||||
set (SOURCE_FILES ${TEST_FILE})
|
||||
get_filename_component(TEST_NAME ${TEST_FILE} NAME_WE)
|
||||
add_executable(${TEST_NAME} ${SOURCE_FILES} )
|
||||
target_link_libraries(${TEST_NAME} btstack)
|
||||
endforeach(TEST_FILE)
|
Loading…
x
Reference in New Issue
Block a user