Pico-Green-Clock icon indicating copy to clipboard operation
Pico-Green-Clock copied to clipboard

pico_sdk_import.cmake missing and other

Open xysticus opened this issue 11 months ago • 1 comments

Hello, Seems that file pico_sdk_import.cmake is missing and required. I use the last pico sdk on ubuntu.

CMake Error at CMakeLists.txt:9 (include): include could not find requested file:

pico_sdk_import.cmake

-- The C compiler identification is GNU 13.2.0 -- The CXX compiler identification is GNU 13.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:21 (pico_sdk_init): Unknown CMake command "pico_sdk_init".

-- Configuring incomplete, errors occurred!

If i had this file new error is :

CMake Error: Error required internal CMake variable not set, cmake may not be built correctly. Missing variable is: CMAKE_ASM_COMPILE_OBJECT

It works by adding CXX ASM ASM in project() : project(Pico-Green-Clock CXX C ASM)

And fail on make [ 8%] Built target ELF2UF2Build [ 8%] Building ASM object pico-sdk/src/rp2_common/boot_stage2/CMakeFiles/bs2_default.dir/compile_time_choice.S.o /home/alexandre/pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S: Messages de l'assembleur: /home/alexandre/pico/pico-sdk/src/rp2_common/boot_stage2/boot2_w25q080.S:13: Erreur: pseudo-op inconnu: « .syntax »

xysticus avatar Mar 02 '24 16:03 xysticus

Bonjour Alexandre,

Merci pour avoir pris le temps de me transmettre ce commentaire...

As for the "pico_sdk_import.cmake", I use to make a symbolic link to a centralized copy (of pico_sdk_import.cmake) in every project directory. This way, once you update the SDK for the latest version on your system, all your projects can benefit from the update without having to make an update for each project. (This is the reason why it is not part of the listed files, I guess). It could be a good idea for me to add a comment about that...

As for the missing variable in CMake, I don't have this problem on my development environment (I use Visual Studio Code on a Raspberry Pi 4 - currently upgrading to a Raspberry Pi 5).

So, you say that to get rid of the problem, you replaced the line:

project(Pico-Green-Clock)

by:

project(Pico-Green-Clock CXX C ASM)

in the CMakeLists.txt file right ? I made the change in my CMakeLists.txt file and the build still works without problem. It may depend of some specific setting in your environment... Whatever the case, I updated the CMakeLists.txt, so that it will be updated with the next update (which I don't plan to do in the short term, however, since I'm working on the Pico-RGB-Matrix for now...

André

astlouys avatar Mar 02 '24 17:03 astlouys