diff --git a/app/cmake/zmk_config.cmake b/app/cmake/zmk_config.cmake index 8ecf710a..e4d2632f 100644 --- a/app/cmake/zmk_config.cmake +++ b/app/cmake/zmk_config.cmake @@ -44,13 +44,13 @@ endif() set(CACHED_ZMK_CONFIG ${ZMK_CONFIG} CACHE STRING "Selected user ZMK config") if (ZMK_CONFIG) - if(EXISTS "${ZMK_CONFIG}/boards") + if(EXISTS ${ZMK_CONFIG}/boards) message(STATUS "Adding ZMK config directory as board root: ${ZMK_CONFIG}") - list(APPEND BOARD_ROOT "${ZMK_CONFIG}") + list(APPEND BOARD_ROOT ${ZMK_CONFIG}) endif() - if(EXISTS "${ZMK_CONFIG}/dts") + if(EXISTS ${ZMK_CONFIG}/dts) message(STATUS "Adding ZMK config directory as DTS root: ${ZMK_CONFIG}") - list(APPEND DTS_ROOT "${ZMK_CONFIG}") + list(APPEND DTS_ROOT ${ZMK_CONFIG}) endif() endif() @@ -76,6 +76,7 @@ foreach(root ${BOARD_ROOT}) NO_DEFAULT_PATH ) foreach(shield_path ${shields_refs_list}) + get_filename_component(SHIELD_DIR ${shield_path} NAME) if (EXISTS "${shield_path}/keymap") list(APPEND KEYMAP_DIRS ${shield_path}/keymap) endif() @@ -101,7 +102,7 @@ if (BASE_KEYMAPS_DIR) endif() if (ZMK_CONFIG) - if (EXISTS "${ZMK_CONFIG}") + if (EXISTS ${ZMK_CONFIG}) message(STATUS "ZMK Config directory: ${ZMK_CONFIG}") list(APPEND DTS_ROOT ${ZMK_CONFIG}) if (EXISTS "${ZMK_CONFIG}/include") @@ -109,8 +110,13 @@ if (ZMK_CONFIG) endif() if (SHIELD) + message(STATUS "Board: ${BOARD}, ${BOARD_DIR}, ${SHIELD}, ${SHIELD_DIR}") + list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD_DIR}.overlay") + list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD_DIR}_${BOARD}.overlay") list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD}_${BOARD}.overlay") list(APPEND overlay_candidates "${ZMK_CONFIG}/${SHIELD}.overlay") + list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD_DIR}.conf") + list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD_DIR}_${BOARD}.conf") list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD}_${BOARD}.conf") list(APPEND config_candidates "${ZMK_CONFIG}/${SHIELD}.conf") endif()