fix(keymaps): Properly locate split board keymaps.

* Find the unified keymap filename for onboard controller split
  keyboards.
This commit is contained in:
Peter Johanson 2021-10-18 02:50:11 +00:00 committed by Pete Johanson
parent 01d2102c23
commit 742f4c2826

View file

@ -67,6 +67,7 @@ foreach(root ${BOARD_ROOT})
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
if(BOARD_DIR) if(BOARD_DIR)
get_filename_component(BOARD_DIR_NAME ${BOARD_DIR} NAME)
list(APPEND KEYMAP_DIRS ${BOARD_DIR}) list(APPEND KEYMAP_DIRS ${BOARD_DIR})
endif() endif()
@ -130,7 +131,7 @@ endif()
if(NOT KEYMAP_FILE) if(NOT KEYMAP_FILE)
foreach(keymap_dir ${KEYMAP_DIRS}) foreach(keymap_dir ${KEYMAP_DIRS})
foreach(keymap_prefix ${SHIELD} ${SHIELD_DIR} ${BOARD} ${BOARD_DIR}) foreach(keymap_prefix ${SHIELD} ${SHIELD_DIR} ${BOARD} ${BOARD_DIR_NAME})
if (EXISTS ${keymap_dir}/${keymap_prefix}.keymap) if (EXISTS ${keymap_dir}/${keymap_prefix}.keymap)
set(KEYMAP_FILE "${keymap_dir}/${keymap_prefix}.keymap" CACHE STRING "Selected keymap file") set(KEYMAP_FILE "${keymap_dir}/${keymap_prefix}.keymap" CACHE STRING "Selected keymap file")
message(STATUS "Using keymap file: ${KEYMAP_FILE}") message(STATUS "Using keymap file: ${KEYMAP_FILE}")