kopia lustrzana https://github.com/raspberrypi/pico-playground
Fix failed population of `PICO_EXTRAS_PATH` when fetched from git
When running cmake with ``` cmake -B build -DPICO_SDK_FETCH_FROM_GIT=y -DPICO_EXTRAS_FETCH_FROM_GIT=y ``` configuration fails because `PICO_EXTRAS_PATH` incorrectly points to `build` rather than `build/_deps/pico_extras-src`.pull/43/head
rodzic
b1294e8289
commit
54116f50ce
|
@ -26,14 +26,14 @@ if (NOT PICO_EXTRAS_PATH)
|
||||||
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_EXTRAS_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
|
get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_EXTRAS_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}")
|
||||||
endif ()
|
endif ()
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
PICO_EXTRAS
|
pico_extras
|
||||||
GIT_REPOSITORY https://github.com/raspberrypi/pico-extras
|
GIT_REPOSITORY https://github.com/raspberrypi/pico-extras
|
||||||
GIT_TAG master
|
GIT_TAG master
|
||||||
)
|
)
|
||||||
if (NOT PICO_EXTRAS)
|
if (NOT pico_extras)
|
||||||
message("Downloading PICO EXTRAS")
|
message("Downloading PICO EXTRAS")
|
||||||
FetchContent_Populate(PICO_EXTRAS)
|
FetchContent_Populate(pico_extras)
|
||||||
set(PICO_EXTRAS_PATH ${PICO_EXTRAS_SOURCE_DIR})
|
set(PICO_EXTRAS_PATH ${pico_extras_SOURCE_DIR})
|
||||||
endif ()
|
endif ()
|
||||||
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
|
set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE})
|
||||||
else ()
|
else ()
|
||||||
|
@ -59,4 +59,4 @@ endif ()
|
||||||
|
|
||||||
set(PICO_EXTRAS_PATH ${PICO_EXTRAS_PATH} CACHE PATH "Path to the PICO EXTRAS" FORCE)
|
set(PICO_EXTRAS_PATH ${PICO_EXTRAS_PATH} CACHE PATH "Path to the PICO EXTRAS" FORCE)
|
||||||
|
|
||||||
add_subdirectory(${PICO_EXTRAS_PATH} pico_extras)
|
add_subdirectory(${PICO_EXTRAS_PATH} pico_extras)
|
||||||
|
|
Ładowanie…
Reference in New Issue