chmorgan / esphttpd-freertos

freertos example of libesphttpd for esp32 and esp8266
53 stars 14 forks source link

Syntax error in cmake code at when parsing string Invalid escape sequence \d #32

Open ShaunLeMouton opened 3 years ago

ShaunLeMouton commented 3 years ago

I used the 4.0 esp idf with python 3.8 at windows 10 with visual studio code:

`Make Error at C:/dev/ESP32/esp-idf/esp-idf/tools/cmake/component.cmake:222 (message): CMake Warning (dev) at build_properties.temp.cmake:2 (set):

Syntax error in cmake code at

  C:/dev/ESP32/esphttpd-freertos/build/bootloader/build_properties.temp.cmake:2

when parsing string

  c:\dev\ESP32\tools\python_env\idf4.0_py3.8_env\Scripts\python.exe

Invalid escape sequence \d

Policy CMP0010 is not set: Bad variable reference syntax is an error.  Run
"cmake --help-policy CMP0010" for policy details.  Use the cmake_policy
command to set the policy and suppress this warning.

Call Stack (most recent call first):

C:/dev/ESP32/esp-idf/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:1 (include)

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at C:/dev/ESP32/tools/tools/cmake/3.13.4/share/cmake-3.13/Modules/CheckCSourceCompiles.cmake:98 (try_compile):

try_compile command is not scriptable

Call Stack (most recent call first):

C:/dev/ESP32/tools/tools/cmake/3.13.4/share/cmake-3.13/Modules/CheckCCompilerFlag.cmake:50 (CHECK_C_SOURCE_COMPILES)
C:/dev/ESP32/esp-idf/esp-idf/components/libesphttpd/CMakeLists.txt:8 (check_c_compiler_flag)
C:/dev/ESP32/esp-idf/esp-idf/components/libesphttpd/CMakeLists.txt:15 (enable_c_compiler_flag_if_supported)
C:/dev/ESP32/esp-idf/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:60 (include)
C:/dev/ESP32/esp-idf/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:76 (__component_get_requirements)

Call Stack (most recent call first): C:/dev/ESP32/esp-idf/esp-idf/tools/cmake/build.cmake:404 (__component_get_requirements) C:/dev/ESP32/esp-idf/esp-idf/tools/cmake/project.cmake:348 (idf_build_process) CMakeLists.txt:27 (project)

-- Configuring incomplete, errors occurred! See also "C:/dev/ESP32/esphttpd-freertos/build/bootloader/CMakeFiles/CMakeOutput.log". [76/274] Building C object esp-idf/newlib/CMakeFiles/__idf_newlib.dir/time.c.obj ninja: build stopped: subcommand failed.

phatpaul commented 3 years ago

Sorry for the lack of support. I have been putting-off my upgrade to IDF 4 since I'm happily working on 3.3 on Windows. Have you resolved it? If so please provide PR.

georgik commented 3 years ago

This problem occurs on Windows when CMakeLists.txt contains environment variable expansion like this:

include("$ENV{IDF_PATH}/tools/cmake/project.cmake")

CMake is complaining about the first backlash in the path:

c:\dev\ESP32\tools\python_env\idf4.0_py3.8_env\Scripts\python.exe

CMake suggests using file(TO_CMAKE_PATH "<path>" <variable>): https://cmake.org/cmake/help/latest/command/file.html#to-cmake-path