1bc06f5acSMatthias Ringwaldcmake_minimum_required (VERSION 3.5) 2bc06f5acSMatthias Ringwaldproject(test-hfp) 3bc06f5acSMatthias Ringwald 4c589a9bbSMatthias Ringwald# pkgconfig required to link cpputest 5c589a9bbSMatthias Ringwaldfind_package(PkgConfig REQUIRED) 6c589a9bbSMatthias Ringwald 7c589a9bbSMatthias Ringwald# CppuTest 8c589a9bbSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest) 9c589a9bbSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS}) 10c589a9bbSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS}) 11c589a9bbSMatthias Ringwaldlink_libraries(${CPPUTEST_LIBRARIES}) 12bc06f5acSMatthias Ringwald 13bc06f5acSMatthias Ringwaldinclude_directories(.) 14bc06f5acSMatthias Ringwaldinclude_directories(..) 15bc06f5acSMatthias Ringwaldinclude_directories(../../3rd-party/bluedroid/decoder/include) 16bc06f5acSMatthias Ringwaldinclude_directories(../../3rd-party/bluedroid/encoder/include) 17bc06f5acSMatthias Ringwaldinclude_directories(../../3rd-party/md5) 18bc06f5acSMatthias Ringwaldinclude_directories(../../3rd-party/yxml) 19bc06f5acSMatthias Ringwaldinclude_directories(../../3rd-party/tinydir) 20bc06f5acSMatthias Ringwaldinclude_directories(../../src) 21bc06f5acSMatthias Ringwaldinclude_directories(../../chipset/zephyr) 22bc06f5acSMatthias Ringwaldinclude_directories(../../platform/posix) 23bc06f5acSMatthias Ringwaldinclude_directories(../../platform/embedded) 24bc06f5acSMatthias Ringwaldinclude_directories(../../port/libusb) 25bc06f5acSMatthias Ringwald 26588df5e9SMatthias Ringwaldset (SOURCES_SRC 27588df5e9SMatthias Ringwald ../../src/btstack_linked_list.c 28588df5e9SMatthias Ringwald ../../src/btstack_util.c 29588df5e9SMatthias Ringwald ../../src/btstack_memory.c 30588df5e9SMatthias Ringwald ../../src/hci_cmd.c 31588df5e9SMatthias Ringwald ../../src/hci_dump.c 32588df5e9SMatthias Ringwald ) 33bc06f5acSMatthias Ringwaldfile(GLOB SOURCES_CLASSIC "../../src/classic/*.c") 34bc06f5acSMatthias Ringwaldfile(GLOB SOURCES_POSIX "../../platform/posix/*.c") 35bc06f5acSMatthias Ringwald 36bc06f5acSMatthias Ringwaldset(SOURCES 37bc06f5acSMatthias Ringwald ${SOURCES_POSIX} 38bc06f5acSMatthias Ringwald ${SOURCES_SRC} 39bc06f5acSMatthias Ringwald ${SOURCES_CLASSIC} 40588df5e9SMatthias Ringwald mock.c 41588df5e9SMatthias Ringwald test_sequences.c 42bc06f5acSMatthias Ringwald) 43bc06f5acSMatthias Ringwaldlist(SORT SOURCES) 44bc06f5acSMatthias Ringwald 45*9c803eb7SMatthias Ringwaldadd_compile_options( -g -DHAVE_ASSERT) 46*9c803eb7SMatthias Ringwald 47bc06f5acSMatthias Ringwald# create static lib 48bc06f5acSMatthias Ringwaldadd_library(btstack STATIC ${SOURCES}) 49bc06f5acSMatthias Ringwald 50588df5e9SMatthias Ringwald# create targets for all tests 511d3bd1e5SMatthias Ringwaldfile(GLOB EXAMPLES_C "*_test.cpp") 52bc06f5acSMatthias Ringwaldforeach(EXAMPLE_FILE ${EXAMPLES_C}) 53bc06f5acSMatthias Ringwald get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE) 54bc06f5acSMatthias Ringwald set (SOURCE_FILES ${EXAMPLE_FILE}) 55bc06f5acSMatthias Ringwald message("test/hfp tool: ${EXAMPLE}") 56bc06f5acSMatthias Ringwald add_executable(${EXAMPLE} ${SOURCE_FILES} ) 57bc06f5acSMatthias Ringwald target_link_libraries(${EXAMPLE} btstack) 58bc06f5acSMatthias Ringwaldendforeach(EXAMPLE_FILE) 59