cmake 3.23 ENV() added extra string at the end to cause build fail
cmake version 3.23, followed this link to build hello world: https://www.zephyrproject.org/zephyr-rtos-on-esp32/
env: 5.13.0-39-generic #44~20.04.1-Ubuntu, zephyr-v3.0.0-2120-g5a3f528387, xtensa-esp32-elf-gcc8_4_0-esp-2020r3-linux-amd64.tar.gz
got this error:
CMake Error at /home/jodai/zephyrproject/zephyr/cmake/toolchain/espressif/generic.cmake:39 (message):
Unable to locate toolchain as
/home/jodai/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elffixed
Call Stack (most recent call first):
at the end of path the "fixed" seems to be added by cmake this line in ~/zephyrproject/zephyr/cmake/toolchain/espressif/generic.cmake cmake_3.23_env_bug.txt file:
set_ifndef(ESPRESSIF_TOOLCHAIN_PATH "$ENV{ESPRESSIF_TOOLCHAIN_PATH}")
if I change above cmake line to following everything works fine:
set(ESPRESSIF_TOOLCHAIN_PATH "/home/jodai/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf")
the path itself has no problem:
/zephyrproject/zephyr/samples/hello_world$ echo $ESPRESSIF_TOOLCHAIN_PATH
/home/jodai/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf
could I expected helps in:
- fix the bug if cmake $ENV() added a postfix "fixed", if not please clarify
- cmake line content "/home/jodai/" cannot be changed to "$(HOME)" nor "~/", which could be improved?
Edited by Craig Scott