xref: /btstack/test/hfp/CMakeLists.txt (revision c589a9bb896bd3ca6ce0b0556b913c50596ccdf8)
1bc06f5acSMatthias Ringwaldcmake_minimum_required (VERSION 3.5)
2bc06f5acSMatthias Ringwaldproject(test-hfp)
3bc06f5acSMatthias Ringwald
4*c589a9bbSMatthias Ringwald# pkgconfig required to link cpputest
5*c589a9bbSMatthias Ringwaldfind_package(PkgConfig REQUIRED)
6*c589a9bbSMatthias Ringwald
7*c589a9bbSMatthias Ringwald# CppuTest
8*c589a9bbSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest)
9*c589a9bbSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS})
10*c589a9bbSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS})
11*c589a9bbSMatthias 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
45bc06f5acSMatthias Ringwald# create static lib
46bc06f5acSMatthias Ringwaldadd_library(btstack STATIC ${SOURCES})
47bc06f5acSMatthias Ringwald
48588df5e9SMatthias Ringwald# create targets for all tests
491d3bd1e5SMatthias Ringwaldfile(GLOB EXAMPLES_C "*_test.cpp")
50bc06f5acSMatthias Ringwaldforeach(EXAMPLE_FILE ${EXAMPLES_C})
51bc06f5acSMatthias Ringwald	get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE)
52bc06f5acSMatthias Ringwald	set (SOURCE_FILES ${EXAMPLE_FILE})
53bc06f5acSMatthias Ringwald	message("test/hfp tool: ${EXAMPLE}")
54bc06f5acSMatthias Ringwald	add_executable(${EXAMPLE} ${SOURCE_FILES} )
55bc06f5acSMatthias Ringwald	target_link_libraries(${EXAMPLE} btstack)
56bc06f5acSMatthias Ringwaldendforeach(EXAMPLE_FILE)
57