Skip to content

cmake: kconfig: Add APP_DIR to kconfig environment #3022

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nordicjm
Copy link
Contributor

@nordicjm nordicjm commented Jul 7, 2025

Add APP_DIR as a kconfig environment variable.

This is useful in cases where you want to set a config path relative to the directory of the application.

An example of this is how many sysbuild.cmake files sets the source directory like this:

ExternalZephyrProject_Add(
APPLICATION remote
SOURCE_DIR ${APP_DIR}/remote
BOARD ${SB_CONFIG_REMOTE_BOARD}
)

The same however cannot be done in Kconfig.sysbuild:

config NETCORE_IMAGE_PATH
default "${APP_DIR}/<image_path>" if NETCORE_ABC

Instead they must use ZEPHYR_MY_MODULE_MODULE_DIR, however not all applications are part of a zephyr module.

Upstream PR #: 92674

manifest-pr-skip

Add APP_DIR as a kconfig environment variable.

This is useful in cases where you want to set a config path relative to
the directory of the application.

An example of this is how many sysbuild.cmake files sets the source
directory like this:

ExternalZephyrProject_Add(
  APPLICATION remote
  SOURCE_DIR ${APP_DIR}/remote
  BOARD ${SB_CONFIG_REMOTE_BOARD}
)

The same however cannot be done in Kconfig.sysbuild:

config NETCORE_IMAGE_PATH
    default "${APP_DIR}/<image_path>" if NETCORE_ABC

Instead they must use ZEPHYR_MY_MODULE_MODULE_DIR, however not all
applications are part of a zephyr module.

Signed-off-by: Joakim Andersson <joerchan@gmail.com>
(cherry picked from commit 12fdde6694e7a1be065d65c335aeadf7129e34bf)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants