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

CMakeLists.txt not found in project directory #5

Open
ghost opened this issue Apr 12, 2021 · 7 comments
Open

CMakeLists.txt not found in project directory #5

ghost opened this issue Apr 12, 2021 · 7 comments

Comments

@ghost
Copy link

ghost commented Apr 12, 2021

When I try to build the project with "idf.py build" I get the following error:
"CMakeLists.txt not found in project directory C:\esp\esp-idf\examples\esp32-sniffer".
How can I fix this?

@J4NN0
Copy link
Member

J4NN0 commented Apr 12, 2021

Hi Janinahemme,

You can try to create file CMakeLists.txt in the root directory of this project (e.g. in your case C:\esp\esp-idf\examples\esp32-sniffer\CMakeLists.txt) and fill it, for instance:

cmake_minimum_required(VERSION 3.2)

include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(esp32-sniffer)

Or maybe better (for this single project), try to compile it via make all and then flash the ESP32 with make flash.

@ghost
Copy link
Author

ghost commented Apr 12, 2021

I get this error when building with "idf.py build" after adding the CMakeLists.txt:
FAILED: esp-idf/espmqtt/CMakeFiles/__idf_espmqtt.dir/lib/transport_ws.c.obj ccache C:\Users\BBW-Benutzer\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-gcc.exe -DHAVE_CONFIG_H -DMBEDTLS_CONFIG_FILE=\"mbedtls/esp_config.h\" -Iconfig -I../components/espmqtt/include -I../components/espmqtt/lib/include -I../../../components/newlib/platform_include -I../../../components/freertos/include -I../../../components/freertos/port/xtensa/include -I../../../components/esp_hw_support/include -I../../../components/esp_hw_support/port/esp32/. -I../../../components/heap/include -I../../../components/log/include -I../../../components/lwip/include/apps -I../../../components/lwip/include/apps/sntp -I../../../components/lwip/lwip/src/include -I../../../components/lwip/port/esp32/include -I../../../components/lwip/port/esp32/include/arch -I../../../components/soc/include -I../../../components/soc/esp32/. -I../../../components/soc/esp32/include -I../../../components/hal/esp32/include -I../../../components/hal/include -I../../../components/esp_rom/include -I../../../components/esp_rom/esp32 -I../../../components/esp_common/include -I../../../components/esp_system/include -I../../../components/esp32/include -I../../../components/driver/include -I../../../components/driver/esp32/include -I../../../components/esp_pm/include -I../../../components/esp_ringbuf/include -I../../../components/efuse/include -I../../../components/efuse/esp32/include -I../../../components/xtensa/include -I../../../components/xtensa/esp32/include -I../../../components/vfs/include -I../../../components/esp_wifi/include -I../../../components/esp_wifi/esp32/include -I../../../components/esp_event/include -I../../../components/esp_netif/include -I../../../components/esp_eth/include -I../../../components/tcpip_adapter/include -I../../../components/app_trace/include -I../../../components/esp_timer/include -I../../../components/nghttp/port/include -I../../../components/nghttp/nghttp2/lib/includes -I../../../components/mbedtls/port/include -I../../../components/mbedtls/mbedtls/include -I../../../components/mbedtls/esp_crt_bundle/include -mlongcalls -Wno-frame-address -ffunction-sections -fdata-sections -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Og -fmacro-prefix-map=C:/esp/esp-idf/examples/esp32-sniffer=. -fmacro-prefix-map=C:/esp/esp-idf=IDF -fstrict-volatile-bitfields -Wno-error=unused-but-set-variable -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER=\"v4.4-dev-744-g1cb31e509\" -DESP_PLATFORM -MD -MT esp-idf/espmqtt/CMakeFiles/__idf_espmqtt.dir/lib/transport_ws.c.obj -MF esp-idf\espmqtt\CMakeFiles\__idf_espmqtt.dir\lib\transport_ws.c.obj.d -o esp-idf/espmqtt/CMakeFiles/__idf_espmqtt.dir/lib/transport_ws.c.obj -c ../components/espmqtt/lib/transport_ws.c In file included from ../components/espmqtt/lib/include/platform_esp32_idf.h:21, from ../components/espmqtt/lib/include/platform.h:11, from ../components/espmqtt/lib/transport_ws.c:5: ../../../components/esp32/include/rom/queue.h:1:2: warning: #warning rom/queue.h is deprecated, please use sys/queue.h instead [-Wcpp] #warning rom/queue.h is deprecated, please use sys/queue.h instead ^~~~~~~ ../components/espmqtt/lib/transport_ws.c: In function 'ws_connect': ../components/espmqtt/lib/transport_ws.c:100:53: error: '258EAFA5-E914-47DA-95CA-C5AB...' directive writing 36 bytes into a region of size between 33 and 64 [-Werror=format-overflow=] int key_len = sprintf((char*)client_key_b64, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", (char*)client_key); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../components/espmqtt/lib/transport_ws.c:100:19: note: 'sprintf' output between 37 and 68 bytes into a destination of size 64 int key_len = sprintf((char*)client_key_b64, "%s258EAFA5-E914-47DA-95CA-C5AB0DC85B11", (char*)client_key); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1.exe: some warnings being treated as errors ninja: build stopped: subcommand failed. ninja failed with exit code 1

