KConfig 使用文档
https://www.cnblogs.com/fluidog/p/15176680.html
https://pypi.org/project/kconfiglib/#installation-with-pip
https://www.kernel.org/doc/html/latest/kbuild/kconfig-language.html
https://github.com/viys/kconfig
Windows
Section titled “Windows”- cmake
- make
- MinGW
- python
# 安装号 python 后用下面命令安装 kconfiglib 工具链python -m pip install windows-cursespython -m pip install kconfiglibCmake 构建
Section titled “Cmake 构建”# 在 CMakeLists.txt 目录下执行下面命令mkdir buildcd .\build\cmake -G "MinGW Makefiles" ..打开 Kconfig
Section titled “打开 Kconfig”# 开启 CMakeLists.txt 文件中的 CMAKE_HOST_WIN32 menuconfig 注释可以切换 menuconfig 工具# kconfiglib 的 menuconfig.exe 比较容易有残影# mconf-idf.exe 有乱码,切换为 utf-8 编码后并使用英文菜单可以减少乱码带来的问题缺失# 在 build 目录下执行下面命令,即可对工程进行配置make menuconfig# 在 build 目录下执行下面命令,即可对工程进行编译make- cmake
- make
- gxx
- python
# 更新 aptsudo apt updatesudo apt upgrade# 安装工具包sudo apt install python3-kconfiglibsudo apt-get install libncurses-dev kconfig-frontends修改 CMakeListsxtxt
Section titled “修改 CMakeListsxtxt”将 python 修改为自己系统上已有的 python 版本,如 python3 (可以直接略过此步,本工程已更新中 CmakeLists.txt 在不同系统中做了预处理)
Cmake 构建
Section titled “Cmake 构建”# 在 CMakeLists.txt 目录下执行下面命令mkdir buildcd build/cmake ..打开 Kconfig
Section titled “打开 Kconfig”# 在 build 目录下执行下面命令,即可对工程进行配置make menuconfig# 在 build 目录下执行下面命令,即可对工程进行编译make后期可以根据自己的系统使用脚本来实现项目的管理.
Kconfig 的高级用法见仓库 https://github.com/viys/oopc_cmake_stu advanced 分支