Skip to content
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

CMAKE_PREFIX_PATH content lost in middle of the CMake configuration step #1578

Open
opilat opened this issue Dec 12, 2023 · 1 comment
Open
Assignees
Labels
Milestone

Comments

@opilat
Copy link

opilat commented Dec 12, 2023

Pico examples project (picow_blink) configured with -DCMAKE_PREFIX_PATH=path_to_arm_none_eabi_toolchain command line option fails to configure. Before the C compiler test step, it loses the content of the CMAKE_PREFIX_PATH.
-- Detecting C compiler ABI info CMake Error at C:/Projects/pico/pico-sdk/cmake/preload/toolchains/find_compiler.cmake:28 (message): Compiler 'arm-none-eabi-gcc' not found, you can specify search path with "PICO_TOOLCHAIN_PATH".
configure_issue.txt

@Krakonos
Copy link

Note this issue can be fixed by either passing the CMAKE_PREFIX_PATH as an environment variable, or setting before running project:

set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES CMAKE_PREFIX_PATH)

The problem is that try try_compile creates a CMakeFiles.txt that includes the preload/toolchains/pico_arm_gcc.cmake. I'm not sure how this mechanism should work, but seems like bad practice to depend on a specific ways to pass the variable. If something, I suggest using the variable above to pass the previously found compiler paths directly, instead of trying to find it again - since there may be other factors causing a different compiler is found in the toplevel cmake, and a different one is found in the generated try-compile cmake.

@kilograham kilograham added this to the 1.6.0 milestone May 19, 2024
@kilograham kilograham self-assigned this May 19, 2024
@kilograham kilograham modified the milestones: 1.6.1, 1.6.0 May 19, 2024
@kilograham kilograham modified the milestones: 1.6.0, 1.6.2 Jul 20, 2024
@kilograham kilograham modified the milestones: 1.6.2, 2.0.0, 2.0.1 Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants