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

Improve project importing and CMake Tools integration for pico-examples #46

Open
will-v-pi opened this issue Aug 19, 2024 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@will-v-pi
Copy link
Collaborator

The pico-examples repository is just one example, but there are a couple of improvements that I think will help with importing other projects too:

  • Add/replace set(PICO_BOARD xxx CACHE STRING "Board type") to the imported project CMakeLists.txt - and also add board selection to the Import Project webview
  • Detect whether a project will require CMake Tools, and switch to that (maybe with a popup to ask the user) - this will be for any project where there are multiple executables (eg pico-examples)
  • As part of this, maybe add a command to toggle between CMake Tools and this extension for compiling - this would toggle
    • "raspberry-pi-pico.cmakeAutoConfigure": true -> false
    • "raspberry-pi-pico.useCmakeTools": false -> true
    • "cmake.configureOnEdit": false -> true
    • "cmake.automaticReconfigure": false -> true
    • "cmake.configureOnOpen": false -> true
  • Use the "Configure CMake" button to trigger configuring the CMake Tools extension (like we do for the launchTargetPath stuff)
  • Remove "toolchainFile" from generated cmake-kits.json - it's not necessary, as the SDK configures the correct one
@will-v-pi will-v-pi added the enhancement New feature or request label Aug 19, 2024
will-v-pi added a commit that referenced this issue Oct 30, 2024
Defaults to pico board for now, but board selection can be added in future
@jdbruner
Copy link

jdbruner commented Dec 3, 2024

Another suggestion: When importing an existing project, check if its CMakeLists.txt already includes the VSCode extension block (marked by the "DO NOT EDIT THE FOLLOWING LINES for the Raspberry Pi Pico VS Code Extension to work" comments). If so, replace it with the newly-constructed block. Currently, another block is prepended to the file (requiring manual removal of the duplicate).

BTW, should the set(PICO_BOARD xxx CACHE STRING "Board type") line be inside this block instead of immediately following it?

@will-v-pi
Copy link
Collaborator Author

You shouldn't need to import an existing project - if it already has those lines at the top it should work with the extension without needing an import. If you have a project like that which does require an import to work, could you share it so we can figure out why it's not being detected as a pico project?

The PICO_BOARD line is outside that block because it can be modified by a user, and some imported projects may wish to have it in a different place in the file, so keeping it outside the block means that the structure of the block is the same for all projects.

will-v-pi added a commit that referenced this issue Dec 18, 2024
Skips adding the DO_NOT_EDIT_HEADER when importing project which already has one, and replace an old prefix with a new one

Relates to #46, #122
shalxmva pushed a commit to shalxmva/pico-vscode that referenced this issue Jan 6, 2025
Skips adding the DO_NOT_EDIT_HEADER when importing project which already has one, and replace an old prefix with a new one

Relates to raspberrypi#46, raspberrypi#122
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants