Problem building my first ESP-IDF project successfully. It works with PIO cli

I have been using platformio for my arduinio and ESP32 projects via the arduinio frame work for a while now. I recently decided to start using Espressif ESP-IDF. I followed the Espressif “getting started” guide and did the manual command line route. This all work perfectly and I then decided to migrate to the platformio enviroment. I installed the Espressif extension and then followed the steps as per the espressif “getting started”. I setup my first “hello world” project and when running the building process ran into various issues. I tried to build the project from the cli using the pio command. I evenually got this to work successfully to build, flash and monitor the ESP32 board. However each time I opened and closed the pio terminal, I had to export some paths using an alias that I used with the original stand alone esp-idf cli - using idf.py command. This exporing of the paths had no effect on the plaftformio IDE.

When I installed the IDF extension and installed it I used the express option and choose to use the existing ESP-IDF files.

I started afresh and went to PIO home and imported a Example of hello world

Screenshot from 2023-11-24 16-28-11

and when I press the ESP-IDF build project on the bottom stays bar i get :-

 Executing task: cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B /home/gavin/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/build -S /home/gavin/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world 

CMake Error at /home/gavin/esp/esp-idf/tools/cmake/project.cmake:506:
  Parse error.  Expected a command name, got unquoted argument with text
  "__project${MyIDFProject}".
Call Stack (most recent call first):
  CMakeLists.txt:5 (include)


-- Configuring incomplete, errors occurred!

 *  The terminal process "/usr/bin/bash '-c', 'cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -B /home/gavin/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/build -S /home/gavin/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world'" failed to launch (exit code: 1). 


I am not sure where the project name came from.

__project${MyIDFProject}

my pio.ini looks like this.

;
;   Build options: build flags, source filter, extra scripting
;   Upload options: custom port, speed and extra flags
;   Library options: dependencies, extra library storages
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env]
platform = espressif32
framework = espidf
monitor_speed = 115200

[env:esp32dev]
board = esp32dev

hello_world_main.c

 * SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: CC0-1.0
 */

#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_chip_info.h"
#include "esp_flash.h"