I hope you can help me.

@syedadeebul1996
Copy link

so I increased the size of key_len to 100 and it fixed the above issue. But the build fails with the following error now

In file included from ../components/espmqtt/lib/include/platform_esp32_idf.h:21,
from ../components/espmqtt/lib/include/platform.h:11,
from ../components/espmqtt/lib/transport_ws.c:5:
E:/espidf/components/esp32/include/rom/queue.h:1:2: warning: #warning rom/queue.h is deprecated, please use sys/queue.h instead [-Wcpp]
#warning rom/queue.h is deprecated, please use sys/queue.h instead
^~~~~~~
[4/7] Generating ld/esp32.project.ld
warning: the choice symbol MQTT_USE_CORE_0 (defined at E:/espidf/components/mqtt/Kconfig:105, E:/tutorial/esp32-sniffer/components/espmqtt/Kconfig:90) is defined with a prompt outside the choice
warning: the choice symbol MQTT_USE_CORE_1 (defined at E:/espidf/components/mqtt/Kconfig:107, E:/tutorial/esp32-sniffer/components/espmqtt/Kconfig:92) is defined with a prompt outside the choice
warning: the choice symbol MQTT_USE_CORE_0 (defined at E:/espidf/components/mqtt/Kconfig:105, E:/tutorial/esp32-sniffer/components/espmqtt/Kconfig:90) is defined with a prompt outside the choice
warning: the choice symbol MQTT_USE_CORE_1 (defined at E:/espidf/components/mqtt/Kconfig:107, E:/tutorial/esp32-sniffer/components/espmqtt/Kconfig:92) is defined with a prompt outside the choice
[6/7] Linking CXX executable esp32-sniffer.elf
FAILED: esp32-sniffer.elf
cmd.exe /C "cd . && E:.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-g++.exe -mlongcalls -Wno-frame-address @CMakeFiles\esp32-sniffer.elf.rsp -o esp32-sniffer.elf && cd ."
e:/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj):(.literal.main_task+0x18): undefined reference to app_main' e:/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: esp-idf/esp32/libesp32.a(cpu_start.c.obj): in function main_task':
E:/espidf/components/esp32/cpu_start.c:592: undefined reference to `app_main'
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

Can you help here?

@J4NN0
Copy link
Member

J4NN0 commented Sep 10, 2021

@syedadeebul1996 I think this is an issue related to which ESP-IDF version you're using.

I guess you're using the latest stable version (the one on the master branch) that, according to their [releases}(https://github.com/espressif/esp-idf/releases), it is ESP-IDF Release v4.3.1.

Could you please try to use v3.x (you can git checkout <branch> inside esp-idf repo) and then try again to compile (i.e. make all) this project?

@D4Ci0
Copy link

D4Ci0 commented Apr 5, 2023

**Getting the same problem.

With just the newest esp-idf release, it wants a 'CMakeLists.txt', which I just coppied from a 'Hello World' example and edited the project-name.

That didn't help either, it now complained about something else, see the log:**

Executing action: all (aliases: build)
Running cmake in directory /home/daniel/esp/esp32-sniffer/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/home/daniel/.espressif/python_env/idf5.1_py3.8_env/bin/python -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /home/daniel/esp/esp32-sniffer"...
-- IDF_TARGET not set, using default target: esp32
-- Found Git: /usr/bin/git (found version "2.25.1") 
-- Component directory /home/daniel/esp/esp32-sniffer/components/md5 does not contain a CMakeLists.txt file. No component will be added
-- Component directory /home/daniel/esp/esp32-sniffer/components/spiffs does not contain a CMakeLists.txt file. No component will be added
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /home/daniel/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /home/daniel/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
-- Check for working C compiler: /home/daniel/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /home/daniel/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++
-- Check for working CXX compiler: /home/daniel/.espressif/tools/xtensa-esp32-elf/esp-12.2.0_20230208/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32
-- Found Git: /usr/bin/git (found version "2.25.1") 
CMake Error at /home/daniel/esp/esp-idf/tools/cmake/component.cmake:224 (message):
  CMake Warning (dev) at build_properties.temp.cmake:8:

    Syntax Warning in cmake code at column 47

  

    Argument not separated from preceding token by whitespace.

  Call Stack (most recent call first):

    /home/daniel/esp/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:3 (include)

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

  

  CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:1029
  (define_property):

    define_property command is not scriptable

  Call Stack (most recent call first):

    /home/daniel/esp/esp-idf/tools/cmake/kconfig.cmake:1 (include)
    /home/daniel/esp/esp-idf/tools/cmake/idf.cmake:43 (include)
    /home/daniel/esp/esp-idf/tools/cmake/project.cmake:29 (include)
    /home/daniel/esp/esp32-sniffer/main/CMakeLists.txt:5 (include)
    /home/daniel/esp/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:106 (include)
    /home/daniel/esp/esp-idf/tools/cmake/scripts/component_get_requirements.cmake:124 (__component_get_requirements)

  

  

Call Stack (most recent call first):
  /home/daniel/esp/esp-idf/tools/cmake/build.cmake:573 (__component_get_requirements)
  /home/daniel/esp/esp-idf/tools/cmake/project.cmake:464 (idf_build_process)
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/home/daniel/esp/esp32-sniffer/build/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1, output of the command is in the /home/daniel/esp/esp32-sniffer/build/log/idf_py_stderr_output_19723 and /home/daniel/esp/esp32-sniffer/build/log/idf_py_stdout_output_19723

Going back to idf-release 3.2, then the following error occurs:

Note: You are using Python 3.8.10. Python 3 support is new, please report any problems you encounter. Search for 'Setting the Python Interpreter' in the ESP-IDF docs if you want to use Python 2.7.
Checking Python dependencies...
Python requirements from /home/daniel/esp/esp-idf/requirements.txt are satisfied.
Running cmake in directory /home/daniel/esp/esp32-sniffer/build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 --warn-uninitialized /home/daniel/esp/esp32-sniffer"...
Warn about uninitialized values.
-- Found Git: /usr/bin/git (found version "2.25.1") 
CMake Warning at /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:125 (message):
  Component contains old-style component.mk but no CMakeLists.txt.  Component
  will be skipped.
Call Stack (most recent call first):
  /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:132 (components_find_all)
  /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:264 (components_find_all)


CMake Warning at /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:125 (message):
  Component contains old-style component.mk but no CMakeLists.txt.  Component
  will be skipped.
Call Stack (most recent call first):
  /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:132 (components_find_all)
  /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:264 (components_find_all)


-- Building empty aws_iot component due to configuration
CMake Error at /usr/share/cmake-3.16/Modules/ExternalProject.cmake:1029 (define_property):
  define_property command is not scriptable
Call Stack (most recent call first):
  /home/daniel/esp/esp-idf/tools/cmake/kconfig.cmake:1 (include)
  /home/daniel/esp/esp-idf/tools/cmake/project.cmake:26 (include)
  main/CMakeLists.txt:5 (include)
  /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:174 (include)
  /home/daniel/esp/esp-idf/tools/cmake/scripts/expand_requirements.cmake:284 (expand_component_requirements)


CMake Error at /home/daniel/esp/esp-idf/tools/cmake/project.cmake:78 (include):
  include could not find load file:

    /home/daniel/esp/esp32-sniffer/build/component_depends.cmake
Call Stack (most recent call first):
  CMakeLists.txt:6 (project)


-- Configuring incomplete, errors occurred!
See also "/home/daniel/esp/esp32-sniffer/build/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1

Is this project still working then?

Edit: Instead of using the 'idf.py ...' command and running with 'make menuconfig', wasn't helpful either. It is complaining about ctype.h missing

@D4Ci0
Copy link

D4Ci0 commented Apr 5, 2023

In Windows I got a little bit further, but it wants a 'nghttp' plugin which was downloaded by myself manually via the idf.py add-component command. But still the same problem exists:

CMake Error at C:/Espressif/frameworks/esp-idf-v5.0.1/tools/cmake/build.cmake:245 (message):
  Failed to resolve component 'nghttp'.
Call Stack (most recent call first):
  C:/Espressif/frameworks/esp-idf-v5.0.1/tools/cmake/build.cmake:281 (__build_resolve_and_add_req)
  C:/Espressif/frameworks/esp-idf-v5.0.1/tools/cmake/build.cmake:574 (__build_expand_requirements)
  C:/Espressif/frameworks/esp-idf-v5.0.1/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:6 (project)

-- Configuring incomplete, errors occurred!
See also "C:/Users/main/esp32-sniffer-master/esp32-sniffer-master/build/CMakeFiles/CMakeOutput.log".

HINT: The component nghttp could not be found. This could be because: component name was misspelled, the component was not added to the build, the component has been moved to the IDF component manager or has been removed and refactored into some other component.
Please look out for component in 'https://components.espressif.com' and add using 'idf.py add-dependency' command.
Refer to the migration guide for more details about moved components.
Refer to the build-system guide for more details about how components are found and included in the build.

@Shashi630
Copy link

@J4NN0
\Downloads\darknet-master\darknet-master>cmake -DENABLE_CUDA=ON
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.

-- vcpkg not found, toolchain not defined, using integrated libs on win32
Darknet_VERSION: 0.2.5.7
-- Selecting Windows SDK version 10.0.22621.0 to target Windows 10.0.22631.
-- CUDA_PATH: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v11.0
-- CUDACXX:
CMake Error at CMakeLists.txt:188 (message):
CUDA not found, please build explicitly with -DENABLE_CUDA=OFF if you do
not want CUDA.

-- Configuring incomplete, errors occurred! how to fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants