Merge branch 'bugfix/cmake_example_sdkconfig_path' into 'master'

cmake/example: Move idf_as_lib sdkconfig path to project, document configuring project

See merge request espressif/esp-idf!8649
This commit is contained in:
Angus Gratton
2020-10-16 07:10:08 +08:00
4 changed files with 36 additions and 13 deletions

View File

@@ -14,7 +14,7 @@ if("${TARGET}" STREQUAL "esp32")
# processing the component is needed for flashing related
# targets and file generation
COMPONENTS esp32 freertos esptool_py
SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig
SDKCONFIG ${CMAKE_CURRENT_LIST_DIR}/sdkconfig
BUILD_DIR ${CMAKE_BINARY_DIR})
else()
# Create stubs for esp32 and freertos, stub::esp32 and stub::freertos

View File

@@ -44,6 +44,8 @@ or run [build.sh](./build.sh) to build for the host:
./build-esp32.sh
```
Note: To build for a different target SoC, copy the `build-esp32.sh` file and change the `-DTARGET=esp32` clause on the second line.
or
```bash
@@ -68,6 +70,24 @@ or
./run.sh
```
## Configuring this Example
To modify the example ESP-IDF project configuration, first create the CMake build directory. This can be done by running `build-esp32.sh` or by running only the first two lines in `build-esp32.sh` (which won't build the actual project yet).
Then execute the menuconfig build target in the build directory:
```bash
cmake --build build -- menuconfig
```
If using ninja directly:
```bash
ninja -C build menuconfig
```
Note: ESP-IDF project configuration isn't used by the host CMake builds, the config is only read when the project is built using the ESP-IDF build system.
---
There is a discussion on using ESP-IDF in custom CMake projects in the programming guide under `API Guides` -> `Build System` -> `Using ESP-IDF in Custom CMake Projects`