Commit a2ed8162 authored by Jamie McCrae's avatar Jamie McCrae Committed by Henrik Brix Andersen
Browse files

cmake: modules: boards: Add normalised variables



Adds a new variable NORMALIZED_BOARD_QUALIFIERS which contains
the board qualifiers in file-name format, this allows for
constructing strings in applications (e.g. for folder names) prior
to Zephyr being found for things like APPLICATION_CONFIG_DIR. Also
adds NORMALIZED_BOARD_TARGET.

Signed-off-by: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
parent 7fd0a7a5
Loading
Loading
Loading
Loading
+17 −7
Original line number Diff line number Diff line
@@ -23,6 +23,11 @@
#
# - BOARD:                       Board, without revision field.
# - BOARD_REVISION:              Board revision
# - BOARD_QUALIFIERS:            Board qualifiers
# - NORMALIZED_BOARD_QUALIFIERS: Board qualifiers in lower-case format where slashes have been
#                                replaced with underscores
# - NORMALIZED_BOARD_TARGET:     Board target in lower-case format where slashes have been
#                                replaced with underscores
# - BOARD_DIR:                   Board directory with the implementation for selected board
# - ARCH_DIR:                    Arch dir for extracted from selected board
# - BOARD_ROOT:                  BOARD_ROOT with ZEPHYR_BASE appended
@@ -336,8 +341,13 @@ endif()
if(DEFINED BOARD_QUALIFIERS)
  string(REGEX REPLACE "^/" "qualifiers: " board_message_qualifiers "${BOARD_QUALIFIERS}")
  set(board_message "${board_message}, ${board_message_qualifiers}")

  string(REPLACE "/" "_" NORMALIZED_BOARD_QUALIFIERS "${BOARD_QUALIFIERS}")
endif()

set(NORMALIZED_BOARD_TARGET "${BOARD}${BOARD_QUALIFIERS}")
string(REPLACE "/" "_" NORMALIZED_BOARD_TARGET "${NORMALIZED_BOARD_TARGET}")

message(STATUS "${board_message}")

add_custom_target(boards ${list_boards_commands} USES_TERMINAL)