Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include playground_auto_set_url #47

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
.vscode
cmake-*
build
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ include(pico_sdk_import.cmake)
# We also need PICO EXTRAS
include(pico_extras_import.cmake)

set(PICO_PLAYGROUND_PATH ${PROJECT_SOURCE_DIR})
# Include playground_auto_set_url
include(playground_auto_set_url.cmake)

project(pico_playground C CXX)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
Expand Down
5 changes: 5 additions & 0 deletions playground_auto_set_url.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
set(PICO_PLAYGROUND_URL_BASE "https://github.com/raspberrypi/pico-playground/tree/HEAD")
macro(playground_auto_set_url TARGET)
file(RELATIVE_PATH URL_REL_PATH "${PICO_PLAYGROUND_PATH}" "${CMAKE_CURRENT_LIST_DIR}")
pico_set_program_url(${TARGET} "${PICO_PLAYGROUND_URL_BASE}/${URL_REL_PATH}")
endmacro()
4 changes: 2 additions & 2 deletions reset/hello_reset/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ if (TARGET hardware_reset)
pico_add_extra_outputs(hello_reset)

# add url via pico_set_program_url
example_auto_set_url(hello_reset)
endif ()
playground_auto_set_url(hello_reset)
endif ()