From 02a22624f1d242d785f23d1c833d9d024d449cd5 Mon Sep 17 00:00:00 2001 From: eleccoder <9162301+eleccoder@users.noreply.github.com> Date: Wed, 21 Dec 2022 14:22:28 +0100 Subject: [PATCH] Update from origin --- cmake/pico_extras_import.cmake | 12 ++++++------ cmake/pico_sdk_import.cmake | 21 ++++++++++++++++----- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/cmake/pico_extras_import.cmake b/cmake/pico_extras_import.cmake index 706add0..b75b9b3 100644 --- a/cmake/pico_extras_import.cmake +++ b/cmake/pico_extras_import.cmake @@ -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}") endif () FetchContent_Declare( - PICO_EXTRAS + pico_extras GIT_REPOSITORY https://github.com/raspberrypi/pico-extras GIT_TAG master ) - if (NOT PICO_EXTRAS) - message("Downloading PICO EXTRAS") - FetchContent_Populate(PICO_EXTRAS) - set(PICO_EXTRAS_PATH ${PICO_EXTRAS_SOURCE_DIR}) + if (NOT pico_extras) + message("Downloading Raspberry Pi Pico Extras") + FetchContent_Populate(pico_extras) + set(PICO_EXTRAS_PATH ${pico_extras_SOURCE_DIR}) endif () set(FETCHCONTENT_BASE_DIR ${FETCHCONTENT_BASE_DIR_SAVE}) else () @@ -59,4 +59,4 @@ endif () set(PICO_EXTRAS_PATH ${PICO_EXTRAS_PATH} CACHE PATH "Path to the PICO EXTRAS" FORCE) -add_subdirectory(${PICO_EXTRAS_PATH} pico_extras) \ No newline at end of file +add_subdirectory(${PICO_EXTRAS_PATH} pico_extras) diff --git a/cmake/pico_sdk_import.cmake b/cmake/pico_sdk_import.cmake index 28efe9e..65f8a6f 100644 --- a/cmake/pico_sdk_import.cmake +++ b/cmake/pico_sdk_import.cmake @@ -29,11 +29,22 @@ if (NOT PICO_SDK_PATH) if (PICO_SDK_FETCH_FROM_GIT_PATH) get_filename_component(FETCHCONTENT_BASE_DIR "${PICO_SDK_FETCH_FROM_GIT_PATH}" REALPATH BASE_DIR "${CMAKE_SOURCE_DIR}") endif () - FetchContent_Declare( - pico_sdk - GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk - GIT_TAG master - ) + # GIT_SUBMODULES_RECURSE was added in 3.17 + if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.17.0") + FetchContent_Declare( + pico_sdk + GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk + GIT_TAG master + GIT_SUBMODULES_RECURSE FALSE + ) + else () + FetchContent_Declare( + pico_sdk + GIT_REPOSITORY https://github.com/raspberrypi/pico-sdk + GIT_TAG master + ) + endif () + if (NOT pico_sdk) message("Downloading Raspberry Pi Pico SDK") FetchContent_Populate(pico_sdk)