xref: /btstack/test/avdtp/CMakeLists.txt (revision db6cafabbb2f5855472a80ca7188b714a70d56bc)
14578e022SMatthias Ringwaldcmake_minimum_required (VERSION 3.5)
24578e022SMatthias Ringwaldproject(test-hfp)
34578e022SMatthias Ringwald
4*db6cafabSMatthias Ringwald# pkgconfig required to link cpputest
5*db6cafabSMatthias Ringwaldfind_package(PkgConfig REQUIRED)
6*db6cafabSMatthias Ringwald
72b6ecffcSMatthias Ringwald# libusb
82b6ecffcSMatthias Ringwaldpkg_check_modules(LIBUSB REQUIRED libusb-1.0)
92b6ecffcSMatthias Ringwaldinclude_directories(${LIBUSB_INCLUDE_DIRS})
102b6ecffcSMatthias Ringwaldlink_directories(${LIBUSB_LIBRARY_DIRS})
112b6ecffcSMatthias Ringwaldlink_libraries(${LIBUSB_LIBRARIES})
124578e022SMatthias Ringwald
13c589a9bbSMatthias Ringwald# CppuTest
14c589a9bbSMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest)
15c589a9bbSMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS})
16c589a9bbSMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS})
17c589a9bbSMatthias Ringwaldlink_libraries(${CPPUTEST_LIBRARIES})
184578e022SMatthias Ringwald
194578e022SMatthias Ringwaldinclude_directories(.)
204578e022SMatthias Ringwaldinclude_directories(../../3rd-party/micro-ecc)
214578e022SMatthias Ringwaldinclude_directories(../../3rd-party/bluedroid/decoder/include)
224578e022SMatthias Ringwaldinclude_directories(../../3rd-party/bluedroid/encoder/include)
234578e022SMatthias Ringwaldinclude_directories(../../3rd-party/md5)
244578e022SMatthias Ringwaldinclude_directories(../../3rd-party/hxcmod-player)
254578e022SMatthias Ringwaldinclude_directories(../../3rd-party/hxcmod-player/mod)
26*db6cafabSMatthias Ringwaldinclude_directories(../../3rd-party/lc3-google/include)
274578e022SMatthias Ringwaldinclude_directories(../../3rd-party/rijndael)
284578e022SMatthias Ringwaldinclude_directories(../../3rd-party/yxml)
294578e022SMatthias Ringwaldinclude_directories(../../3rd-party/tinydir)
304578e022SMatthias Ringwaldinclude_directories(../../src)
314578e022SMatthias Ringwaldinclude_directories(../../chipset/zephyr)
32*db6cafabSMatthias Ringwaldinclude_directories(../../chipset/realtek)
334578e022SMatthias Ringwaldinclude_directories(../../platform/posix)
344578e022SMatthias Ringwaldinclude_directories(../../platform/embedded)
354578e022SMatthias Ringwaldinclude_directories(../../port/libusb)
364578e022SMatthias Ringwald
374578e022SMatthias Ringwaldfile(GLOB SOURCES_SRC       "../../src/*.c" "../../example/sco_demo_util.c")
384578e022SMatthias Ringwaldfile(GLOB SOURCES_BLE       "../../src/ble/*.c")
394578e022SMatthias Ringwaldfile(GLOB SOURCES_GATT      "../../src/ble/gatt-service/*.c")
404578e022SMatthias Ringwaldfile(GLOB SOURCES_CLASSIC   "../../src/classic/*.c")
414578e022SMatthias Ringwaldfile(GLOB SOURCES_BLUEDROID "../../3rd-party/bluedroid/encoder/srce/*.c" "../../3rd-party/bluedroid/decoder/srce/*.c")
424578e022SMatthias Ringwaldfile(GLOB SOURCES_MD5       "../../3rd-party/md5/md5.c")
434578e022SMatthias Ringwaldfile(GLOB SOURCES_UECC      "../../3rd-party/micro-ecc/uECC.c")
444578e022SMatthias Ringwaldfile(GLOB SOURCES_YXML      "../../3rd-party/yxml/yxml.c")
454578e022SMatthias Ringwaldfile(GLOB SOURCES_HXCMOD    "../../3rd-party/hxcmod-player/*.c"  "../../3rd-party/hxcmod-player/mods/*.c")
464578e022SMatthias Ringwaldfile(GLOB SOURCES_RIJNDAEL  "../../3rd-party/rijndael/rijndael.c")
474578e022SMatthias Ringwaldfile(GLOB SOURCES_POSIX     "../../platform/posix/*.c")
484578e022SMatthias Ringwaldfile(GLOB SOURCES_LIBUSB    "../../port/libusb/*.c" "../../platform/libusb/*.c")
49*db6cafabSMatthias Ringwaldfile(GLOB SOURCES_ZEPHYR    "../../chipset/zephyr/*.c")
50*db6cafabSMatthias Ringwaldfile(GLOB SOURCES_REALTEK   "../../chipset/realtek/*.c")
51*db6cafabSMatthias Ringwaldfile(GLOB SOURCES_LC3_GOOGLE "../../3rd-party/lc3-google/src/*.c")
524578e022SMatthias Ringwald
534578e022SMatthias Ringwaldfile(GLOB SOURCES_BLE_OFF "../../src/ble/le_device_db_memory.c")
544578e022SMatthias Ringwaldlist(REMOVE_ITEM SOURCES_BLE   ${SOURCES_BLE_OFF})
554578e022SMatthias Ringwald
564578e022SMatthias Ringwaldfile(GLOB SOURCES_POSIX_OFF "../../platform/posix/le_device_db_fs.c")
574578e022SMatthias Ringwaldlist(REMOVE_ITEM SOURCES_POSIX ${SOURCES_POSIX_OFF})
584578e022SMatthias Ringwald
594578e022SMatthias Ringwaldset(SOURCES
604578e022SMatthias Ringwald	${SOURCES_MD5}
614578e022SMatthias Ringwald	${SOURCES_YXML}
624578e022SMatthias Ringwald	${SOURCES_BLUEDROID}
634578e022SMatthias Ringwald	${SOURCES_POSIX}
644578e022SMatthias Ringwald	${SOURCES_RIJNDAEL}
654578e022SMatthias Ringwald	${SOURCES_LIBUSB}
664578e022SMatthias Ringwald	${SOURCES_SRC}
674578e022SMatthias Ringwald	${SOURCES_BLE}
684578e022SMatthias Ringwald	${SOURCES_GATT}
694578e022SMatthias Ringwald	${SOURCES_CLASSIC}
704578e022SMatthias Ringwald	${SOURCES_UECC}
714578e022SMatthias Ringwald	${SOURCES_HXCMOD}
72*db6cafabSMatthias Ringwald	${SOURCES_REALTEK}
734578e022SMatthias Ringwald	${SOURCES_ZEPHYR}
74*db6cafabSMatthias Ringwald	${SOURCES_LC3_GOOGLE}
754578e022SMatthias Ringwald)
764578e022SMatthias Ringwaldlist(SORT SOURCES)
774578e022SMatthias Ringwald
784578e022SMatthias Ringwaldset_source_files_properties(../../src/classic/hfp_ag.c PROPERTIES LANGUAGE CXX )
794578e022SMatthias Ringwald
804578e022SMatthias Ringwald# create static lib
814578e022SMatthias Ringwaldadd_library(btstack STATIC ${SOURCES})
824578e022SMatthias Ringwald
83*db6cafabSMatthias Ringwald# portaudio
84*db6cafabSMatthias Ringwaldpkg_check_modules(PORTAUDIO portaudio-2.0)
85*db6cafabSMatthias Ringwaldif(PORTAUDIO_FOUND)
86*db6cafabSMatthias Ringwald	message("HAVE_PORTAUDIO")
87*db6cafabSMatthias Ringwald	include_directories(${PORTAUDIO_INCLUDE_DIRS})
88*db6cafabSMatthias Ringwald	link_directories(${PORTAUDIO_LIBRARY_DIRS})
89*db6cafabSMatthias Ringwald	link_libraries(${PORTAUDIO_LIBRARIES})
90*db6cafabSMatthias Ringwald	add_compile_definitions(HAVE_PORTAUDIO)
91*db6cafabSMatthias Ringwaldendif()
92*db6cafabSMatthias Ringwald
934578e022SMatthias Ringwald# create targets for all examples
944578e022SMatthias Ringwaldfile(GLOB EXAMPLES_C    "*.c")
954578e022SMatthias Ringwaldlist(SORT EXAMPLES_C)
964578e022SMatthias Ringwald
974578e022SMatthias Ringwald# create targets
984578e022SMatthias Ringwaldforeach(EXAMPLE_FILE ${EXAMPLES_C})
994578e022SMatthias Ringwald	get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE)
1004578e022SMatthias Ringwald	# Use C++ Compiler
1014578e022SMatthias Ringwald	set_source_files_properties(${EXAMPLE_FILE} PROPERTIES LANGUAGE CXX )
1024578e022SMatthias Ringwald	set (SOURCE_FILES ${EXAMPLE_FILE})
1034578e022SMatthias Ringwald	message("test/hfp tool: ${EXAMPLE}")
1044578e022SMatthias Ringwald	add_executable(${EXAMPLE} ${SOURCE_FILES} )
1054578e022SMatthias Ringwald	target_link_libraries(${EXAMPLE} btstack)
1064578e022SMatthias Ringwaldendforeach(EXAMPLE_FILE)
107