void app_main(void)
{
    printf("Hello world!\n");

    /* Print chip information */
    esp_chip_info_t chip_info;
    uint32_t flash_size;
    esp_chip_info(&chip_info);
    printf("This is %s chip with %d CPU core(s), WiFi%s%s, ",
           CONFIG_IDF_TARGET,
           chip_info.cores,
           (chip_info.features & CHIP_FEATURE_BT) ? "/BT" : "",
           (chip_info.features & CHIP_FEATURE_BLE) ? "/BLE" : "");

    unsigned major_rev = chip_info.revision / 100;
    unsigned minor_rev = chip_info.revision % 100;
    printf("silicon revision v%d.%d, ", major_rev, minor_rev);
    if(esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
        printf("Get flash size failed");
        return;
    }

    printf("%uMB %s flash\n", flash_size / (1024 * 1024),
           (chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");

    printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());

    for (int i = 10; i >= 0; i--) {
        printf("Restarting in %d seconds...\n", i);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
    printf("Restarting now.\n");
    fflush(stdout);
    esp_restart();
}

CMakeLists.txt in src directory


                    INCLUDE_DIRS "")

target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

If I type Doctor Command in the command pallet I get this file

OS linux x64 6.5.0-13-generic 
System environment variable IDF_PYTHON_ENV_PATH 
 undefined 
System environment variable PATH 
 <HOMEPATH>/esp/esp-idf/tools:<HOMEPATH>/.local/bin:<HOMEPATH>/bin:<HOMEPATH>/esp/esp-idf/tools:<HOMEPATH>/.local/bin:<HOMEPATH>/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin 
System environment variable PYTHON 
 undefined 
Visual Studio Code version 1.84.2 
Visual Studio Code language en 
Visual Studio Code shell /usr/bin/bash 
ESP-IDF Extension version 1.6.5 
Workspace folder <HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world 
---------------------------------------------------- Extension configuration settings ------------------------------------------------------
ESP-ADF Path (idf.espAdfPath) ${env:ADF_PATH}
ESP-IDF Path (idf.espIdfPath) <HOMEPATH>/esp/esp-idf
ESP-MDF Path (idf.espMdfPath) ${env:MDF_PATH}
ESP-Matter Path (idf.espMatterPath) ${env:ESP_MATTER_PATH}
Custom extra paths (idf.customExtraPaths) <HOMEPATH>/.espressif/tools/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin:<HOMEPATH>/.espressif/tools/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin:<HOMEPATH>/.espressif/tools/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin:<HOMEPATH>/.espressif/tools/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin:<HOMEPATH>/.espressif/tools/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin:<HOMEPATH>/.espressif/tools/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin:<HOMEPATH>/.espressif/tools/tools/ninja/1.11.1:<HOMEPATH>/.espressif/tools/tools/esp-rom-elfs/20230320
Custom extra vars (idf.customExtraVars)
    OPENOCD_SCRIPTS: <HOMEPATH>/.espressif/tools/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/share/openocd/scripts
    ESP_ROM_ELF_DIR: <HOMEPATH>/.espressif/tools/tools/esp-rom-elfs/20230320/
Virtual env Python Path (idf.pythonBinPath) <HOMEPATH>/.espressif/tools/python_env/idf5.3_py3.11_env/bin/python
Serial port (idf.port) /dev/ttyUSB1
OpenOCD Configs (idf.openOcdConfigs) board/esp32-bridge.cfg
ESP-IDF Tools Path (idf.toolsPath) <HOMEPATH>/.espressif/tools
Git Path (idf.gitPath) git
-------------------------------------------------------- Configurations access -------------------------------------------------------------
Access to ESP-ADF Path (idf.espAdfPath) false
Access to ESP-IDF Path (idf.espIdfPath) true
Access to ESP-MDF Path (idf.espMdfPath) false
Access to ESP-Matter Path (idf.espMatterPath) false
Access to ESP-IDF Custom extra paths
Access to <HOMEPATH>/.espressif/tools/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin: true
Access to <HOMEPATH>/.espressif/tools/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin: true
Access to <HOMEPATH>/.espressif/tools/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin: true
Access to <HOMEPATH>/.espressif/tools/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin: true
Access to <HOMEPATH>/.espressif/tools/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin: true
Access to <HOMEPATH>/.espressif/tools/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin: true
Access to <HOMEPATH>/.espressif/tools/tools/ninja/1.11.1: true
Access to <HOMEPATH>/.espressif/tools/tools/esp-rom-elfs/20230320: true
Access to Virtual env Python Path (idf.pythonBinPath) true
Access to CMake in environment PATH true
Access to Ninja in environment PATH true
Access to ESP-IDF Tools Path (idf.toolsPath) true
-------------------------------------------------------- Configurations has spaces -------------------------------------------------------------
Spaces in system environment Path false
Spaces in ESP-ADF Path (idf.espAdfPath) false
Spaces in ESP-IDF Path (idf.espIdfPath) false
Spaces in ESP-MDF Path (idf.espMdfPath) false
Spaces in ESP-Matter Path (idf.espMatterPath) false
Spaces in ESP-IDF Custom extra paths
Spaces in <HOMEPATH>/.espressif/tools/tools/xtensa-esp-elf-gdb/12.1_20221002/xtensa-esp-elf-gdb/bin: false
Spaces in <HOMEPATH>/.espressif/tools/tools/riscv32-esp-elf-gdb/12.1_20221002/riscv32-esp-elf-gdb/bin: false
Spaces in <HOMEPATH>/.espressif/tools/tools/xtensa-esp-elf/esp-13.2.0_20230928/xtensa-esp-elf/bin: false
Spaces in <HOMEPATH>/.espressif/tools/tools/riscv32-esp-elf/esp-13.2.0_20230928/riscv32-esp-elf/bin: false
Spaces in <HOMEPATH>/.espressif/tools/tools/esp32ulp-elf/2.35_20220830/esp32ulp-elf/bin: false
Spaces in <HOMEPATH>/.espressif/tools/tools/openocd-esp32/v0.12.0-esp32-20230921/openocd-esp32/bin: false
Spaces in <HOMEPATH>/.espressif/tools/tools/ninja/1.11.1: false
Spaces in <HOMEPATH>/.espressif/tools/tools/esp-rom-elfs/20230320: false
Spaces in Virtual env Python Path (idf.pythonBinPath) false
Spaces in ESP-IDF Tools Path (idf.toolsPath) false
----------------------------------------------------------- Executables Versions -----------------------------------------------------------
Git version 2.40.1
ESP-IDF version 5.3.0
Python version 3.11.6
Python's pip version 23.3.1
-------------------------------------------------- Project configuration settings ----------------------------------------------------------
-------------------------------------------------- Python packages in idf.pythonBinPath ----------------------------------------------------
ajsonrpc version: 1.2.0
anyio version: 4.1.0
bitarray version: 2.8.3
bitstring version: 4.1.2
bottle version: 0.12.25
CacheControl version: 0.13.1
certifi version: 2023.11.17
cffi version: 1.16.0
charset-normalizer version: 3.3.2
click version: 8.0.4
colorama version: 0.4.6
construct version: 2.10.69
contextlib2 version: 21.6.0
cryptography version: 41.0.5
ecdsa version: 0.18.0
esp-coredump version: 1.7.0
esp-debug-backend version: 1.0.3
esp-idf-kconfig version: 2.0.1
esp-idf-monitor version: 1.3.3
esp-idf-panic-decoder version: 0.2.0
esp-idf-size version: 0.4.3
esptool version: 4.7.dev3
filelock version: 3.13.1
freertos-gdb version: 1.0.2
gcovr version: 6.0
h11 version: 0.14.0
idf-component-manager version: 1.4.1
idna version: 3.4
intelhex version: 2.3.0
Jinja2 version: 3.0.3
kconfiglib version: 14.1.0
lxml version: 4.9.3
MarkupSafe version: 2.1.3
marshmallow version: 3.20.1
msgpack version: 1.0.7
packaging version: 23.2
pip version: 23.3.1
platformio version: 6.1.11
pyclang version: 0.4.2
pycparser version: 2.21
pyelftools version: 0.29
pygdbmi version: 0.9.0.2
Pygments version: 2.17.2
pyparsing version: 3.1.1
pyserial version: 3.5
PyYAML version: 6.0.1
reedsolo version: 1.7.0
requests version: 2.31.0
requests-file version: 1.5.1
requests-toolbelt version: 1.0.0
schema version: 0.7.5
semantic-version version: 2.10.0
setuptools version: 69.0.2
six version: 1.16.0
sniffio version: 1.3.0
starlette version: 0.31.1
tabulate version: 0.9.0
tqdm version: 4.66.1
urllib3 version: 1.26.18
uvicorn version: 0.23.2
websocket-client version: 1.6.4
wsproto version: 1.2.0
---------------------------------------------------- Check ESP-IDF python requirements.txt -------------------------------------------------
Check ESP-IDF Python packages Python requirements are satisfied.
---------------------------------------------------- Check extension requirements.txt ------------------------------------------------------
Check Extension Python packages Python requirements are satisfied.
---------------------------------------------------- Check ESP-IDF debug adapter requirements.txt ------------------------------------------
Check Debug AdapterPython packages Python requirements are satisfied.
---------------------------------------------------- Visual Studio Code launch.json --------------------------------------------------------
// AUTOMATICALLY GENERATED FILE. PLEASE DO NOT MODIFY IT MANUALLY
//
// PIO Unified Debugger
//
// Documentation: https://docs.platformio.org/page/plus/debugging.html
// Configuration: https://docs.platformio.org/page/projectconf/section_env_debug.html

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug",
            "executable": "<HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/.pio/build/esp32dev/firmware.elf",
            "projectEnvName": "esp32dev",
            "toolchainBinDir": "<HOMEPATH>/.platformio/packages/toolchain-xtensa-esp32/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "preLaunchTask": {
                "type": "PlatformIO",
                "task": "Pre-Debug"
            }
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (skip Pre-Debug)",
            "executable": "<HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/.pio/build/esp32dev/firmware.elf",
            "projectEnvName": "esp32dev",
            "toolchainBinDir": "<HOMEPATH>/.platformio/packages/toolchain-xtensa-esp32/bin",
            "internalConsoleOptions": "openOnSessionStart"
        },
        {
            "type": "platformio-debug",
            "request": "launch",
            "name": "PIO Debug (without uploading)",
            "executable": "<HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/.pio/build/esp32dev/firmware.elf",
            "projectEnvName": "esp32dev",
            "toolchainBinDir": "<HOMEPATH>/.platformio/packages/toolchain-xtensa-esp32/bin",
            "internalConsoleOptions": "openOnSessionStart",
            "loadMode": "manual"
        }
    ]
}
 
