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

SDK • Re: pico_sdk_import.cmake question

$
0
0
Here's the problem:
viewtopic.php?t=316408
In a huge amount of code I see posted, I see people setting PICO_SDK_PATH in their CMakeLists.txt

The intentions that you NOT set it there (otherwise people will have to change it when they check out your project), but just include pico_sdk_import.cmake which takes care of the stuff below:

You can configure the location it via -DPICO_SDK_PATH to CMake (or set it in the appropriate section of your IDE), or it will be automatically picked up from the PICO_SDK_PATH environment variable when you run CMake. Is this not well documented? it does say effectively this in the README for the SDK here: https://github.com/raspberrypi/pico-sdk.

Same goes for PICO_EXTRAS_PATH / pico_extras_import.cmake (although that also looks for a sibling of your pico-sdk directory called pico-extras)
Here's the solution:
Make it so that PICO_SDK_PATH specified in Environment Variables has priority.

Regarding this question.
viewtopic.php?t=316408
Is this not well documented?
The actual behavior is not well documented. The documentation should be clear on how the *.cmake files manipulate and handle PICO_SDK_PATH.

Statistics: Posted by LemonPi — Thu Mar 07, 2024 11:42 pm



Viewing all articles
Browse latest Browse all 5359

Trending Articles