generated from pimoroni/pico-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (44 loc) · 1.36 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
# CMakeLists for UniClock
cmake_minimum_required(VERSION 3.12)
# Set the project name
set(NAME uniclock)
# Configure some hardware specific bits
set(PICO_BOARD pico_w)
include(pimoroni_pico_import.cmake)
include(pico_sdk_import.cmake)
# Configure language requirements
project(${NAME} C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Initialize the SDK
pico_sdk_init()
# Define all the source files that go into this
add_executable(${NAME}
uniclock.cpp config.cpp display.cpp time.cpp
)
# Include required library definitions
# This assumes `pimoroni-pico` is stored alongside your project
include(libraries/pico_graphics/pico_graphics)
include(libraries/galactic_unicorn/galactic_unicorn)
include(usbfs/CMakeLists.txt)
# Make sure we can pick up local headers from sub-projects
target_include_directories(${NAME} PRIVATE
${CMAKE_CURRENT_LIST_DIR}
)
# Define the libraries we need to link in.
target_link_libraries(${NAME}
pico_stdlib pico_cyw43_arch_lwip_threadsafe_background
hardware_rtc
pico_graphics galactic_unicorn usbfs
)
# create map/bin/hex file etc.
pico_add_extra_outputs(${NAME})
# Set up files for the release packages
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/${NAME}.uf2
${CMAKE_CURRENT_LIST_DIR}/README.md
DESTINATION .
)
set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY OFF)
set(CPACK_GENERATOR "ZIP" "TGZ")
include(CPack)