Closed CHiPs44 closed 3 months ago
Yes, this won't work as the extension just parses the text from that line. By default this extension only works with CMake projects containing a single executable, where the executable name matches the project name, and the project name is not a variable in the CMakeLists.txt file.
If you want to use a variable for the project name, then you'll need to tell this extension to use the CMakeTools extension, which should work with any CMakeLists.txt file. You can do this by modifying the follow settings in the .vscode/settings.json file
"raspberry-pi-pico.cmakeAutoConfigure": false,
"raspberry-pi-pico.useCmakeTools": true,
You can optionally also set these to true
"cmake.configureOnEdit": true,
"cmake.automaticReconfigure": true,
"cmake.configureOnOpen": true,
This will cause this extension to use the CMakeTools extension for compilation, so you may need to click the CMake icon on the left to set it up correctly. If prompted to select a kit, choose the Pico kit.
Thanks for the FTL explanation!
When I
set(PROJECT_NAME foobar)
inCMakeLists.txt
file and use it asproject(${PROJECT_NAME} C CXX ASM)
, I get this kind of errors when trying to run the project:If I replace every occurrence of
${PROJECT_NAME}
withfoobar
, everything runs fine and UF2.NB: compiling project works with
PROJECT_NAME
variable.