Specifying APPLICATION_CONFIG_DIR for the configuration/

Note: This might actually be a documentation issue more than a real problem because the build seems to work. But some clarification would still be appreciated.

We're developing an application that follows a similar format as the nrf_desktop application. That includes having configuration/<board> directories to support multiple boards.

To do this, following https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.9.2/zephyr/application/index.html?highlight=application_config_dir#application-configuration-directory we have:

# # The application uses the configuration/<board> scheme for configuration files.
set(APPLICATION_CONFIG_DIR "configuration/\${BOARD}")

which, together with

# Boards are in the parent /boards direcotry. This needs to be added before find_package
list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../)

needs to be before the find_package command:

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(app LANGUAGES C VERSION 0.0.1)
However, the BOARD variable in CMAKE is actually <board>@<revision> until the find_package command so we can't use  ${BOARD} before find_package with revisions.
In fact, the build fails because of this check:
if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}")
  message(FATAL_ERROR
          "Board ${BOARD} is not supported.\n"
          "Please make sure board specific configuration files are added to "
          "${CMAKE_CURRENT_SOURCE_DIR}/configuration/${BOARD}")
endif()
Now, we can set  APPLICATION_CONFIG_DIR after the find_package but that goes against the documentation. 

Parents Reply Children
No Data
Related