-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
38 lines (37 loc) · 1.8 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
cmake_minimum_required (VERSION 3.13)
# Uncomment the following line to compile on PICO_W (With WiFi chip)
# This is needed because PICO_W does its onboard LED differently
#set (PICO_BOARD "pico_w")
set (BINARY "cpicom")
set (PROJ "cpicom")
set (CMAKE_C_FLAGS_RELEASE "-Wall -Wextra")
set (CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra")
include (pico_sdk_import.cmake)
project (${PROJ})
file (GLOB log_src CONFIGURE_DEPENDS "log/src/*.c")
file (GLOB console_src CONFIGURE_DEPENDS "console/src/*.c")
file (GLOB files_src CONFIGURE_DEPENDS "files/src/*.c")
file (GLOB error_src CONFIGURE_DEPENDS "error/src/*.c")
file (GLOB shell_src CONFIGURE_DEPENDS "shell/src/*.c")
file (GLOB klib_src CONFIGURE_DEPENDS "klib/src/*.c")
file (GLOB ymodem_src CONFIGURE_DEPENDS "ymodem/src/*.c")
file (GLOB cpm_src CONFIGURE_DEPENDS "cpm/src/*.c")
file (GLOB picocpm_src CONFIGURE_DEPENDS "picocpm/src/*.c")
file (GLOB blockdev_src CONFIGURE_DEPENDS "blockdevice/src/*.c")
file (GLOB fs_src CONFIGURE_DEPENDS "fs/src/*.c")
pico_sdk_init()
add_executable (${BINARY} ${log_src} ${error_src} ${console_src} ${files_src} ${shell_src} ${klib_src} ${ymodem_src} ${cpm_src} ${picocpm_src} ${blockdev_src} ${fs_src} "main/main.c")
target_include_directories (${BINARY} PUBLIC log/include error/include console/include files/include shell/include klib/include ymodem/include cpm/include picocpm/include blockdevice/include fs/include)
pico_enable_stdio_usb (${BINARY} 1)
pico_enable_stdio_uart (${BINARY} 0)
pico_add_extra_outputs (${BINARY})
if (PICO_ON_DEVICE)
if (PICO_BOARD STREQUAL "pico_w")
add_definitions( -DPICO_W )
target_link_libraries (${BINARY} pico_stdlib hardware_flash hardware_sync pico_cyw43_arch_none)
else()
target_link_libraries (${BINARY} pico_stdlib hardware_flash hardware_sync)
endif()
else()
target_link_libraries (${BINARY} pico_stdlib)
endif()