I am looking to restructure the project to an AUTOSAR formatted version as shown below:
GA_Restructure/
├─ target/ <-- main component
│ ├─ source/
│ │ ├─ GA_main.c <-- contains app_main()
│ │ └─ wifi.c
│ ├─ include/
│ │ └─ wifi.h
│ └─ CMakeLists.txt <-- component CMakeLists
├─ CMakeLists.txt <-- root project CMakeLists
└─ sdkconfig
So I've been having issues with building this. It seems it cannot find app_main.
In the root CMake list I set IDF_MAIN_COMPONENT to look at the target folder.
In the component CMakelist I defined idf_component_register to look at source/GA_main.c for app_main.
Directory Restructure - ESPNOW-example
-
akhan@eleappower.com
- Posts: 4
- Joined: Fri Aug 22, 2025 6:05 pm
-
akhan@eleappower.com
- Posts: 4
- Joined: Fri Aug 22, 2025 6:05 pm
Re: Directory Restructure - ESPNOW-example
Oh sorry attached root and components CMAKElists
- Attachments
-
- CMakeLists.txt
- (158 Bytes) Downloaded 24 times
-
- CMakeLists.txt
- (427 Bytes) Downloaded 22 times
-
nopnop2002
- Posts: 347
- Joined: Thu Oct 03, 2019 10:52 pm
- Contact:
Re: Directory Restructure - ESPNOW-example
Code: Select all
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/target)
#set(EXTRA_COMPONENTS_DIRS ${PROJECT_SOURCE_DIR}/target)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(test)
-
MicroController
- Posts: 2669
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: Directory Restructure - ESPNOW-example
Guess that's not going to work. There are no component directories inside "target".
-
akhan@eleappower.com
- Posts: 4
- Joined: Fri Aug 22, 2025 6:05 pm
Re: Directory Restructure - ESPNOW-example
Hi
Actually this line:
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/target")
worked for me. As in I was able to build it without seeing any issues.
For context my directory structure did change a bit
target
|
||---esp32
|||---Include
|||---Source
Thank you.
Actually this line:
set(EXTRA_COMPONENT_DIRS "${CMAKE_CURRENT_LIST_DIR}/target")
worked for me. As in I was able to build it without seeing any issues.
For context my directory structure did change a bit
target
|
||---esp32
|||---Include
|||---Source
Thank you.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot], PetalBot and 3 guests