---------------------------------------------------- Visual Studio Code c_cpp_properties.json ----------------------------------------------
//
// !!! WARNING !!! AUTO-GENERATED FILE!
// PLEASE DO NOT MODIFY IT AND USE "platformio.ini":
// https://docs.platformio.org/page/projectconf/section_env_build.html#build-flags
//
{
    "configurations": [
        {
            "name": "PlatformIO",
            "includePath": [
                "<HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/include",
                "<HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/src",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/xtensa/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/xtensa/esp32/include",
                "<HOMEPATH>/Documents/PlatformIO/Projects/231124-162919-espidf-hello-world/.pio/build/esp32dev/config",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/newlib/platform_include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/freertos/FreeRTOS-Kernel/portable/xtensa/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/freertos/esp_additions/include/freertos",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/freertos/esp_additions/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/freertos/esp_additions/arch/xtensa/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_hw_support/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_hw_support/include/soc",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_hw_support/include/soc/esp32",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_hw_support/port/esp32",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_hw_support/port/esp32/private_include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/heap/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/log/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/soc/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/soc/esp32",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/soc/esp32/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/hal/esp32/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/hal/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/hal/platform_port/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_rom/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_rom/include/esp32",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_rom/esp32",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_common/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_system/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_system/port/soc",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_system/port/include/private",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/include/apps",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/include/apps/sntp",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/lwip/src/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/port/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/port/freertos/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/port/esp32xx/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/lwip/port/esp32xx/include/arch",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_ringbuf/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/efuse/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/efuse/esp32/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_timer/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/deprecated",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/analog_comparator/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/dac/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/gpio/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/gptimer/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/i2c/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/i2s/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/ledc/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/mcpwm/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/parlio/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/pcnt/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/rmt/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/sdio_slave/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/sdmmc/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/sigma_delta/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/spi/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/temperature_sensor/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/touch_sensor/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/twai/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/uart/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/usb_serial_jtag/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/driver/touch_sensor/esp32/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_pm/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/mbedtls/port/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/mbedtls/mbedtls/library",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/mbedtls/esp_crt_bundle/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_app_format/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/bootloader_support/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/bootloader_support/bootloader_flash/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_partition/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/app_update/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_mm/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/spi_flash/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/pthread/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/app_trace/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_event/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/nvs_flash/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_phy/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_phy/esp32/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/vfs/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_netif/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/wpa_supplicant/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/wpa_supplicant/port/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/wpa_supplicant/esp_supplicant/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_coex/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_wifi/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_wifi/wifi_apps/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/unity/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/unity/unity/src",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/cmock/CMock/src",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/console",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/http_parser",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp-tls",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp-tls/esp-tls-crypto",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_adc/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_adc/interface",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_adc/esp32/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_adc/deprecated/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_eth/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_gdbstub/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_hid/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/tcp_transport/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_http_client/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_http_server/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_https_ota/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_psram/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_lcd/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_lcd/interface",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/protobuf-c/protobuf-c",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/protocomm/include/common",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/protocomm/include/security",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/protocomm/include/transports",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/esp_local_ctrl/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/espcoredump/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/espcoredump/include/port/xtensa",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/wear_levelling/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/sdmmc/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/fatfs/diskio",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/fatfs/vfs",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/fatfs/src",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/idf_test/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/idf_test/include/esp32",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/ieee802154/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/json/cJSON",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/mqtt/esp-mqtt/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/perfmon/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/spiffs/include",
                "<HOMEPATH>/.platformio/packages/framework-espidf/components/wifi_provisioning/include",
                ""
            ],
           

I see in the first section there are issues with the Python setup. I tried to fix this unsuccessfully. I also see a bit further down that there is a configuration has spaces problem. I have read that IDF does not like spaces in certain file names. ** i have to truncate the doctor report due to space limitaions in this post.

So after trying for many days to get this working, I looking for a bit of guidance on how to tackle the problem.

I have managed to solve the “project.cmake” error. I re installed esp-idf. This file can’t be changed and is system generated. I think i fiddled with that line of code. I got further now but still have issues. Doing a bit more reading I see a lot of the issues originate due to the esp-idf file structure using main directory, whilst the pio uses src directory. So I am now working through the two CMakelist.txt files parameters and am getting a bit further. In a nut shell, you can’t just download a github example and it works without a lot of fiddling. The esp-idf cli works first time time.

  1. You don’t need ESP-IDF extension when working with the PlatformIO project
  2. You don’t need to manually install ESP-IDF globally to your system

So, please remove all unnecessary software and use PlatformIO directly.

Thanks Ivan. I give it a try tonight.

Hello Ivan, I followed you advise re-removing the Espressif ESP-IDF from Platformio and the good news is that I am now working. I wish I knew this earlier. Everywhere that I read, people said you need to install the Extension. It is really nice to be able to work now. Many thanks for your help. The only thing that I am “missing” so far, is the platformio IDE menuconfig button, but I see that I can do the same thing with

pio run -t menuconfig