Skip to content

Commit

Permalink
Add heirarchical build to mimic pico-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Williamson committed Jan 16, 2021
1 parent 90d3ab8 commit 3e043bd
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@
*.app

**/build
.vscode
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
cmake_minimum_required(VERSION 3.12)

# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)

project(pico_examples C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Initialize the SDK
pico_sdk_init()

# Example projects
add_subdirectory(pack)
4 changes: 4 additions & 0 deletions pack/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
if (NOT PICO_NO_HARDWARE)
add_subdirectory(display)
add_subdirectory(unicorn)
endif ()
14 changes: 1 addition & 13 deletions pack/display/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
cmake_minimum_required(VERSION 3.12)

# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)

project(pico_examples C CXX ASM)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# Initialize the SDK
pico_sdk_init()

add_executable(
display
demo.cpp
Expand All @@ -23,4 +11,4 @@ add_executable(
target_link_libraries(display pico_stdlib hardware_spi hardware_pwm hardware_dma)

# create map/bin/hex file etc.
pico_add_extra_outputs(display)
pico_add_extra_outputs(display)
File renamed without changes.

0 comments on commit 3e043bd

Please sign in to comment.