cmake: Show usage when an invalid board is given

Print the usage when an invalid board is given, this somewhat
allievates the catch-22 where you need to run CMake to know what
boards exist, but you need a board to run CMake.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
Sebastian Bøe 2017-12-06 13:56:12 +01:00 committed by Anas Nashif
commit b0c4316190

View file

@ -155,7 +155,8 @@ set(CACHED_BOARD ${BOARD} CACHE STRING "Selected board")
# e.g. zephyr/boards/arm/96b_carbon_nrf51/96b_carbon_nrf51_defconfig. When
# found, use that path to infer the ARCH we are building for.
find_path(BOARD_DIR NAMES "${BOARD}_defconfig" PATHS $ENV{ZEPHYR_BASE}/boards/*/* NO_DEFAULT_PATH)
assert(BOARD_DIR "No board named '${BOARD}' found")
assert_with_usage(BOARD_DIR "No board named '${BOARD}' found")
get_filename_component(BOARD_ARCH_DIR ${BOARD_DIR} DIRECTORY)
get_filename_component(ARCH ${BOARD_ARCH_DIR} NAME)