1f41de160SMatthias Ringwaldcmake_minimum_required (VERSION 3.5) 2f41de160SMatthias Ringwaldproject(gatt-client-test) 3f41de160SMatthias Ringwald 4ec4690afSMatthias Ringwald# pkgconfig 5f41de160SMatthias Ringwaldfind_package(PkgConfig REQUIRED) 6f41de160SMatthias Ringwald 7ec4690afSMatthias Ringwald# CppuTest 8ec4690afSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest) 9ec4690afSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS}) 10ec4690afSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS}) 11ec4690afSMatthias 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 30*1a9f9e6cSMatthias Ringwald ../../src/hci_event_builder.c 317aef8288SMilanka Ringwald ../../src/btstack_crypto.c 327aef8288SMilanka Ringwald ../../3rd-party/rijndael/rijndael.c 33f41de160SMatthias Ringwald) 34f41de160SMatthias Ringwald 35f41de160SMatthias Ringwald# create static lib 36f41de160SMatthias Ringwaldadd_library(btstack STATIC ${SOURCES}) 37f41de160SMatthias Ringwald 38f41de160SMatthias Ringwald# create targets 39b14d59d7SMilanka Ringwaldforeach(EXAMPLE_FILE le_central.cpp gatt_client_test.cpp gatt_client_crypto_test.cpp) 40f41de160SMatthias Ringwald get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE) 41f41de160SMatthias Ringwald set (SOURCE_FILES ${EXAMPLE_FILE} mock.c) 42f41de160SMatthias Ringwald # profile.h 43f41de160SMatthias Ringwald add_custom_command( 44f41de160SMatthias Ringwald OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/profile.h 45f41de160SMatthias Ringwald COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py 46f41de160SMatthias Ringwald ARGS ${CMAKE_SOURCE_DIR}/profile.gatt ${CMAKE_CURRENT_BINARY_DIR}/profile.h 47f41de160SMatthias Ringwald ) 48f41de160SMatthias Ringwald list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/profile.h) 49f41de160SMatthias Ringwald add_executable(${EXAMPLE} ${SOURCE_FILES} ) 50f41de160SMatthias Ringwald target_link_libraries(${EXAMPLE} btstack) 51f41de160SMatthias Ringwaldendforeach(EXAMPLE_FILE) 52