raspberrypi / pico-vscode

The official VS Code extension for Raspberry Pi Pico development. It includes several features to simplify project creation and deployment.
https://marketplace.visualstudio.com/items?itemName=raspberry-pi.raspberry-pi-pico
Mozilla Public License 2.0
131 stars 16 forks source link

How to specify SDK as submodule? #101

Closed Slion closed 1 month ago

Slion commented 1 month ago

Rather than using an official SDK distribution I'm using the SDK as a submodule. How to get it working with this extension?

Before it was a simple matter of doing:

set(PICO_SDK_PATH "../lib/pico-sdk")
include(pico_sdk_import.cmake)
will-v-pi commented 1 month ago

You should not use a relative path in the CMakeLists.txt file, as that will only work when cmake is run from within the build directory - instead use

set(PICO_SDK_PATH "${CMAKE_CURRENT_LIST_DIR}/lib/pico-sdk")

That should work fine with this extension, provided you put it after the extension setup in CMakeLists.txt (as that also sets PICO_SDK_PATH)

Slion commented 1 month ago

That did it, thanks!