Skip to content

Commit

Permalink
add::CMakeLists.txt
Browse files Browse the repository at this point in the history
-add cmake file for main file
-add cmake file for temperature module
-add cmake file for uart module
  • Loading branch information
abdullahbagyapan committed Apr 18, 2024
1 parent 6a095fe commit 22145b9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
28 changes: 28 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
cmake_minimum_required(VERSION 3.13)

# initialize the SDK directly
include(pico_sdk_import.cmake)

project(RASPBERRY_PI_PICO_TEMPERATURE)

# initialize the Raspberry Pi Pico SDK
pico_sdk_init()

add_compile_options(-Wall
-Werror
)

# rest of your project
add_executable(main
main.c
)

add_subdirectory(temperature)
add_subdirectory(uart)

# Add pico_stdlib library which aggregates commonly used features
target_link_libraries(main pico_stdlib temperature uart)


# create map/bin/hex/uf2 file in addition to ELF.
pico_add_extra_outputs(main)
5 changes: 5 additions & 0 deletions temperature/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file(GLOB FILES *.c *.h)

add_library(temperature ${FILES})

target_link_libraries(temperature pico_stdlib)
5 changes: 5 additions & 0 deletions uart/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
file(GLOB FILES *.c *.h)

add_library(uart ${FILES})

target_link_libraries(uart pico_stdlib)

0 comments on commit 22145b9

Please sign in to comment.