CMake build support for Kconfiglib library. This project supports CMake and C header file generation from Kconfig file with default configuration support (E.g. Kconfig.defaults).
- Generated CMake and C header files are placed in
${CMAKE_BINARY_DIR}/config
- CMake file is included to project (to customize build) at kconfig.cmake
- C Header file path is included to project at kconfig.cmake
- Updated configuration file (sdkconfig) generated at project directory
- Copy cmake and scripts into project
- Create 'SCRIPTS_DIR' cmake variable with scripts folder location. E.g.
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/scripts)
- Include python and kconfig in project cmake file. E.g.
include(${CMAKE_SOURCE_DIR}/cmake/python.cmake)
andinclude(${CMAKE_SOURCE_DIR}/cmake/Kconfig.cmake)
- Update below cmake variables if required in kconfig.cmake
set(CONFIG_OUTPUT_DIR ${CMAKE_BINARY_DIR}/config)
set(KCONFIG_INPUT Kconfig)
set(CONFIG_PROJECT sdkconfig)
set(CONFIG_DEFAULT sdkconfig.defaults)
- Run
cmake --build build_output_path --target menuconfig
to launch menuconfig in terminal
- Tested with Ubuntu 22.04 and GCC 11.4.0
- Refer Kconfiglib for Windows dependencies