Also move into 'build/config/' subdir, remove creation of empty include/config dir.
set(LD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ld)
add_custom_command(
OUTPUT esp32_out.ld
- COMMAND "${CMAKE_C_COMPILER}" -C -P -x c -E -o esp32_out.ld -I ${CMAKE_BINARY_DIR} ${LD_DIR}/esp32.ld
- MAIN_DEPENDENCY ${LD_DIR}/esp32.ld
+ COMMAND "${CMAKE_C_COMPILER}" -C -P -x c -E -o esp32_out.ld -I ${CONFIG_DIR} ${LD_DIR}/esp32.ld
+ MAIN_DEPENDENCY ${LD_DIR}/esp32.ld ${SDKCONFIG_H}
COMMENT "Generating linker script..."
VERBATIM)
add_custom_target(esp32_linker_script DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/esp32_out.ld)
- ``project_description.json`` contains some general information about the ESP-IDF project, configured paths, etc.
- ``flasher_args.json`` contains esptool.py arguments to flash the project's binary files. There are also ``flash_*_args`` files which can be used directly with esptool.py. See `Flash arguments`_.
- ``CMakeCache.txt`` is the CMake cache file which contains other information about the CMake process, toolchain, etc.
-- ``sdkconfig.json`` is a JSON-formatted version of the project configuration values.
+- ``config/sdkconfig.json`` is a JSON-formatted version of the project configuration values.
.. _esp-idf-template: https://github.com/espressif/esp-idf-template
.. _cmake: https://cmake.org
# go into the final binary so have no impact on size)
add_compile_options(-ggdb)
- add_compile_options("-I${CMAKE_BINARY_DIR}") # for sdkconfig.h
-
# Enable ccache if it's on the path
if(NOT CCACHE_DISABLE)
find_program(CCACHE_FOUND ccache)
include(ExternalProject)
macro(kconfig_set_variables)
+ set(CONFIG_DIR ${CMAKE_BINARY_DIR}/config)
set_default(SDKCONFIG ${PROJECT_PATH}/sdkconfig)
- set(SDKCONFIG_HEADER ${CMAKE_BINARY_DIR}/sdkconfig.h)
- set(SDKCONFIG_CMAKE ${CMAKE_BINARY_DIR}/sdkconfig.cmake)
- set(SDKCONFIG_JSON ${CMAKE_BINARY_DIR}/sdkconfig.json)
+ set(SDKCONFIG_HEADER ${CONFIG_DIR}/sdkconfig.h)
+ set(SDKCONFIG_CMAKE ${CONFIG_DIR}/sdkconfig.cmake)
+ set(SDKCONFIG_JSON ${CONFIG_DIR}/sdkconfig.json)
set(ROOT_KCONFIG ${IDF_PATH}/Kconfig)
set_default(SDKCONFIG_DEFAULTS "${SDKCONFIG}.defaults")
+
+ # ensure all source files can include sdkconfig.h
+ include_directories("${CONFIG_DIR}")
endmacro()
if(CMAKE_HOST_WIN32)
# Find all Kconfig files for all components
function(kconfig_process_config)
- file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/include/config")
+ file(MAKE_DIRECTORY "${CONFIG_DIR}")
set(kconfigs)
set(kconfigs_projbuild)