boards

Validate board and setup boards target.

This CMake module will validate the BOARD argument as well as splitting it into <BOARD> and <BOARD_REVISION>.

If a board implementation is not found for the specified board an error will be raised and list of valid boards will be printed.

If user provided board is a board alias, the board will be adjusted to real board name.

If board name is deprecated, then board will be adjusted to new board name and a deprecation warning will be printed to the user.

Required variables

Optional variables

Variables

The following variables will be defined when this CMake module completes:

Targets

The following targets will be defined when this CMake module completes:

  • boards

    When invoked, a list of valid boards will be printed.

Optional environment variables

ZEPHYR_BOARD_ALIASES

Environment setting pointing to a CMake file containing board aliases.

Example usage

# BOARD is normally given on the command line, for example:
#   west build -b nrf52840dk/nrf52840
include(boards)

message(STATUS "Building for ${BOARD} (${NORMALIZED_BOARD_TARGET})")
message(STATUS "Board files are in ${BOARD_DIR}")