forked from RaresAil/pico-w-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (49 loc) · 1.65 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
# Set minimum required version of CMake
cmake_minimum_required(VERSION 3.12)
set(PICO_CXX_ENABLE_EXCEPTIONS 1)
add_compile_definitions(CYW43_HOST_NAME="PicoTemplate")
#include build functions from Pico SDK
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake)
# Set name of project (as PROJECT_NAME) and C/C++ Standards
project(project_name C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
if(CMAKE_BUILD_TYPE MATCHES "Debug")
add_compile_definitions(IS_DEBUG_MODE="1")
endif()
# Creates a pico-sdk subdirectory in our project for the libraries
pico_sdk_init()
if (PICO_CYW43_SUPPORTED)
if (NOT TARGET pico_cyw43_arch)
message("Skipping Pico W as support is not available")
else()
message("Pico W support is available")
endif()
endif()
# point out the CMake, where to find the executable source file
add_executable(${PROJECT_NAME}
src/main.cpp
include/dhcpserver/dhcpserver.c
)
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}/include)
target_compile_options(${PROJECT_NAME} PUBLIC "-Wno-psabi")
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/src)
if(CMAKE_BUILD_TYPE MATCHES "Debug")
pico_enable_stdio_usb(${PROJECT_NAME} 1)
else()
pico_enable_stdio_usb(${PROJECT_NAME} 0)
endif()
pico_enable_stdio_uart(${PROJECT_NAME} 0)
# create map/bin/hex/uf2 files.
pico_add_extra_outputs(${PROJECT_NAME})
pico_set_program_url(${PROJECT_NAME} "https://github.com/RaresAil/rpi-pico-esp-cpp")
target_link_libraries(${PROJECT_NAME}
pico_stdlib
pico_cyw43_arch_lwip_threadsafe_background
pico_multicore
hardware_rtc
hardware_i2c
hardware_adc
hardware_flash
hardware_sync
)