2019-11-02 17:47:10 +00:00
|
|
|
cmake_minimum_required (VERSION 3.5)
|
2022-11-23 15:28:41 +00:00
|
|
|
project(BTstack-AutoPTS)
|
2019-11-02 17:47:10 +00:00
|
|
|
|
2021-01-21 17:57:04 +00:00
|
|
|
# fink pkgconfig
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
|
|
|
|
# libusb
|
|
|
|
pkg_check_modules(LIBUSB REQUIRED libusb-1.0)
|
|
|
|
include_directories(${LIBUSB_INCLUDE_DIRS})
|
|
|
|
link_directories(${LIBUSB_LIBRARY_DIRS})
|
|
|
|
link_libraries(${LIBUSB_LIBRARIES})
|
2019-11-02 17:47:10 +00:00
|
|
|
|
|
|
|
# add all directories
|
2022-11-23 15:28:41 +00:00
|
|
|
include_directories((../../chipset/realtek))
|
2019-11-02 17:47:10 +00:00
|
|
|
include_directories(../../3rd-party/micro-ecc)
|
2022-08-02 08:29:17 +00:00
|
|
|
include_directories(../../3rd-party/lc3-google/include)
|
2021-01-29 13:56:13 +00:00
|
|
|
include_directories(../../3rd-party/rijndael)
|
2019-11-02 17:47:10 +00:00
|
|
|
include_directories(../../3rd-party/tinydir)
|
|
|
|
include_directories(../../chipset/zephyr)
|
|
|
|
include_directories(../../src)
|
|
|
|
include_directories(../../platform/posix)
|
|
|
|
include_directories(../../platform/embedded)
|
|
|
|
include_directories(../../platform/lwip)
|
|
|
|
include_directories(../../platform/lwip/port)
|
2019-12-18 16:44:49 +00:00
|
|
|
include_directories(.)
|
2019-11-02 17:47:10 +00:00
|
|
|
include_directories(..)
|
|
|
|
|
|
|
|
# find src files
|
|
|
|
file(GLOB SOURCES_SRC "../../src/*.c" "../../example/sco_demo_util.c")
|
2022-11-23 15:28:41 +00:00
|
|
|
file(GLOB SOURCES_CLASSIC ../../src/classic/btstack_link_key_db_tlv.c
|
|
|
|
../../src/classic/rfcomm.c
|
|
|
|
../../src/classic/sdp_server.c
|
|
|
|
../../src/classic/sdp_util.c)
|
2019-11-02 17:47:10 +00:00
|
|
|
file(GLOB SOURCES_BLE "../../src/ble/*.c")
|
|
|
|
file(GLOB SOURCES_GATT "../../src/ble/gatt-service/*.c")
|
2020-08-31 12:27:41 +00:00
|
|
|
file(GLOB SOURCES_UECC "../../3rd-party/micro-ecc/uECC.c")
|
2019-11-02 17:47:10 +00:00
|
|
|
file(GLOB SOURCES_POSIX "../../platform/posix/*.c")
|
2020-08-31 12:10:47 +00:00
|
|
|
file(GLOB SOURCES_LIBUSB "../../platform/libusb/*.c")
|
2022-11-23 15:28:41 +00:00
|
|
|
file(GLOB SOURCES_REALTEK "../../chipset/realtek/*.c")
|
2019-11-02 17:47:10 +00:00
|
|
|
file(GLOB SOURCES_ZEPHYR "../../chipset/zephyr/*.c")
|
|
|
|
|
|
|
|
# remove some
|
2019-11-04 15:28:33 +00:00
|
|
|
file(GLOB SOURCES_BLE_OFF "../../src/ble/le_device_db_memory.c")
|
|
|
|
list(REMOVE_ITEM SOURCES_BLE ${SOURCES_BLE_OFF})
|
|
|
|
file(GLOB SOURCES_POSIX_OFF "../../platform/posix/le_device_db_fs.c")
|
|
|
|
list(REMOVE_ITEM SOURCES_POSIX ${SOURCES_POSIX_OFF})
|
2019-11-02 17:47:10 +00:00
|
|
|
|
|
|
|
set(SOURCES
|
|
|
|
${SOURCES_POSIX}
|
|
|
|
${SOURCES_LIBUSB}
|
|
|
|
${SOURCES_SRC}
|
2022-11-23 15:28:41 +00:00
|
|
|
${SOURCES_CLASSIC}
|
2019-11-02 17:47:10 +00:00
|
|
|
${SOURCES_BLE}
|
|
|
|
${SOURCES_GATT}
|
|
|
|
${SOURCES_UECC}
|
2022-11-23 15:28:41 +00:00
|
|
|
${SOURCES_REALTEK}
|
2019-11-02 17:47:10 +00:00
|
|
|
${SOURCES_ZEPHYR}
|
2021-01-29 13:56:13 +00:00
|
|
|
"../../3rd-party/rijndael/rijndael.c"
|
2019-11-02 17:47:10 +00:00
|
|
|
)
|
|
|
|
|
2022-11-23 15:28:41 +00:00
|
|
|
# Enable ASAN
|
|
|
|
add_compile_options( -g -fsanitize=address)
|
|
|
|
add_link_options( -fsanitize=address)
|
2021-12-13 16:48:58 +00:00
|
|
|
|
2019-11-02 17:47:10 +00:00
|
|
|
# create static lib
|
|
|
|
add_library(btstack STATIC ${SOURCES})
|
|
|
|
|
2019-11-02 21:05:50 +00:00
|
|
|
# target
|
|
|
|
set (EXAMPLE btpclient)
|
2019-11-02 17:47:10 +00:00
|
|
|
|
|
|
|
# create targets
|
2022-11-23 15:28:41 +00:00
|
|
|
set (SOURCE_FILES ${EXAMPLE}.c ../../port/libusb/main.c btp_socket.c)
|
2019-11-02 17:47:10 +00:00
|
|
|
|
|
|
|
add_executable(${EXAMPLE} ${SOURCE_FILES} )
|
|
|
|
target_link_libraries(${EXAMPLE} btstack)
|