Unable to build from VSCode extension: CMAKE_MAKE_PROGRAM is not set

squire
Posts: 7
Joined: Tue Oct 15, 2024 8:25 pm

Unable to build from VSCode extension: CMAKE_MAKE_PROGRAM is not set

Postby squire » Fri Oct 17, 2025 6:13 pm

Ever since I switched to Windows 11 a few months ago, whenever I tried to use idf.py from the IDF terminal in VSCode, I would get the following error:
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.
Yesterday, I finally followed those instructions, and immediatley the terminal started working. However, now I can't build via the VSCode extension:
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.50.0.windows.2")
-- Component directory C:/Users/squire/esp/v5.4.1/esp-idf/components/build does not contain a CMakeLists.txt file. No component will be added
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
Restoring the settings in App execution aliases didn't fix it. Deleting the build folder didn't fix it. I've also tried rebooting, I've reinstalled IDF, and I've compared settings with my colleagues. No change. I can build from the IDF terminal by calling idf.py build. After building from terminal I can use the build task again, but it fails with
Executing task: C:\Users\squire\.espressif\tools\ninja\1.12.1\ninja.EXE

[1/130] Building CXX object esp-idf/ui/CMakeFiles/__idf_ui.dir/ui_img_manager_custom.cpp.obj
FAILED: esp-idf/ui/CMakeFiles/__idf_ui.dir/ui_img_manager_custom.cpp.obj
ccache C:\Users\squire\.espressif\tools\xtensa-esp-elf\esp-14.2.0_20241119\xtensa-esp-elf\bin\xtensa-esp32s3-elf-g++.exe -DESP_PLATFORM -DIDF_VER=\"v5.4.1-dirty\" -DLV_CONF_INCLUDE_SIMPLE -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -DMD5_ENABLED=1 -DSERIAL_FLASHER_BOOT_HOLD_TIME_MS=50 -DSERIAL_FLASHER_BOOT_INVERT=false -DSERIAL_FLASHER_DEBUG_TRACE=false -DSERIAL_FLASHER_INTERFACE_UART -DSERIAL_FLASHER_RESET_HOLD_TIME_MS=1000 -DSERIAL_FLASHER_RESET_INVERT=false -DSERIAL_FLASHER_WRITE_BLOCK_RETRIES=3 -DSOC_MMU_PAGE_SIZE=CONFIG_MMU_PAGE_SIZE -DSOC_XTAL_FREQ_MHZ=CONFIG_XTAL_FREQ -D_GLIBCXX_HAVE_POSIX_SEMAPHORE -D_GLIBCXX_USE_POSIX_SEMAPHORE -D_GNU_SOURCE -D_POSIX_READER_WRITER_LOCKS -IC:/Repos/Project/build/config -IC:/Repos/Project/components/ui -IC:/Repos/Project/components/ui/src -IC:/Users/squire/esp/v5.4.1/esp-idf/components/newlib/platform_include -IC:/Users/squire/esp/v5.4.1/esp-idf/components/freertos/config/include [lots more files] -mlongcalls -fno-builtin-memcpy -fno-builtin-memset -fno-builtin-bzero -fno-builtin-stpcpy -fno-builtin-strncpy -w -fdiagnostics-color=always -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=unused-but-set-variable -Wno-error=deprecated-declarations -Wextra -Wno-error=extra -Wno-unused-parameter -Wno-sign-compare -Wno-enum-conversion -gdwarf-4 -ggdb -mdisable-hardware-atomics -O2 -fstack-protector-all -fmacro-prefix-map=C:/Repos/Project=. -fmacro-prefix-map=C:/Users/squire/esp/v5.4.1/esp-idf=/IDF -fstrict-volatile-bitfields -fno-jump-tables -fno-tree-switch-conversion -Wno-format-nonliteral -Wno-format-security -Wno-maybe-uninitialized -Wno-unused-variable -Wno-unused-function -Wformat=0 -std=gnu++2b -fno-exceptions -fno-rtti -fuse-cxa-atexit -MD -MT esp-idf/ui/CMakeFiles/__idf_ui.dir/ui_img_manager_custom.cpp.obj -MF esp-idf\ui\CMakeFiles\__idf_ui.dir\ui_img_manager_custom.cpp.obj.d -o esp-idf/ui/CMakeFiles/__idf_ui.dir/ui_img_manager_custom.cpp.obj -c C:/Repos/Project/components/ui/ui_img_manager_custom.cpp
CreateProcess failed: The system cannot find the file specified.
I am at a complete loss and would appreciate some help solving this.

