{"id":13343764,"url":"https://github.com/lmapii/zephyr-kconfig-root","last_synced_at":"2026-01-02T16:15:39.173Z","repository":{"id":226168080,"uuid":"767942528","full_name":"lmapii/zephyr-kconfig-root","owner":"lmapii","description":"Demo repository exploring how to use multiple Kconfig files","archived":false,"fork":false,"pushed_at":"2024-03-06T12:29:50.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T22:47:39.546Z","etag":null,"topics":["kconfig","zephyr","zephyr-rtos"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lmapii.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-06T07:18:01.000Z","updated_at":"2024-09-05T12:55:48.000Z","dependencies_parsed_at":"2024-10-24T09:02:35.672Z","dependency_job_id":null,"html_url":"https://github.com/lmapii/zephyr-kconfig-root","commit_stats":null,"previous_names":["lmapii/zephyr-kconfig-root"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmapii%2Fzephyr-kconfig-root","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmapii%2Fzephyr-kconfig-root/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmapii%2Fzephyr-kconfig-root/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmapii%2Fzephyr-kconfig-root/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmapii","download_url":"https://codeload.github.com/lmapii/zephyr-kconfig-root/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243171367,"owners_count":20247876,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kconfig","zephyr","zephyr-rtos"],"created_at":"2024-07-29T19:32:00.699Z","updated_at":"2026-01-02T16:15:39.138Z","avatar_url":"https://github.com/lmapii.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Locating `Kconfig` files\n\nThis is a repository demonstrating how to use or place `Kconfig` files. It uses freestanding applications - even though workspaces would definitely be the better solution. This becomes clear once looking at the final example when using Zephyr modules.\n\n\u003e **Note:** All examples specify the CMake variables in the `CMakeLists.txt` for demonstration purposes. As usual, the variables could also be set during build time.\n\n\n## Replacing the application's Kconfig root directory\n\nDemonstrated by [app_00_replace_root](./app_00_replace_root/CMakeLists.txt).\n\nThis example shows how to specify an alternative path for the `Kconfig` file that is otherwise automatically detected in the application's root directory using the CMake variable `KCONFIG_ROOT`. Instead of using its own `Kconfig` file, it uses the Kconfig file placed in [`kconfig-root`](./kconfig-root/Kconfig)\n\nNotice that this is really only recommended as a lazy way to have the **very same** `Kconfig` file, e.g., for multiple samples. I'd not recommend this.\n\n\n## Using `rsource` to source Kconfig files\n\nDemonstrated by [app_01_rsource](./app_01_rsource/CMakeLists.txt).\n\nZephyr provides a [Kconfig extension `rsource`](https://docs.zephyrproject.org/latest/build/kconfig/extensions.html) which allows to source `Kconfig` files with relative paths.\n\nIn this approach, the application provides its own [`Kconfig`](./app_01_rsource/Kconfig) file in the application's root directory (automatically detected by Zephyr since we're not manipulating the `KCONFIG_ROOT` build variable). Within this `Kconfig` file it is possible to use `rsource` to source `Kconfig` files from different locations, e.g., the files in [`kconfig-rsource`](./kconfig-rsource/).\n\n\u003e **Note:** In contrast to [app_00_replace_root](./app_00_replace_root/CMakeLists.txt), the root `Kconfig` file **must** source `Kconfig.zephr`. Have a look at the detailed explanation in the [`Kconfig`](./app_01_rsource/Kconfig) file.\n\n\n## Advanced: Using extra Zephyr modules\n\nDemonstrated by [app_02_modules](./app_02_modules/CMakeLists.txt).\n\nThis is probably the cleanest but also the most advanced approach: Zephyr supports [\"modules\"](https://docs.zephyrproject.org/latest/develop/modules.html#module-integration-files-zephyr-module-yml), which are typically used to include external projects such as [Nanopb](https://github.com/nanopb/nanopb/blob/master/zephyr/module.yml).\n\nIn this approach we extend the build variable `EXTRA_ZEPHYR_MODULES` to point to a [dummy module](./extra-zephyr-modules/dummy/zephyr/module.yml), which also has its own [`Kconfig` file](./extra-zephyr-modules/dummy/Kconfig).\n\nPlease have a look at the documentation in the [application's `CMakeLists.txt`](./app_02_modules/CMakeLists.txt) and the [module's `module.yml` file](./extra-zephyr-modules/dummy/zephyr/module.yml).\n\n\u003e **Note:** This approach shines when switching to workspace applications, which is definitely the recommended way to work with Zephyr. Then it is no longer necessary to use `EXTRA_ZEPHYR_MODULES` since West will take care of all modules.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmapii%2Fzephyr-kconfig-root","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmapii%2Fzephyr-kconfig-root","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmapii%2Fzephyr-kconfig-root/lists"}