Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4477

SDK • How to build VSCode generated project on command line?

$
0
0
I created my project using the Raspberry Pi Pico extension within VSCode installed on Windows. I got my project developed and debugged, but now need to setup for automated building, which is done via the CLI in Linux. When I try to run cmake .. I get this errror:

Code:

CMake Error at CMakeLists.txt:21 (include):  include could not find requested file:    /home/patterrr/.pico-sdk/cmake/pico-vscode.cmake
The VSCode extension adds this section to the CMakelists.txt file:

Code:

# == DO NEVER EDIT THE NEXT LINES for Raspberry Pi Pico VS Code Extension to work ==if(WIN32)    set(USERHOME $ENV{USERPROFILE})else()    set(USERHOME $ENV{HOME})endif()set(sdkVersion 2.0.0)set(toolchainVersion 13_2_Rel1)set(picotoolVersion 2.0.0)include(${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)# ====================================================================================
It seems that cmake .. on the CLI can't find the last line,

Code:

include(${USERHOME}/.pico-sdk/cmake/pico-vscode.cmake)
This makes sense, as VSCode isn't even installed on the build machine. Any suggestions on how to use a singular CMakeLists.txt file for both VSCode development using the Raspberry Pi Pico extension, but also for CLI building? If I remove that one line then cmake functions properly on via the cli.

My first thought is a brute-force way of encapsulating that whole section under an if(), is there a symbol I can use within the if() that is different for VSCode cmake versus CLI cmake? Or perhaps a more elegant solution?

Thank you!

Statistics: Posted by patterrr — Mon Oct 07, 2024 6:09 pm — Replies 2 — Views 54



Viewing all articles
Browse latest Browse all 4477

Trending Articles