1*8cfd11c3SMatthias Ringwaldcmake_minimum_required (VERSION 3.5) 2*8cfd11c3SMatthias Ringwald 3*8cfd11c3SMatthias Ringwaldproject(test-tlv-test) 4*8cfd11c3SMatthias Ringwald 5*8cfd11c3SMatthias Ringwaldset (BTSTACK_ROOT ${CMAKE_SOURCE_DIR}/../../) 6*8cfd11c3SMatthias Ringwald 7*8cfd11c3SMatthias Ringwald# pkgconfig required to link cpputest 8*8cfd11c3SMatthias Ringwaldfind_package(PkgConfig REQUIRED) 9*8cfd11c3SMatthias Ringwald 10*8cfd11c3SMatthias Ringwald# CppuTest 11*8cfd11c3SMatthias Ringwaldpkg_check_modules(CPPUTEST REQUIRED CppuTest) 12*8cfd11c3SMatthias Ringwaldinclude_directories(${CPPUTEST_INCLUDE_DIRS}) 13*8cfd11c3SMatthias Ringwaldlink_directories(${CPPUTEST_LIBRARY_DIRS}) 14*8cfd11c3SMatthias Ringwaldlink_libraries(${CPPUTEST_LIBRARIES}) 15*8cfd11c3SMatthias Ringwald 16*8cfd11c3SMatthias Ringwaldinclude_directories(../../3rd-party/micro-ecc) 17*8cfd11c3SMatthias Ringwaldinclude_directories(../../3rd-party/rijndael) 18*8cfd11c3SMatthias Ringwaldinclude_directories(../../platform/embedded) 19*8cfd11c3SMatthias Ringwaldinclude_directories(../../platform/posix) 20*8cfd11c3SMatthias Ringwaldinclude_directories(../../src) 21*8cfd11c3SMatthias Ringwaldinclude_directories(.) 22*8cfd11c3SMatthias Ringwald 23*8cfd11c3SMatthias Ringwald# Enable ASAN 24*8cfd11c3SMatthias Ringwaldadd_compile_options( -g -fsanitize=address) 25*8cfd11c3SMatthias Ringwaldadd_link_options( -fsanitize=address) 26*8cfd11c3SMatthias Ringwald 27*8cfd11c3SMatthias Ringwald# create test targets 28*8cfd11c3SMatthias Ringwaldfile(GLOB TARGETS_CPP "*_test.cpp") 29*8cfd11c3SMatthias Ringwald# create targets 30*8cfd11c3SMatthias Ringwaldforeach(TARGET_FILE ${TARGETS_CPP}) 31*8cfd11c3SMatthias Ringwald get_filename_component(TEST ${TARGET_FILE} NAME_WE) 32*8cfd11c3SMatthias Ringwald message("test/btstack_util: ${TEST}") 33*8cfd11c3SMatthias Ringwald add_executable(${TEST} 34*8cfd11c3SMatthias Ringwald ${TARGET_FILE} 35*8cfd11c3SMatthias Ringwald ${BTSTACK_ROOT}/src/btstack_util.c 36*8cfd11c3SMatthias Ringwald ${BTSTACK_ROOT}/src/hci_dump.c 37*8cfd11c3SMatthias Ringwald ) 38*8cfd11c3SMatthias Ringwaldendforeach(TARGET_FILE) 39*8cfd11c3SMatthias Ringwald 40*8cfd11c3SMatthias Ringwald 41