1f41de160SMatthias Ringwaldcmake_minimum_required (VERSION 3.5) 2f41de160SMatthias Ringwaldproject(gatt-client-test) 3f41de160SMatthias Ringwald 4f41de160SMatthias Ringwald# fink pkgconfig 5f41de160SMatthias Ringwaldfind_package(PkgConfig REQUIRED) 6f41de160SMatthias Ringwald 7f41de160SMatthias Ringwald# add CppUTest 8f41de160SMatthias Ringwaldinclude_directories("/usr/local/include") 9f41de160SMatthias Ringwaldlink_directories("/usr/local/lib") 10f41de160SMatthias Ringwaldlink_libraries( CppUTest ) 11f41de160SMatthias Ringwaldlink_libraries( CppUTestExt ) 12f41de160SMatthias Ringwald 13f41de160SMatthias Ringwaldinclude_directories(.) 14f41de160SMatthias Ringwaldinclude_directories(../../src) 15f41de160SMatthias Ringwaldinclude_directories( ${CMAKE_CURRENT_BINARY_DIR}) 16f41de160SMatthias Ringwald 17f41de160SMatthias Ringwaldset(SOURCES 18f41de160SMatthias Ringwald ../../src/ad_parser.c 19f41de160SMatthias Ringwald ../../src/ble/att_db.c 20f41de160SMatthias Ringwald ../../src/ble/att_dispatch.c 21f41de160SMatthias Ringwald ../../src/ble/gatt_client.c 22f41de160SMatthias Ringwald ../../src/ble/le_device_db_memory.c 23f41de160SMatthias Ringwald ../../src/btstack_linked_list.c 24f41de160SMatthias Ringwald ../../src/btstack_memory.c 25f41de160SMatthias Ringwald ../../src/btstack_memory_pool.c 26f41de160SMatthias Ringwald ../../src/btstack_util.c 27f41de160SMatthias Ringwald ../../src/hci_cmd.c 28f41de160SMatthias Ringwald ../../src/hci_dump.c 29f41de160SMatthias Ringwald) 30f41de160SMatthias Ringwald 31f41de160SMatthias Ringwald# create static lib 32f41de160SMatthias Ringwaldadd_library(btstack STATIC ${SOURCES}) 33f41de160SMatthias Ringwald 34f41de160SMatthias Ringwald# create targets 35*1d3bd1e5SMatthias Ringwaldforeach(EXAMPLE_FILE le_central.cpp gatt_client_test.cpp) 36f41de160SMatthias Ringwald get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE) 37f41de160SMatthias Ringwald set (SOURCE_FILES ${EXAMPLE_FILE} mock.c) 38f41de160SMatthias Ringwald # profile.h 39f41de160SMatthias Ringwald add_custom_command( 40f41de160SMatthias Ringwald OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/profile.h 41f41de160SMatthias Ringwald COMMAND ${CMAKE_SOURCE_DIR}/../../tool/compile_gatt.py 42f41de160SMatthias Ringwald ARGS ${CMAKE_SOURCE_DIR}/profile.gatt ${CMAKE_CURRENT_BINARY_DIR}/profile.h 43f41de160SMatthias Ringwald ) 44f41de160SMatthias Ringwald list(APPEND SOURCE_FILES ${CMAKE_CURRENT_BINARY_DIR}/profile.h) 45f41de160SMatthias Ringwald add_executable(${EXAMPLE} ${SOURCE_FILES} ) 46f41de160SMatthias Ringwald target_link_libraries(${EXAMPLE} btstack) 47f41de160SMatthias Ringwaldendforeach(EXAMPLE_FILE) 48