-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
72 lines (57 loc) · 1.3 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
cmake_minimum_required(VERSION 3.13)
# Set the C standard
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
include($ENV{PICO_SDK_PATH}/pico_sdk_init.cmake)
project(PROGCC_RP2040 C CXX ASM)
pico_sdk_init()
add_subdirectory(lib/hoja-lib-rp2040)
include_directories(
include
)
add_executable(${PROJECT_NAME}
src/main.c
src/app_rumble_cell.c
src/app_imu.c
src/app_hwtest.c
)
target_compile_definitions(${PROJECT_NAME}
PRIVATE
PICO_XOSC_STARTUP_DELAY_MULTIPLIER=64
PICO_DEFAULT_UART_TX_PIN=12
PICO_DEFAULT_UART_RX_PIN=13
#PICO_DEFAULT_BOOT_STAGE2=boot2_generic_03h
#PICO_FLASH_SPI_CLKDIV=8
)
target_link_libraries(${PROJECT_NAME}
PRIVATE
hoja_lib
pico_stdlib
pico_bootrom
pico_multicore
pico_platform
pico_rand
hardware_gpio
hardware_adc
hardware_flash
hardware_pio
hardware_dma
hardware_pwm
hardware_spi
hardware_sync
hardware_timer
tinyusb_device
tinyusb_board
)
pico_enable_stdio_usb(${PROJECT_NAME} 0)
pico_enable_stdio_uart(${PROJECT_NAME} 1)
pico_add_extra_outputs(${PROJECT_NAME})
add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
-DTARGET_NAME=${PROJECT_NAME}
-DTARGET_PATH=${CMAKE_CURRENT_SOURCE_DIR}
-P ${CMAKE_SOURCE_DIR}/manifest.cmake
COMMENT "Updating version in manifest.json"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)