squire
Posts: 7
Joined: Tue Oct 15, 2024 8:25 pm

Re: Unable to build from VSCode extension: CMAKE_MAKE_PROGRAM is not set

Postby squire » Fri Oct 24, 2025 1:15 am

I did some more poking around, and eventually I found some of the enviroment variables aren't being set right. If I make my pre-build task $env:PATH -split ';' and then try to build, I get the following:
C:\Users\squire\.espressif\python_env\idf5.4_py3.11_env\Scripts
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
C:\Program Files\Microsoft VS Code\bin
C:\Program Files\dotnet\
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
C:\Program Files\Git\cmd
C:\Program Files\doxygen\bin
C:\Program Files\Graphviz\bin
C:\Users\squire\AppData\Local\Microsoft\WindowsApps
C:\Users\squire\AppData\Local\GitHubDesktop\bin
C:\Users\squire\.dotnet\tools
C:\Users\squire\.espressif\python_env\idf5.4_py3.11_env\Scripts
C:\Users\squire\AppData\Local\GitHubDesktop\bin
However, if I run the same command from the IDF terminal, I get the following on my work computer:
C:\Users\squire\esp\v5.4.1\esp-idf\components\espcoredump
C:\Users\squire\esp\v5.4.1\esp-idf\components\partition_table
C:\Users\squire\.espressif\tools\esp-rom-elfs\20241011
C:\Users\squire\.espressif\tools\idf-git\2.39.2\cmd
C:\Users\squire\.espressif\tools\xtensa-esp-elf-gdb\14.2_20240403\xtensa-esp-elf-gdb\bin
C:\Users\squire\.espressif\tools\riscv32-esp-elf-gdb\14.2_20240403\riscv32-esp-elf-gdb\bin
C:\Users\squire\.espressif\tools\xtensa-esp-elf\esp-14.2.0_20241119\xtensa-esp-elf\bin
C:\Users\squire\.espressif\tools\esp-clang\esp-18.1.2_20240912\esp-clang\bin
C:\Users\squire\.espressif\tools\riscv32-esp-elf\esp-14.2.0_20241119\riscv32-esp-elf\bin
C:\Users\squire\.espressif\tools\esp32ulp-elf\2.38_20240113\esp32ulp-elf\bin
C:\Users\squire\.espressif\tools\cmake\3.30.2\bin
C:\Users\squire\.espressif\tools\openocd-esp32\v0.12.0-esp32-20241016\openocd-esp32\bin
C:\Users\squire\.espressif\tools\ninja\1.12.1\
C:\Users\squire\.espressif\tools\idf-exe\1.0.3\
C:\Users\squire\.espressif\tools\ccache\4.10.2\ccache-4.10.2-windows-x86_64
C:\Users\squire\.espressif\tools\dfu-util\0.11\dfu-util-0.11-win64
C:\Users\squire\.espressif\python_env\idf5.4_py3.11_env\Scripts
C:\Users\squire\esp\v5.4.1\esp-idf\tools
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
C:\Windows\System32\WindowsPowerShell\v1.0\
C:\Windows\System32\OpenSSH\
C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
C:\Program Files\Microsoft VS Code\bin
C:\Program Files\dotnet\
C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
C:\Program Files\Git\cmd
C:\Program Files\doxygen\bin
C:\Program Files\Graphviz\bin
C:\Users\squire\AppData\Local\Microsoft\WindowsApps
C:\Users\squire\AppData\Local\GitHubDesktop\bin
C:\Users\squire\.dotnet\tools
C:\Users\squire\.espressif\python_env\idf5.4_py3.11_env\Scripts
C:\Users\squire\AppData\Local\GitHubDesktop\bin
and my personal computer produces a similar output when the command is run from the pre-build task. VSCode settings are synced between the two machines and I'm trying to build on the same repo and commit. Adding the missing paths to tasks.json does nothing, adding them to my system PATH variable does nothing. I am so confused.

Who is online

Users browsing this forum: No registered users and 3 guests