Initial commit
This commit is contained in:
54
CMakeLists.txt
Normal file
54
CMakeLists.txt
Normal file
@@ -0,0 +1,54 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
set(PICO_BOARD pico2_w)
|
||||
|
||||
include(pico_sdk_import.cmake)
|
||||
|
||||
project(pico_examples C CXX ASM)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
if (PICO_SDK_VERSION_STRING VERSION_LESS "2.2.0")
|
||||
message(FATAL_ERROR "Raspberry Pi Pico SDK version 2.2.0 (or later) required. Your version is ${PICO_SDK_VERSION_STRING}")
|
||||
endif()
|
||||
|
||||
pico_sdk_init()
|
||||
|
||||
add_compile_options(-Wall
|
||||
-Wno-format
|
||||
-Wno-unused-function
|
||||
)
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_options(-Wno-maybe-uninitialized)
|
||||
endif()
|
||||
|
||||
set(BTSTACK_ROOT ${PICO_SDK_PATH}/lib/btstack)
|
||||
|
||||
add_executable(foo
|
||||
server.c
|
||||
ble_server.c
|
||||
gps_handler.c
|
||||
mpu_handler.c
|
||||
mpu_handler.h
|
||||
)
|
||||
|
||||
target_include_directories(foo PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}
|
||||
)
|
||||
target_link_libraries(foo
|
||||
pico_stdlib
|
||||
pico_btstack_ble
|
||||
pico_btstack_cyw43
|
||||
pico_cyw43_arch_none
|
||||
hardware_adc
|
||||
hardware_uart
|
||||
hardware_i2c
|
||||
)
|
||||
|
||||
pico_enable_stdio_usb(foo 1)
|
||||
pico_enable_stdio_uart(foo 0)
|
||||
|
||||
pico_btstack_make_gatt_header(foo PRIVATE "${CMAKE_CURRENT_LIST_DIR}/foo.gatt")
|
||||
|
||||
pico_add_extra_outputs(foo)
|
||||
Reference in New Issue
Block a user