pico-sdk
pico-sdk copied to clipboard
Add PICOTOOL_OVERRIDE_DIR
Submitting against 'develop' Fixes #1818
When using Windows 11 and SDK 2.0.0, when trying to do a cmake -G "NMake Makefiles" .. or cmake -G "Ninja" .. then picotool executable is not found, and it gets built within the project. The Findpicotool.cmake file does not seem to find the picotool executable at least with Windows, I have not checked Linux/Mac.
I have a solution which should be benign, since it only kicks in if the user creates a system environment variable in Windows, called PICOTOOL_OVERRIDE_DIR. If that is set, then the picotool.exe file there is used (and the version command is executed to confirm it is the correct version).
The submitted change is in a single file (Findpicotool.cmake), placed near the top of the file, after the cmake_minimum_required(VERSION 3.17) line.
I have tested by performing a build, and I can see that the picotool executable was used, and that the .uf2 file was successfully created.
The attached files evidence that, and at the end there is a dir listing that shows that the .uf2 file was created.