-
Notifications
You must be signed in to change notification settings - Fork 997
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
picotool 2.0.0 executable is not found during cmake -G #1818
Comments
I have this issue in Ubuntu 22.04 (Running in WSL2). I have added picotool version 2.0.0 to my path, but cmake isn't grabbing it.
How else can I tell cmake where it is? |
Hi! (1) Obtain and build picotool manually, using the steps written at the picotool github page. Create a folder called (say) /home/bhass1/development/pico/tools/picotool and place the picotool binary in that picotool folder. (2) Add an environment variable in Linux (e.g. in .bashrc) something like: (3) In your pico-sdk/tools folder, locate the file called Findpicotool.cmake and edit it, and insert the following near the top, after the line containing cmake_minimum_required(VERSION 3.17) :
Now if you close and re-open your shell prompt (so that the environment variable is read) and then delete your project build directory, and then create the build directory and re-start from your cmake -G ..etc command, hopefully your new environment variable will be detected by that Findpicotool.cmake file and use the built picotool, instead of downloading and building within the project. If it works or doesn't please report back! I might not know the answer, but can take a look in case I spot anything in your output. |
Hi @shabaz123, thank you for the detailed help! I decided to try the recommended approach by @will-v-pi in PR #1820, and that worked for me. Running Here's my output from
I hope this helps you! |
Thanks for the response! Awesome, great to hear the recommended method is confirmed functioning. |
This solution solved my problem too, quickly and easily, thanks mate 🤝 |
And there are 2 more steps:
Than you can build other project using |
Having this issue, however cmake --install dont fix it. It looks to be working with this output:
Guessing it is still trying to get it from somewhere else? |
That issue has been fixed already on the picotool develop branch - the CMake files should be installed to local/lib not local/lib64, else the SDK can’t find them |
Thank you for your quick reply. |
Fixed in develop |
Environment: Windows 11, SDK 2.0.0, trying to build a project for the Pico.
The issue is that when trying to perform a cmake -G "NMake Makefiles" .. or cmake -G "Ninja" .. there is a message that picotool is not found and will be built from source.
If the user already has a v2.0.0 picotool executable, it is not detected by the pico-sdk/tools/Findpicotool.cmake file.
I cannot use the Pico Setup for Windows installer, because that is version 1.5.
I believe I have a solution (also described at raspberrypi forum here).
The solution is to place the prebuilt picotool.exe into any desired folder, and then set a Windows System environment variable called PICOTOOL_OVERRIDE_DIR to that folder path which contains picotool.exe.
Then, I added the following into the pico-sdk/tools/Findpicotool.cmake file, at the top (after the cmake_minimum_required(VERSION 3.17) line:
What the above does, is if the PICOTOOL_OVERRIDE_DIR system env var is set, it uses the picotool executable in there, tests if it is the correct version, and if so, then simply uses that.
I have tested by doing a build, and can see that the .uf2 file was successfully created. I have attached the output showing that.
In case it is acceptable, I'll create a PR and reference this issue.
nmake_output.txt
cmake_g_nmake_makefile_output.txt
The text was updated successfully, but these errors were encountered: