xref: /btstack/test/gatt_client/CMakeLists.txt (revision ec4690afd10fec8b375d4122b81902e9c9a379a0)
1f41de160SMatthias Ringwaldcmake_minimum_required (VERSION 3.5)
2f41de160SMatthias Ringwaldproject(gatt-client-test)
3f41de160SMatthias Ringwald
4*ec4690afSMatthias Ringwald# pkgconfig
5f41de160SMatthias Ringwaldfind_package(PkgConfig REQUIRED)
6f41de160SMatthias Ringwald
7*ec4690afSMatthias Ringwald# CppuTest
8*ec4690afSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest)
9*ec4690afSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS})
10*ec4690afSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS})
11*ec4690afSMatthias Ringwaldlink_libraries(${CPPUTEST_LIBRARIES})
12f41de160SMatthias Ringwald
13f41de160SMatthias Ringwaldinclude_directories(.)
14f41de160SMatthias Ringwaldinclude_directories(../../src)
157aef8288SMilanka Ringwaldinclude_directories(../../3rd-party/rijndael/)
16f41de160SMatthias Ringwaldinclude_directories( ${CMAKE_CURRENT_BINARY_DIR})
17f41de160SMatthias Ringwald
18f41de160SMatthias Ringwaldset(SOURCES
19f41de160SMatthias Ringwald	../../src/ad_parser.c
20f41de160SMatthias Ringwald	../../src/ble/att_db.c
21f41de160SMatthias Ringwald	../../src/ble/att_dispatch.c
22f41de160SMatthias Ringwald	../../src/ble/gatt_client.c
23f41de160SMatthias Ringwald	../../src/ble/le_device_db_memory.c
24f41de160SMatthias Ringwald	../../src/btstack_linked_list.c
25f41de160SMatthias Ringwald	../../src/btstack_memory.c
26f41de160SMatthias Ringwald	../../src/btstack_memory_pool.c
27f41de160SMatthias Ringwald	../../src/btstack_util.c
28f41de160SMatthias Ringwald	../../src/hci_cmd.c
29f41de160SMatthias Ringwald	../../src/hci_dump.c
307aef8288SMilanka Ringwald	../../src/btstack_crypto.c
317aef8288SMilanka Ringwald	../../3rd-party/rijndael/rijndael.c
32f41de160SMatthias Ringwald)
33f41de160SMatthias Ringwald
34f41de160SMatthias Ringwald# create static lib
35f41de160SMatthias Ringwaldadd_library(btstack STATIC ${SOURCES})
36f41de160SMatthias Ringwald
37f41de160SMatthias Ringwald# create targets
38b14d59d7SMilanka Ringwaldforeach(EXAMPLE_FILE le_central.cpp gatt_client_test.cpp gatt_client_crypto_test.cpp)
39f41de160SMatthias Ringwald	get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE)
40f41de160SMatthias Ringwald	set (SOURCE_FILES ${EXAMPLE_FILE} mock.c)
41f41de160SMatthias Ringwald	# profile.h
42f41de160SMatthias Ringwald	add_custom_command(
43f41de160SMatthias Ringwald		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/profile.h
44f41de160SMatthias Ringwald		COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py
45f41de160SMatthias Ringwald		ARGS ${CMAKE_SOURCE_DIR}/profile.gatt ${CMAKE_CURRENT_BINARY_DIR}/profile.h
46f41de160SMatthias Ringwald	)
47f41de160SMatthias Ringwald	list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/profile.h)
48f41de160SMatthias Ringwald	add_executable(${EXAMPLE} ${SOURCE_FILES} )
49f41de160SMatthias Ringwald	target_link_libraries(${EXAMPLE} btstack)
50f41de160SMatthias Ringwaldendforeach(EXAMPLE_FILE)
51